UNPKG

@opentelemetry/core

Version:

OpenTelemetry Core provides constants and utilities shared by all OpenTelemetry SDK packages.

16 lines (15 loc) • 601 B
import { createContextKey } from "@opentelemetry/api"; //#region src/trace/suppress-tracing.ts const SUPPRESS_TRACING_KEY = createContextKey("OpenTelemetry SDK Context Key SUPPRESS_TRACING"); function suppressTracing(context) { return context.setValue(SUPPRESS_TRACING_KEY, true); } function unsuppressTracing(context) { return context.deleteValue(SUPPRESS_TRACING_KEY); } function isTracingSuppressed(context) { return context.getValue(SUPPRESS_TRACING_KEY) === true; } //#endregion export { isTracingSuppressed, suppressTracing, unsuppressTracing }; //# sourceMappingURL=suppress-tracing.mjs.map