TraceHeader
Defined in: aa-sdk/core/src/utils/traceHeader.ts:31
Some tools that are useful when dealing with the values of the trace header. Follows the W3C trace context standard.
See
https://www.w3.org/TR/trace-context/
Constructors
Constructor
Defined in: aa-sdk/core/src/utils/traceHeader.ts:45
Initializes a new instance with the provided trace identifiers and state information.
Parameters
Returns
TraceHeader
Properties
Methods
toTraceHeader()
Defined in: aa-sdk/core/src/utils/traceHeader.ts:123
Should be able to convert the trace header to the format that is used in the headers of an http request
Example
Returns
object
The trace header in the format of a record, used in our http client
withEvent()
Defined in: aa-sdk/core/src/utils/traceHeader.ts:145
Should be able to create a new trace header with a new event in the trace state, as the key of the eventName as breadcrumbs appending onto previous breadcrumbs with the - infix if exists. And the trace parent gets updated as according to the docs
Example
Parameters
Returns
TraceHeader
The new trace header
default()
Defined in: aa-sdk/core/src/utils/traceHeader.ts:66
Creating a default trace id that is a random setup for both trace id and parent id
Example
Returns
TraceHeader
A default trace header
fromTraceHeader()
Defined in: aa-sdk/core/src/utils/traceHeader.ts:84
Should be able to consume a trace header from the headers of an http request
Example
Parameters
Returns
undefined
| TraceHeader
The trace header object, or nothing if not found