import { installGlobalHandlers, uninstallGlobalHandlers } from "./internal/global-handlers.cjs"; import { Resource } from "@opentelemetry/resources"; import { SpanProcessor } from "@opentelemetry/sdk-trace-base"; //#region src/otel-config.d.ts export interface OtelConfigOptions { /** * Log exporter results to `stdout`. Also activatable via * `INTERFERE_DEBUG=1` upstream. */ readonly debug?: boolean; /** * Deployment environment label. Falls back through `INTERFERE_ENVIRONMENT`, * `VERCEL_ENV`, `NODE_ENV`, then `development` when unset. */ readonly environment?: string | undefined; /** * The producer version string (`name@version`) sent as the * `x-interfere-producer-version` header and recorded as * `interfere.sdk.version`. */ readonly producerVersion: string; /** * The `interfere.sdk.name` resource attribute — the npm name of the SDK * building this config (e.g. `@interfere/node`). */ readonly sdkName: string; /** * OTel `service.name` resource attribute — the identity spans are grouped * by in the dashboard. */ readonly serviceName: string; /** * Optional OTel `service.namespace` resource attribute for grouping * several services under one logical product surface. */ readonly serviceNamespace?: string | undefined; } export interface ResolvedOtelConfig { readonly endpoint: string; readonly environment: string; readonly releaseSlug: string | null; readonly resource: Resource; readonly spanProcessors: SpanProcessor[]; } /** * Builds the OpenTelemetry exporter, resource, and span processors that ship * traces to the Interfere collector. Returns `null` when * `INTERFERE_PUBLIC_KEY` is unset so callers can disable themselves cleanly. * * Centralizes the collector contract — OTLP/HTTP JSON transport, the public * key query param, the producer-version header, and the required * `service.name` / `release.slug` / `deployment.environment.name` resource * attributes — so every server SDK reports identically. */ export declare function resolveOtelConfig(options: OtelConfigOptions): ResolvedOtelConfig | null; //#endregion export { installGlobalHandlers, uninstallGlobalHandlers };