/metrics on its own port for any Prometheus setup to scrape. 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_secondsnext togateway_http_request_duration_secondsto 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
Sendseverity: page to your pager and severity: warn to chat:
Test the rules before you deploy them
See also
- Grafana dashboard: the panels behind these rules.
- Troubleshooting: what to do when one of them fires.
- Observability: every metric, label and span attribute.
- Budgets: how spend reaches the ledger and what the precheck reads.