import { NodeTracerProvider } from "@opentelemetry/sdk-trace-node"; import type { SpanProcessor } from "@opentelemetry/sdk-trace-base"; import { type IntrospectionSpanProcessorOptions } from "./span-processor.js"; export type ConflictBehavior = "warn" | "throw" | "replace"; export interface SetupTracingOptions extends IntrospectionSpanProcessorOptions { /** * What to do if a context manager or propagator is already registered. * * - `"warn"` (default) — log a warning and continue with the existing * registration. Spans still flow but baggage may not propagate as * expected. Set `INTROSPECTION_STRICT_TRACING=1` to upgrade to throw. * - `"throw"` — throw an error. Use in environments where a silent * baggage drop is unacceptable (production telemetry pipelines). * - `"replace"` — force-register over the existing manager / propagator. * Useful in tests or when migrating from another tracer; can break * other libraries that relied on the previous registration. */ onConflict?: ConflictBehavior; /** * Extra span processors attached to the same `NodeTracerProvider`, so a * single set of spans fans out to any other OTLP-compatible backend. * This is the low-level dual-export hook: * * ```ts * setupTracing({ * serviceName: "my-app", * additionalSpanProcessors: [new BatchSpanProcessor(otherBackendExporter)], * }); * ``` * * Note: the {@link IntrospectionSpanProcessor} forwards its *own* converted * copy of each span to Introspection — it does not mutate the shared span — * so these processors receive the raw span and run independently of it. * Order is therefore irrelevant. `introspection.init({ spanProcessors })` * is the equivalent for the one-liner surface. */ additionalSpanProcessors?: SpanProcessor[]; } /** * Install the OTel context manager + W3C (trace-context + baggage) propagator * that Introspection's baggage scopes depend on. * * Shared by {@link setupTracing} and `introspection.init()`. `behavior` * controls what happens when a manager / propagator is already registered * (see {@link ConflictBehavior}). */ export declare function registerOTelGlobals(behavior?: ConflictBehavior): void; /** * Initialise Introspection tracing for a Node.js process. */ export declare function setupTracing(options?: SetupTracingOptions): NodeTracerProvider; //# sourceMappingURL=setup.d.ts.map