Metrics endpoints
Each background worker serves its metrics on its own port:
Set up scraping
- Kubernetes (Helm)
- Other deployments
1
Set the metrics token
Set
auth.metricsAuth.enabled: true and set auth.metricsAuth.values.metrics_auth_token.
Generate a value with openssl rand -hex 32. Helm install and upgrade fail if the token is empty.
To use a secret that you manage, set auth.metricsAuth.existingSecret instead.
See Security Hardening.2
Create the ServiceMonitors
Set
monitoring.serviceMonitors.enabled: true. This needs the Prometheus Operator CRDs.
Use monitoring.serviceMonitors.labels to match the serviceMonitorSelector of your Prometheus resource.
If Prometheus runs in a different namespace,
its serviceMonitorNamespaceSelector must also select the Onyx namespace.
The API and MCP ServiceMonitors send the metrics token automatically.3
Add the dashboards (optional)
Set
monitoring.grafana.dashboards.enabled: true to deploy Grafana dashboard ConfigMaps.
The Grafana sidecar must watch the Onyx namespace for the label grafana_dashboard=1.METRICS_AUTH_TOKEN is not set, the API and MCP /metrics endpoints return 401 for every request.
Set DISABLE_METRICS_AUTH=true only on a network that users cannot reach.
Configuration
Metric families
All Onyx-specific metrics start withonyx_. Each scrape returns a help string for every metric.
Example alerts
Related
- Security Hardening: the metrics token and other credentials.
- High Availability and Scaling: autoscale workers on
onyx_queue_depth. - Audit Logs & SIEM Integration: forward security events to a SIEM.