import type { HealthRegistry, MetricsSink, MetricsSnapshot } from '../types/observability.js'; /** TLS options for HTTPS metrics endpoint. */ export interface MetricsTlsOptions { cert: string; key: string; } /** * Render a `MetricsSnapshot` as Prometheus text-format bytes. The output * always ends with a trailing newline (Prometheus requires it). */ export declare function renderPrometheus(snapshot: MetricsSnapshot): string; /** MIME type Prometheus servers must respond with on /metrics. */ export declare const PROMETHEUS_CONTENT_TYPE = "text/plain; version=0.0.4; charset=utf-8"; export interface MetricsServerOptions { port: number; /** Bind address. Defaults to 127.0.0.1 so we don't accidentally expose metrics publicly. */ host?: string | undefined; sink: MetricsSink; /** Path to serve on. Defaults to /metrics. */ path?: string | undefined; /** * V2-C: optional health registry. When provided, the server also responds * on `/healthz` (configurable via `healthPath`) with a JSON aggregate of * every registered health check. K8s probes expect a single HTTP server * exposing both `/metrics` and `/healthz`, so we mount them on the same * port rather than opening a sibling listener. */ healthRegistry?: HealthRegistry | undefined; /** Path to serve health JSON on. Defaults to /healthz. */ healthPath?: string | undefined; /** Enable HTTPS by providing TLS key/cert. Both required. */ tls?: MetricsTlsOptions | undefined; } export interface MetricsServerHandle { port: number; url: string; close(): Promise; } /** * Start an HTTP server that exposes a Prometheus scrape endpoint. * Uses node:http directly to avoid pulling a framework into the core graph. * * Why bind to 127.0.0.1 by default: telemetry endpoints inside an agent * process can leak prompt content via metric labels (tool name, error * message, etc.). The default keeps that on the loopback interface; * operators who want network scraping opt in explicitly with host: '0.0.0.0'. */ export declare function startMetricsServer(opts: MetricsServerOptions): Promise; //# sourceMappingURL=prometheus.d.ts.map