Skip to content

toPrometheusText

toPrometheusText(snapshot): string

Defined in: src/observability/metrics.ts:155

Serialize a metrics snapshot to Prometheus text exposition format.

Produces lines like:

gateway_requests_total{method="GET",status="200"} 42
gateway_request_duration_ms_sum{method="GET"} 1234
gateway_request_duration_ms_count{method="GET"} 10

MetricsSnapshot

The metrics snapshot to serialize.

string

Prometheus text exposition format string.