UNPKG

1.38 kBTypeScriptView Raw
1import { Context, SpanContext, TextMapGetter, TextMapPropagator, TextMapSetter } from '@opentelemetry/api';
2export declare const TRACE_PARENT_HEADER = "traceparent";
3export declare const TRACE_STATE_HEADER = "tracestate";
4/**
5 * Parses information from the [traceparent] span tag and converts it into {@link SpanContext}
6 * @param traceParent - A meta property that comes from server.
7 * It should be dynamically generated server side to have the server's request trace Id,
8 * a parent span Id that was set on the server's request span,
9 * and the trace flags to indicate the server's sampling decision
10 * (01 = sampled, 00 = not sampled).
11 * for example: '{version}-{traceId}-{spanId}-{sampleDecision}'
12 * For more information see {@link https://www.w3.org/TR/trace-context/}
13 */
14export declare function parseTraceParent(traceParent: string): SpanContext | null;
15/**
16 * Propagates {@link SpanContext} through Trace Context format propagation.
17 *
18 * Based on the Trace Context specification:
19 * https://www.w3.org/TR/trace-context/
20 */
21export declare class W3CTraceContextPropagator implements TextMapPropagator {
22 inject(context: Context, carrier: unknown, setter: TextMapSetter): void;
23 extract(context: Context, carrier: unknown, getter: TextMapGetter): Context;
24 fields(): string[];
25}
26//# sourceMappingURL=W3CTraceContextPropagator.d.ts.map
\No newline at end of file