The gateway serves /metrics on its own metrics port (9464 by default) for any Prometheus setup to scrape. Send the bearer METRICS_API_KEY as Authorization: Bearer <key> in the scrape job’s authorization block. Copy the ruleset below into alerts/langwatch-gateway.yml, or into a PrometheusRule resource if you run the Prometheus Operator, then reload Prometheus.
Every metric name and label here comes from the gateway’s registry. See Observability for the full list.
The ruleset
Why these rules
Each rule reports one of three things: customer impact that is happening now (5xx rate, an open circuit), a leading indicator (fallback rate, cache hit rate, failing control-plane calls), or spend that is escaping enforcement (missing stream usage, dropped spend records).
Rules that are deliberately absent:
- Provider 429s. Fallback and the circuit breaker handle them without a person.
- Request latency. The provider round trip dominates, so an alert on it is an alert on the provider. Use
gateway_provider_duration_seconds next to gateway_http_request_duration_seconds to see the gateway’s own share.
- Cost. The registry holds no per-request cost metric. Spend is priced by the control plane and read from the usage screens.
Routing
Send severity: page to your pager and severity: warn to chat:
Test the rules before you deploy them
See also
Last modified on October 12, 2026