Version:

Modules reference / tracing / Module opentracing.span_context
Modules reference / tracing / Module opentracing.span_context

Module opentracing.span_context

Module opentracing.span_context

SpanContext represents Span state that must propagate to descendant Span ‘s and across process boundaries.

SpanContext is logically divided into two pieces: the user-level “Baggage” (see Span.set_baggage_item and Span.get_baggage_item ) that propagates across Span boundaries and any tracer-implementation-specific fields that are needed to identify or otherwise contextualize the associated Span (e.g., a (trace_id, span_id, sampled) tuple).

Functions

new (opts)

Create new span context

Parameters:

  • opts: options
    • trace_id: (optional string)
    • span_id: (optional string)
    • parent_id: (optional string)
    • should_sample: (optional boolean)
    • baggage: (optional table)

Returns:

(table) span context

child ()

Create span child span context

Returns:

(table) child span context

clone_with_baggage_item (self, key, value)

New from existing but with an extra baggage item Clone context and add item to its baggage

Parameters:

Returns:

(table) context

get_baggage_item (self, key)

Get item from baggage

Parameters:

Returns:

(string) value

each_baggage_item (self)

Get baggage item iterator

Parameters:

Returns:

(function) iterator (table) baggage