import { DiagLogger } from "@opentelemetry/api"; /** * `service.name` for telemetry this SDK emits when the caller names none. * * One constant for both streams. `init()` used to label its own provider * only when a name was supplied, so spans arrived as `unknown_service:node` * while the events beside them said `introspection-client` — one process, * two services, nothing tying them together. */ export declare const DEFAULT_SERVICE_NAME = "introspection-client"; /** * Headers for an OTLP exporter pointed at Introspection. * * Shared by both streams. `User-Agent` used to ride the logs exporter only, * so exported spans arrived at the collector unattributable to a client or a * release. * * `Authorization` is omitted for an empty token rather than sent as a bare * `Bearer `. A tokenless client is either warned about (logs) or running a * caller-supplied exporter that carries its own auth (spans), and neither * wants a malformed credential on the wire. * * Caller headers are merged last so they can override either. */ export declare const USER_AGENT = "introspection-sdk/0.23.0"; /** * The OTLP HTTP transport takes the client's user agent as a dedicated option * rather than a header: it assigns `headers['User-Agent']` unconditionally * just before the request, so a `User-Agent` supplied through `headers` is * always discarded. Passing it here instead prepends it to the exporter's own * token, and exports arrive attributable to a client and a release. */ export declare const otlpUserAgent: { readonly userAgent: "introspection-sdk/0.23.0"; }; export declare function exporterHeaders(token: string | undefined, additionalHeaders?: Record): Record; /** * Attach a forward-proxy agent to OTLP exporter options when a proxy is * configured for the exporter's endpoint. * * The OTLP proto exporters use Node's `http`/`https` stack, so this uses * `HttpsProxyAgent` (an `http.Agent`) rather than the undici dispatcher from * `@introspection-sdk/introspection-proxy` — a dispatcher only applies to * `fetch`. Unlike undici's `EnvHttpProxyAgent`, `HttpsProxyAgent` ignores * `NO_PROXY`, so we resolve the proxy per-endpoint with `proxy-from-env`'s * {@link getProxyForUrl}, which returns `""` when the host matches `NO_PROXY`. * This keeps in-cluster endpoints (e.g. `*.svc.cluster.local`) on a direct * connection instead of tunnelling them through the egress proxy, which has no * route for them. */ export declare function withOtlpHttpsProxy(options: T): T; /** * Logger for introspection-sdk package. * Uses OpenTelemetry's diagnostic logger. */ declare class IntrospectionLogger implements DiagLogger { private logLevel; constructor(); /** * Raise the level to DEBUG for `advanced.debug`. * * `AdvancedOptions.debug` is shared by the browser and Node clients, but * only the browser one read it: `init({ advanced: { debug: true } })` in * Node was silently inert, and the only way to get debug output was the * env var. Lowering is deliberately not offered — an explicit * `INTROSPECTION_LOG_LEVEL` should not be undone by a config flag. */ enableDebug(): void; private parseLogLevel; private shouldLog; error(...args: unknown[]): void; warn(...args: unknown[]): void; info(...args: unknown[]): void; debug(...args: unknown[]): void; verbose(...args: unknown[]): void; } export declare const logger: IntrospectionLogger; export {}; //# sourceMappingURL=utils.d.ts.map