UNPKG

1.38 kBTypeScriptView Raw
1import { SpanAttributes } from './attributes';
2/**
3 * @deprecated use the one declared in @opentelemetry/sdk-trace-base instead.
4 * A sampling decision that determines how a {@link Span} will be recorded
5 * and collected.
6 */
7export declare enum SamplingDecision {
8 /**
9 * `Span.isRecording() === false`, span will not be recorded and all events
10 * and attributes will be dropped.
11 */
12 NOT_RECORD = 0,
13 /**
14 * `Span.isRecording() === true`, but `Sampled` flag in {@link TraceFlags}
15 * MUST NOT be set.
16 */
17 RECORD = 1,
18 /**
19 * `Span.isRecording() === true` AND `Sampled` flag in {@link TraceFlags}
20 * MUST be set.
21 */
22 RECORD_AND_SAMPLED = 2
23}
24/**
25 * @deprecated use the one declared in @opentelemetry/sdk-trace-base instead.
26 * A sampling result contains a decision for a {@link Span} and additional
27 * attributes the sampler would like to added to the Span.
28 */
29export interface SamplingResult {
30 /**
31 * A sampling decision, refer to {@link SamplingDecision} for details.
32 */
33 decision: SamplingDecision;
34 /**
35 * The list of attributes returned by SamplingResult MUST be immutable.
36 * Caller may call {@link Sampler}.shouldSample any number of times and
37 * can safely cache the returned value.
38 */
39 attributes?: Readonly<SpanAttributes>;
40}
41//# sourceMappingURL=SamplingResult.d.ts.map
\No newline at end of file