Google.Cloud.Diagnostics.Common - Class NullManagedTracer (5.2.0)

public sealed class NullManagedTracer : IManagedTracer

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

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 Dictionarystringstring

GetCurrentSpanId()

public ulong? GetCurrentSpanId()

Always returns null.

Returns
Type Description
ulong

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

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 FuncTask
name string
options StartSpanOptions
Returns
Type Description
Task
Type Parameter
Name Description
T

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
name string
options StartSpanOptions
Returns
Type Description
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.