UNPKG

1.87 kBTypeScriptView Raw
1import { Context, TextMapGetter, TextMapPropagator, TextMapSetter } from '@opentelemetry/api';
2/** Configuration object for composite propagator */
3export interface CompositePropagatorConfig {
4 /**
5 * List of propagators to run. Propagators run in the
6 * list order. If a propagator later in the list writes the same context
7 * key as a propagator earlier in the list, the later on will "win".
8 */
9 propagators?: TextMapPropagator[];
10}
11/** Combines multiple propagators into a single propagator. */
12export declare class CompositePropagator implements TextMapPropagator {
13 private readonly _propagators;
14 private readonly _fields;
15 /**
16 * Construct a composite propagator from a list of propagators.
17 *
18 * @param [config] Configuration object for composite propagator
19 */
20 constructor(config?: CompositePropagatorConfig);
21 /**
22 * Run each of the configured propagators with the given context and carrier.
23 * Propagators are run in the order they are configured, so if multiple
24 * propagators write the same carrier key, the propagator later in the list
25 * will "win".
26 *
27 * @param context Context to inject
28 * @param carrier Carrier into which context will be injected
29 */
30 inject(context: Context, carrier: unknown, setter: TextMapSetter): void;
31 /**
32 * Run each of the configured propagators with the given context and carrier.
33 * Propagators are run in the order they are configured, so if multiple
34 * propagators write the same context key, the propagator later in the list
35 * will "win".
36 *
37 * @param context Context to add values to
38 * @param carrier Carrier from which to extract context
39 */
40 extract(context: Context, carrier: unknown, getter: TextMapGetter): Context;
41 fields(): string[];
42}
43//# sourceMappingURL=composite.d.ts.map
\No newline at end of file