Version: 10.16.0
Class

solace.TraceContext

Contents

class solace.TraceContext

Abstract constructor for readonly view on metadata used for distributed message tracing.

Constructor Top

  TraceContext ( TraceContextSetter traceContextSetter )

Properties Top

isSampled
MAX_TRACE_STATE_LENGTH
spanId
traceId
traceState
version

Static Methods Top

TraceContext clone ( TraceContext toClone )

Methods Top

Uint8Array getEncodedTraceContext ( )
Boolean getIsSampled ( )
String getSpanId ( )
String getTraceId ( )
String getTraceState ( )
String getTruncatedTraceState ( )
Number getVersion ( )
void toString ( )

Constructor details Top

TraceContext ( TraceContextSetter traceContextSetter )

Abstract constructor for readonly view on metadata used for distributed message tracing.

Parameters

TraceContextSetter traceContextSetter

{TraceContextSetter}

Static Methods Detail Top

static public TraceContext clone ( TraceContext toClone )

Clone the a TraceContext object used for distributed message tracing.

Parameters

TraceContext toClone

{TraceContext}

Return Value

TraceContext

the newly cloned TraceContext instance

Properties Detail Top

public isSampled

The isSampled boolean property

public MAX_TRACE_STATE_LENGTH

The maximum allowed string size of trace state to propagate.

Refer: https://www.w3.org/TR/trace-context/#tracestate-limits

public spanId

The spanId property a 8-length string

public traceId

The tranceId property as a 16-length string

public traceState

The traceState property

public version

The version which for now is 1.

Methods Detail Top

public Uint8Array getEncodedTraceContext ( )

It returns the encoded bytes that is passed to the SMF header to be encoded in SMF for the message.

Return Value

Uint8Array

The value of encoded trace span context

(Optional)

public Boolean getIsSampled ( )

Returns true if the sampling for the associated message is on, otherwise false.

Return Value

Boolean

indicates whether the sampling is on or off

public String getSpanId ( )

Gets the value of the span identifier associated with the message.

Return Value

String

value of span identifier associated with the message as 8-length string.

public String getTraceId ( )

Gets the value of the trace identifier associated with the message.

Return Value

String

value of trace identifier associated with the message as 16-length string.

public String getTraceState ( )

Gets the value of the trace state associated with the message.

See w3c trace state format specification

Return Value

String

The value of trace state associated with the message

(Optional)

public String getTruncatedTraceState ( )

Gets the value of the trace state associated with the message.

See w3c trace state format specification

Return Value

String

The value of trace state associated with the message

(Optional)

public Number getVersion ( )

Gets the version associated with the message trace.

Return Value

Number

The version encoded as Hex value

public void toString ( )

Returns the string representation of this object

Return Value

void