UNPKG

@opentelemetry/core

Version:

OpenTelemetry Core provides constants and utilities shared by all OpenTelemetry SDK packages.

29 lines • 1.5 kB
import { Context, SpanContext, TextMapGetter, TextMapPropagator, TextMapSetter } from "@opentelemetry/api"; //#region src/trace/W3CTraceContextPropagator.d.ts declare const TRACE_PARENT_HEADER = "traceparent"; declare const TRACE_STATE_HEADER = "tracestate"; /** * Parses information from the [traceparent] span tag and converts it into {@link SpanContext} * @param traceParent - A meta property that comes from server. * It should be dynamically generated server side to have the server's request trace Id, * a parent span Id that was set on the server's request span, * and the trace flags to indicate the server's sampling decision * (01 = sampled, 00 = not sampled). * for example: '{version}-{traceId}-{spanId}-{sampleDecision}' * For more information see {@link https://www.w3.org/TR/trace-context/} */ declare function parseTraceParent(traceParent: string): SpanContext | null; /** * Propagates {@link SpanContext} through Trace Context format propagation. * * Based on the Trace Context specification: * https://www.w3.org/TR/trace-context/ */ declare class W3CTraceContextPropagator implements TextMapPropagator { inject(context: Context, carrier: unknown, setter: TextMapSetter): void; extract(context: Context, carrier: unknown, getter: TextMapGetter): Context; fields(): string[]; } //#endregion export { TRACE_PARENT_HEADER, TRACE_STATE_HEADER, W3CTraceContextPropagator, parseTraceParent }; //# sourceMappingURL=W3CTraceContextPropagator.d.cts.map