UNPKG

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