aws_xray_sdk.core.models.trace_header

Module Contents

log
ROOT = Root
PARENT = Parent
SAMPLE = Sampled
SELF = Self
HEADER_DELIMITER = ;
class TraceHeader(root=None, parent=None, sampled=None, data=None)

Bases:object

The sampling decision and trace ID are added to HTTP requests in tracing headers named X-Amzn-Trace-Id. The first X-Ray-integrated service that the request hits adds a tracing header, which is read by the X-Ray SDK and included in the response. Learn more about Tracing Header.

root

Return trace id of the header

parent

Return the parent segment id in the header

sampled

Return the sampling decision in the header. It’s 0 or 1 or ‘?’.

data

Return the arbitrary fields in the trace header.

classmethod from_header_str(cls, header)

Create a TraceHeader object from a tracing header string extracted from a http request headers.

to_header_str(self)

Convert to a tracing header string that can be injected to outgoing http request headers.