UNPKG

1.46 kBTypeScriptView Raw
1import { Context, Link, Sampler, SamplingResult, SpanAttributes, SpanKind } from '@opentelemetry/api';
2/**
3 * @deprecated Use the one defined in @opentelemetry/sdk-trace-base instead.
4 * A composite sampler that either respects the parent span's sampling decision
5 * or delegates to `delegateSampler` for root spans.
6 */
7export declare class ParentBasedSampler implements Sampler {
8 private _root;
9 private _remoteParentSampled;
10 private _remoteParentNotSampled;
11 private _localParentSampled;
12 private _localParentNotSampled;
13 constructor(config: ParentBasedSamplerConfig);
14 shouldSample(context: Context, traceId: string, spanName: string, spanKind: SpanKind, attributes: SpanAttributes, links: Link[]): SamplingResult;
15 toString(): string;
16}
17interface ParentBasedSamplerConfig {
18 /** Sampler called for spans with no parent */
19 root: Sampler;
20 /** Sampler called for spans with a remote parent which was sampled. Default AlwaysOn */
21 remoteParentSampled?: Sampler;
22 /** Sampler called for spans with a remote parent which was not sampled. Default AlwaysOff */
23 remoteParentNotSampled?: Sampler;
24 /** Sampler called for spans with a local parent which was sampled. Default AlwaysOn */
25 localParentSampled?: Sampler;
26 /** Sampler called for spans with a local parent which was not sampled. Default AlwaysOff */
27 localParentNotSampled?: Sampler;
28}
29export {};
30//# sourceMappingURL=ParentBasedSampler.d.ts.map
\No newline at end of file