Class ManagedTracer (4.4.0)

public static class ManagedTracer

Functions to create IManagedTracers.

Inheritance

Object > ManagedTracer

Namespace

Google.Cloud.Diagnostics.Common

Assembly

Google.Cloud.Diagnostics.Common.dll

Methods

CreateConsumer(TraceServiceClient, TraceOptions)

public static IConsumer<Trace> CreateConsumer(TraceServiceClient client, TraceOptions options)

Creates a trace consumer for a TraceServiceClient and options.

Parameters
NameDescription
clientTraceServiceClient

The trace client. Must not be null.

optionsTraceOptions

Trace options. Must not be null.

Returns
TypeDescription
IConsumer<Trace>

CreateDelegatingTracer(Func<IManagedTracer>)

public static IManagedTracer CreateDelegatingTracer(Func<IManagedTracer> tracerFactory)

Creates an IManagedTracer that delegates all calls to another IManagedTracer that is retrieved from the given function on each method call.

Parameter
NameDescription
tracerFactoryFunc<IManagedTracer>
Returns
TypeDescription
IManagedTracer

CreateFactory(String, IConsumer<Trace>, TraceOptions)

public static Func<ITraceContext, IManagedTracer> CreateFactory(string projectId, IConsumer<Trace> consumer, TraceOptions options)

Create a factory to generate an IManagedTracer from an ITraceContext.

Parameters
NameDescription
projectIdString

The Google Cloud Platform project ID. Must not be null

consumerIConsumer<Trace>

The trace consumer. Must not be null.

optionsTraceOptions

Trace options. Must not be null.

Returns
TypeDescription
Func<ITraceContext, IManagedTracer>

CreateTracerFactory(String, IConsumer<Trace>, TraceOptions)

[Obsolete("Please use Google.Cloud.Diagnostics.Common.ManagedTracer.CreateFactory instead which only differs in that the returned factory will accept any ITraceContext as input.")]
public static Func<TraceHeaderContext, IManagedTracer> CreateTracerFactory(string projectId, IConsumer<Trace> consumer, TraceOptions options)

Create a factory to generate an IManagedTracer from a TraceHeaderContext.

Parameters
NameDescription
projectIdString

The Google Cloud Platform project ID. Must not be null

consumerIConsumer<Trace>

The trace consumer. Must not be null.

optionsTraceOptions

Trace options. Must not be null.

Returns
TypeDescription
Func<TraceHeaderContext, IManagedTracer>
Remarks

This method has been made obsolete. You should use CreateFactory(String, IConsumer<Trace>, TraceOptions) instead. The function returned by CreateFactory(String, IConsumer<Trace>, TraceOptions) will accept any ITraceContext as input and not just TraceHeaderContext.