CloudTraceFormatter
in package
FinalYes
This format using a human readable string encoding to propagate SpanContext.
The current format of the header is <trace-id>[/<span-id>][;o=<options>]
.
The options are a bitmask of options. Currently the only option is the
least significant bit which signals whether the request was traced or not
(1 = traced, 0 = not traced).
Table of Contents
Constants
- CONTEXT_HEADER_FORMAT = '/([0-9a-fA-F]{32})(?:\/(\d+))?(?:;o=(\d+))?/'
Methods
- deserialize() : SpanContextInterface
- Generate a SpanContext object from the Trace Context header
- serialize() : string
- Convert a SpanContextInterface to header string
Constants
CONTEXT_HEADER_FORMAT
public
mixed
CONTEXT_HEADER_FORMAT
= '/([0-9a-fA-F]{32})(?:\/(\d+))?(?:;o=(\d+))?/'
Methods
deserialize()
Generate a SpanContext object from the Trace Context header
public
static deserialize(string $header) : SpanContextInterface
Parameters
- $header : string
Return values
SpanContextInterfaceserialize()
Convert a SpanContextInterface to header string
public
static serialize(SpanContextInterface $context) : string
Parameters
- $context : SpanContextInterface