Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
https://www.w3.org/TR/trace-context/#trace-flags
"""
DEFAULT = 0x00
SAMPLED = 0x01
@classmethod
def get_default(cls) -> "TraceOptions":
return cls(cls.DEFAULT)
@property
def sampled(self) -> bool:
return bool(self & TraceOptions.SAMPLED)
DEFAULT_TRACE_OPTIONS = TraceOptions.get_default()
class TraceState(typing.Dict[str, str]):
"""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()