CVB.Net 15.1
Loading...
Searching...
No Matches

A span object to report traces. More...

Inherits AttributeMap.

Public Member Functions

void Succeed ()
 Set the span status to success.
 
Succeed< T > (T value)
 Return a result and set the span status to success.
 
void Fail ()
 Set the span status to fail.
 
void Fail (string message)
 Set the span status to fail with a message.
 
Return< T > (T value)
 Set the span status based on return code evaluation.
 
ReturnBool< T > (T value)
 Set the span status based on a boolean interpretation of a result.
 
void SetStatusMessage (string msg)
 Sets the status message.
 
void Raise (Exception ex)
 Set the span status to fail and throw an exception.
 
Span AddAttribute (string name, string value)
 Adds a string attribute to the span.
 
Span AddAttribute (string name, long value)
 Adds a long attribute to the span.
 
Span AddAttribute (string name, bool value)
 Adds a bool attribute to the span.
 
Span AddAttribute (string name, double value)
 Adds a double attribute to the span.
 
- Public Member Functions inherited from AttributeMap
virtual void Dispose (bool disposing)
 IDisposable helper function.
 
void Dispose ()
 IDisposable implementation.
 

Protected Member Functions

override void SendData ()
 Sends the span.
 
- Protected Member Functions inherited from AttributeMap
void Attribute (string name, string value)
 Adds a string attribute to the map.
 
void Attribute (string name, bool value)
 Adds a bool attribute to the map.
 
void Attribute (string name, long value)
 Adds a long attribute to the map.
 
void Attribute (string name, double value)
 Adds a double attribute to the map.
 
void SendData ()
 Sends the data.
 

Additional Inherited Members

- Properties inherited from AttributeMap
bool IsEnabled [get]
 If this object is active.
 
IntPtr Handle [get]
 Native handle of the Module.
 
bool IsDisposed [get]
 Gets if the native handle has been disposed.
 
- Events inherited from AttributeMap
NativeHandleEventDelegate ObjectDisposing
 Raised when this object is about to be disposed via the IDisposable.Dispose method.
 
- Events inherited from INativeHandle
NativeHandleEventDelegate ObjectDisposing
 Raised when this object is about to be disposed via the IDisposable.Dispose method.
 

Detailed Description

A span object to report traces.

When tracing is disabled, operations on a Span object are no-ops.

Member Function Documentation

◆ AddAttribute() [1/4]

Span AddAttribute ( string name,
bool value )

Adds a bool attribute to the span.

Parameters
nameName/key of the attribute.
valueValue of the attribute.
Returns
This log object.

◆ AddAttribute() [2/4]

Span AddAttribute ( string name,
double value )

Adds a double attribute to the span.

Parameters
nameName/key of the attribute.
valueValue of the attribute.
Returns
This log object.

◆ AddAttribute() [3/4]

Span AddAttribute ( string name,
long value )

Adds a long attribute to the span.

Parameters
nameName/key of the attribute.
valueValue of the attribute.
Returns
This log object.

◆ AddAttribute() [4/4]

Span AddAttribute ( string name,
string value )

Adds a string attribute to the span.

Parameters
nameName/key of the attribute.
valueValue of the attribute.
Returns
This log object.

◆ Fail()

void Fail ( string message)

Set the span status to fail with a message.

Parameters
messageFailure message.

◆ Raise()

void Raise ( Exception ex)

Set the span status to fail and throw an exception.

Parameters
exThe exception to throw.

◆ Return< T >()

T Return< T > ( T value)

Set the span status based on return code evaluation.

Template Parameters
TType of the return code.
Parameters
valueThe return code.
Returns
The return code.
Type Constraints
T :struct 

◆ ReturnBool< T >()

T ReturnBool< T > ( T value)

Set the span status based on a boolean interpretation of a result.

Template Parameters
TType of the result.
Parameters
valueThe result.
Returns
The result.
Type Constraints
T :struct 

◆ SetStatusMessage()

void SetStatusMessage ( string msg)

Sets the status message.

Parameters
msgThe status message.

◆ Succeed< T >()

T Succeed< T > ( T value)

Return a result and set the span status to success.

Template Parameters
TResult type.
Parameters
valueThe result to return.
Returns
The result.