Class NullManagedTracer (4.3.1)

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
TypeDescription
NullManagedTracer

Methods

AnnotateSpan(Dictionary<String, String>)

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

Does nothing.

Parameter
NameDescription
labelsDictionary<String, String>

GetCurrentSpanId()

public ulong? GetCurrentSpanId()

Always returns null.

Returns
TypeDescription
Nullable<UInt64>

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<T>
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
funcFunc<Task<T>>
nameString
optionsStartSpanOptions
Returns
TypeDescription
Task<T>
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.