Class NullManagedTracer (5.0.0)

public sealed class NullManagedTracer : IManagedTracer

A managed tracer that does not trace.

Inheritance

Object > NullManagedTracer

Implements

IManagedTracer

Namespace

Google.Cloud.Diagnostics.Common

Assembly

Google.Cloud.Diagnostics.Common.dll

Fields

Instance

public static readonly NullManagedTracer Instance

Instance of NullManagedTracer

Field Value
Type Description
NullManagedTracer

Methods

AnnotateSpan(Dictionary<String, String>)

public void AnnotateSpan(Dictionary<string, string> labels)

Does nothing.

Parameter
Name Description
labels Dictionary<String, String>

GetCurrentSpanId()

public ulong? GetCurrentSpanId()

Always returns null.

Returns
Type Description
Nullable<UInt64>

GetCurrentTraceId()

public string GetCurrentTraceId()

Always returns null.

Returns
Type Description
String

RunInSpan(Action, String, StartSpanOptions)

public void RunInSpan(Action action, string name, StartSpanOptions options = null)

Calls action.

Parameters
Name Description
action Action
name String
options StartSpanOptions

RunInSpan<T>(Func<T>, String, StartSpanOptions)

public T RunInSpan<T>(Func<T> func, string name, StartSpanOptions options = null)

Calls func and returns the result.

Parameters
Name Description
func Func<T>
name String
options StartSpanOptions
Returns
Type Description
T
Type Parameter
Name Description
T

RunInSpanAsync<T>(Func<Task<T>>, String, StartSpanOptions)

public Task<T> RunInSpanAsync<T>(Func<Task<T>> func, string name, StartSpanOptions options = null)

Calls func asynchronously and returns the result.

Parameters
Name Description
func Func<Task<T>>
name String
options StartSpanOptions
Returns
Type Description
Task<T>
Type Parameter
Name Description
T

SetStackTrace(StackTrace)

public void SetStackTrace(StackTrace stackTrace)

Does nothing.

Parameter
Name Description
stackTrace StackTrace

StartSpan(String, StartSpanOptions)

public ISpan StartSpan(string name, StartSpanOptions options = null)

Does nothing.

Parameters
Name Description
name String
options StartSpanOptions
Returns
Type Description
ISpan

Returns an IDisposable that does nothing when disposed.