Google.Cloud.Diagnostics.Common - Class NullManagedTracer (5.1.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

GoogleCloudGoogle.Cloud.DiagnosticsCommon

Assembly

Google.Cloud.Diagnostics.Common.dll

Fields

Instance

public static readonly NullManagedTracer Instance

Instance of NullManagedTracer

Field Value
TypeDescription
NullManagedTracer

Methods

AnnotateSpan(Dictionary<string, string>)

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

Does nothing.

Parameter
NameDescription
labelsDictionarystringstring

GetCurrentSpanId()

public ulong? GetCurrentSpanId()

Always returns null.

Returns
TypeDescription
ulong

GetCurrentTraceId()

public string GetCurrentTraceId()

Always returns null.

Returns
TypeDescription
string

RunInSpan(Action, string, StartSpanOptions)

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

Calls action.

Parameters
NameDescription
actionAction
namestring
optionsStartSpanOptions

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
NameDescription
funcFunc
namestring
optionsStartSpanOptions
Returns
TypeDescription
T
Type Parameter
NameDescription
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
NameDescription
funcFuncTask
namestring
optionsStartSpanOptions
Returns
TypeDescription
Task
Type Parameter
NameDescription
T

SetStackTrace(StackTrace)

public void SetStackTrace(StackTrace stackTrace)

Does nothing.

Parameter
NameDescription
stackTraceStackTrace

StartSpan(string, StartSpanOptions)

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

Does nothing.

Parameters
NameDescription
namestring
optionsStartSpanOptions
Returns
TypeDescription
ISpan

Returns an IDisposable that does nothing when disposed.