Skip to content
Buy me a coffee

instrumentPrometheus

instrumentPrometheus(options?): () => void

Defined in: src/prometheus.ts:34

Exposes pipeline telemetry as Prometheus metrics (via prom-client):

  • <prefix>strategy_events_total{pipeline,strategy,event}
  • <prefix>pipeline_duration_seconds{pipeline,outcome}
  • <prefix>attempt_duration_seconds{pipeline,attempt,outcome}: every call of the callback (retries and hedged attempts included); attempt is capped at 10 (10 means the 10th retry or later)
  • <prefix>circuit_state{pipeline,strategy}: 0 closed, 1 half-open, 2 open, 3 isolated (the 1000 most recently changed circuits) Call once at startup; returns a function that stops it (metrics stay registered).

PrometheusOptions = {}

() => void