UNPKG

2.12 kBTypeScriptView Raw
1import { TraceState } from './trace_state';
2/**
3 * A SpanContext represents the portion of a {@link Span} which must be
4 * serialized and propagated along side of a {@link Baggage}.
5 */
6export interface SpanContext {
7 /**
8 * The ID of the trace that this span belongs to. It is worldwide unique
9 * with practically sufficient probability by being made as 16 randomly
10 * generated bytes, encoded as a 32 lowercase hex characters corresponding to
11 * 128 bits.
12 */
13 traceId: string;
14 /**
15 * The ID of the Span. It is globally unique with practically sufficient
16 * probability by being made as 8 randomly generated bytes, encoded as a 16
17 * lowercase hex characters corresponding to 64 bits.
18 */
19 spanId: string;
20 /**
21 * Only true if the SpanContext was propagated from a remote parent.
22 */
23 isRemote?: boolean;
24 /**
25 * Trace flags to propagate.
26 *
27 * It is represented as 1 byte (bitmap). Bit to represent whether trace is
28 * sampled or not. When set, the least significant bit documents that the
29 * caller may have recorded trace data. A caller who does not record trace
30 * data out-of-band leaves this flag unset.
31 *
32 * see {@link TraceFlags} for valid flag values.
33 */
34 traceFlags: number;
35 /**
36 * Tracing-system-specific info to propagate.
37 *
38 * The tracestate field value is a `list` as defined below. The `list` is a
39 * series of `list-members` separated by commas `,`, and a list-member is a
40 * key/value pair separated by an equals sign `=`. Spaces and horizontal tabs
41 * surrounding `list-members` are ignored. There can be a maximum of 32
42 * `list-members` in a `list`.
43 * More Info: https://www.w3.org/TR/trace-context/#tracestate-field
44 *
45 * Examples:
46 * Single tracing system (generic format):
47 * tracestate: rojo=00f067aa0ba902b7
48 * Multiple tracing systems (with different formatting):
49 * tracestate: rojo=00f067aa0ba902b7,congo=t61rcWkgMzE
50 */
51 traceState?: TraceState;
52}
53//# sourceMappingURL=span_context.d.ts.map
\No newline at end of file