Google.Cloud.Diagnostics.Common - Class ContextTracerManager (5.1.0)

public static class ContextTracerManager

Reference documentation and code samples for the Google.Cloud.Diagnostics.Common class ContextTracerManager.

Manages access to the current IManagedTracer.

Inheritance

object > ContextTracerManager

Namespace

GoogleCloudGoogle.Cloud.DiagnosticsCommon

Assembly

Google.Cloud.Diagnostics.Common.dll

Methods

GetCurrentTraceContext()

public static ITraceContext GetCurrentTraceContext()

Gets the current ITraceContext as defined by the GetCurrentTracer() or null if the current trace context is not known at the time.

Returns
TypeDescription
ITraceContext

GetCurrentTracer()

public static IManagedTracer GetCurrentTracer()

Gets the current IManagedTracer or a NullManagedTracer if none exists.

Returns
TypeDescription
IManagedTracer

SetCurrentTracer(IManagedTracer)

public static void SetCurrentTracer(IManagedTracer tracer)

Sets the current IManagedTracer. This is called for each new trace context.

Parameter
NameDescription
tracerIManagedTracer