UNPKG

@bracketed/otel-api

Version:

@opentelementery/api but ported to suit modern uses. (2025)

1 lines 2.78 kB
{"version":3,"sources":["../../../src/trace/SamplingResult.ts"],"names":["SamplingDecision"],"mappings":"8CA0BO,IAAKA,CAAAA,CAAAA,SAAAA,CAAAA,CAAAA,CAIV,OAAAA,CAAAA,CAAAA,CAAAA,CAAA,UAAA,CAAA,CAAA,CAAA,CAAA,YAAA,CAKAA,EAAAA,CAAAA,CAAA,MAAA,CAAA,CAAA,CAAA,CAAA,QAAA,CAKAA,EAAAA,CAAAA,CAAA,kBAAA,CAAA,CAAA,CAAA,CAAA,oBAAA,CAdUA,CAAAA,CAAAA,CAAAA,EAAAA","file":"SamplingResult.cjs","sourcesContent":["/*\n * Copyright The OpenTelemetry Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * https://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport type { SpanAttributes } from './attributes';\nimport type { TraceState } from './trace_state';\n\n/**\n * @deprecated use the one declared in @opentelemetry/sdk-trace-base instead.\n * A sampling decision that determines how a {@link Span} will be recorded\n * and collected.\n *\n * @since 1.0.0\n */\nexport enum SamplingDecision {\n\t/**\n\t * `Span.isRecording() === false`, span will not be recorded and all events\n\t * and attributes will be dropped.\n\t */\n\tNOT_RECORD,\n\t/**\n\t * `Span.isRecording() === true`, but `Sampled` flag in {@link TraceFlags}\n\t * MUST NOT be set.\n\t */\n\tRECORD,\n\t/**\n\t * `Span.isRecording() === true` AND `Sampled` flag in {@link TraceFlags}\n\t * MUST be set.\n\t */\n\tRECORD_AND_SAMPLED,\n}\n\n/**\n * @deprecated use the one declared in @opentelemetry/sdk-trace-base instead.\n * A sampling result contains a decision for a {@link Span} and additional\n * attributes the sampler would like to added to the Span.\n *\n * @since 1.0.0\n */\nexport interface SamplingResult {\n\t/**\n\t * A sampling decision, refer to {@link SamplingDecision} for details.\n\t */\n\tdecision: SamplingDecision;\n\t/**\n\t * The list of attributes returned by SamplingResult MUST be immutable.\n\t * Caller may call {@link Sampler}.shouldSample any number of times and\n\t * can safely cache the returned value.\n\t */\n\tattributes?: Readonly<SpanAttributes>;\n\t/**\n\t * A {@link TraceState} that will be associated with the {@link Span} through\n\t * the new {@link SpanContext}. Samplers SHOULD return the TraceState from\n\t * the passed-in {@link Context} if they do not intend to change it. Leaving\n\t * the value undefined will also leave the TraceState unchanged.\n\t */\n\ttraceState?: TraceState;\n}\n"]}