Each ManyLayers service exposes Prometheus metrics at GET /metrics. Scrape the gateway replicas for request, token, policy, guardrail, cache and upstream health series; scrape Workspace and Deployer for process health.

How it works

  • /metrics is served by every service. The gateway, workspace and deployer serve it next to /health, /healthz, /ready, /readyz and /version; the Worker serves only /health, /ready and /metrics. Default ports are gateway :8180, workspace :8190, deployer :8200, worker :8210. It needs no authentication — restrict it at the network or ingress level.
  • Besides the series documented below, processes that run the budget counters, the NATS pipeline, the database writer and the trace worker also export internal manylayers_budget_*, manylayers_nats_*, manylayers_dbwriter_* and manylayers_trace_worker_* series. The manylayers_dbwriter_*, manylayers_trace_worker_* and stream/consumer manylayers_nats_* series come from the Worker. They describe pipeline health, not requests, and are not part of this reference.
  • Series are kept per process and cover every team and organization that process serves, so scrape them from a deployment you operate. Per-organization views belong in the console’s Metrics, Usage and Request Traces.
  • Query with sum by (...) to aggregate replicas.
  • The default Go runtime (go_*) and process (process_*) collectors are included.
  • Request-path series are emitted by the service that handled the request — the gateway for all /v1 traffic.
prometheus.yml

Metric reference

Requests and tokens

OpenTelemetry GenAI conventions

These follow the OpenTelemetry GenAI metric conventions, so generic LLM dashboards work unchanged. All four carry gen_ai_operation_name (chat, embeddings, generate_content for /v1/responses), gen_ai_system (the serving provider type, or unknown), gen_ai_request_model and gen_ai_response_model. A failover shows up as different request and response models.

Policy, firewall, guardrails and cache

Upstream routing

team and model labels grow with the number of teams and models you run. Policy metrics deliberately carry no model, workspace or caller label; use the audit log to investigate a specific refusal.

Example queries

Upstream gauges are per replica; min shows an endpoint any replica has ejected. In the second query, any row whose request and response models differ is traffic served by a fallback.
In Grafana, add the Prometheus data source and build one row per section above. Use a $model variable from label_values(manylayers_requests_total, model) and a $team variable from label_values(manylayers_tokens_total, team), and render histogram panels with histogram_quantile over sum by (le, ...) — never average quantiles across replicas.

Next steps

Tracing & OpenTelemetry Export

Per-request spans to your OTLP collector.

Request Logging & Audit

Drill from a metric spike to individual requests.

Self-Host the Gateway

Ports, probes and scaling for scrape targets.

Routing

What drives the upstream health gauges.