/** * OTLP/HTTP metrics exporter (core 1.37 observability seam) — DEPENDENCY-FREE. core stays SDK-free and * the deployment owns export; rather than pull in the OpenTelemetry SDK (a concern for the intranet * mirror + the bun-compiled binary), we periodically snapshot the in-process registry and POST it to an * OTLP collector as OTLP/JSON `ExportMetricsServiceRequest`. Enabled only when `OTEL_EXPORTER_OTLP_ENDPOINT` * is set; otherwise zero overhead. Prometheus /metrics is unaffected — both can run side by side. */ import type { MetricSnapshot } from "./metrics.js"; /** Build the OTLP/JSON metrics payload from a registry snapshot. Pure → unit-testable. */ export declare function buildOtlpPayload(snap: MetricSnapshot, opts: { serviceName: string; startMs: number; nowMs: number; }): { resourceMetrics: { resource: { attributes: { key: string; value: { stringValue: string; }; }[]; }; scopeMetrics: { scope: { name: string; }; metrics: unknown[]; }[]; }[]; }; export interface OtlpExporterOptions { endpoint: string; intervalMs: number; serviceName: string; headers: Record; fetchImpl?: typeof fetch; onError?: (err: unknown) => void; } /** Start the periodic push loop (unref'd so it never holds the process open). Returns a stop handle. */ export declare function startOtlpExporter(metrics: { snapshot(): MetricSnapshot; }, opts: OtlpExporterOptions): { stop(): void; }; //# sourceMappingURL=otel-exporter.d.ts.map