Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
"""A list of key-value pairs representing vendor-specific trace info.
Keys and values are strings of up to 256 printable US-ASCII characters.
Implementations should conform to the `W3C Trace Context - Tracestate`_
spec, which describes additional restrictions on valid field values.
.. _W3C Trace Context - Tracestate:
https://www.w3.org/TR/trace-context/#tracestate-field
"""
@classmethod
def get_default(cls) -> "TraceState":
return cls()
DEFAULT_TRACE_STATE = TraceState.get_default()
def format_trace_id(trace_id: int) -> str:
return "0x{:032x}".format(trace_id)
def format_span_id(span_id: int) -> str:
return "0x{:016x}".format(span_id)
class SpanContext:
"""The state of a Span to propagate between processes.
This class includes the immutable attributes of a :class:`.Span` that must
be propagated to a span's children and across process boundaries.