2112 by default.
Start the metrics server
The router starts the Prometheus endpoint automatically. The default address is:Configure Prometheus
A minimal scrape configuration is:2112 does not need to be published to the host when Prometheus runs in the same Compose network.
Check the scrape target
From the Prometheus interface, open:How metrics reach the router
Prometheus scrapes only the router. Agents send operational information to the router through:- frequent routing-signal updates
- periodic heartbeats
- request outcomes
/metrics endpoint and forwards the resulting values to the router.
Metric groups
Metric labels and cardinality
Several metrics include labels such as:peer_idmodeltenant_idkey_iddeployment_idorganizationmachineregionengine
model, or reason and model. They do not expose tenant or key identity.
Routing metrics
Registered agents
These gauges use:1 while an agent is registered.
Count registered agents:
Agent health
Count healthy agents by model:
Last heartbeat
Routed requests
Failed routing
Per-agent metrics
These metrics use:Successful and failed requests
Success rate
0.0 to 1.0.
Find agents below 95%:
Capacity utilization
Tokens
Capacity rejections
Disconnections and health failures
Compare agent-process and backend failures:
Smoothed latency
SRTT reflects the request path observed by Hivenet Router. It includes more than raw network latency.
Persistence and resets
Current agent metadata, health, hardware, and engine snapshots are held in memory. Per-agent lifetime counters and latency history are also stored in BadgerDB and reseeded into Prometheus when an agent registers again. These include:- successful and failed request counts
- input and output tokens
- capacity rejections
- disconnections and failure counters
- SRTT and RTTVAR
This clears persisted per-agent lifetime counters, latency history, matching in-memory state, and their Prometheus series.It does not reset tenant quota counters or every router-level metric.
Engine metrics
Engine metrics use:
A metric is absent until the agent reports it.
Cache and queue state
Preemptions
_total suffix, this series is exported as a gauge representing the backend’s latest cumulative value.
Use a change function to detect growth:
Per-agent TTFT and ITL gauges
Finish reasons
llama.cpp throughput
Engine histograms
The current router re-exports raw engine histogram buckets for vLLM agents. SGLang and llama.cpp can contribute scalar average and P90 values, but their raw histogram buckets are not currently re-exported through Hivenet Router. The vLLM-backed histogram families are:Fleet P90 TTFT
P90 TTFT by model
Fleet P90 ITL
P90 prompt length
P90 generation length
Use
histogram_quantile() over aggregated buckets for fleet percentiles.Averaging several per-agent P90 gauges does not produce a valid fleet P90.GPU metrics
GPU metrics use:0 to 100 scale.
GPU utilization
VRAM percentage
Temperature
Power
CPU and memory metrics
Labels:Policy metrics
Primary and fallback routing
model label.
Local fallback rate by model:
503.
Stale connection resets
Policy reloads
Queue metrics
These metrics describe the per-model queue used when eligible agents exist but all declared capacity slots are occupied. They do not describe the router’s global pending-request channel, requests waiting for--max-concurrent, or work already forwarded to a backend.
Current queue depth
Queue wait duration
Tenant and quota metrics
Tenant metrics attribute activity to clients and deployments.Label defaults
A pre-routing failure cannot have a selected deployment, so its
deployment_id is:
Successful and failed requests
Token use
Request-rate rejection
Token-budget rejection
phase is:
Flat quota limits
0 means unlimited.
These gauges describe keys using the flat quota shape.
Per-model quota limits
Tokens used today
Last request timestamp
Tenant request duration
Quota persistence errors
Admission-control metrics
The LLM admission gates publish one rejection counter and four live pool gauges:
The
reason label identifies the gate:
The budget and backstop gauges can change as healthy replicas join or leave. Existing reservations remain visible in the occupancy gauges while the new denominators affect subsequent admissions.
POST /v1/messages/count_tokens, embedding, and reranking requests do not enter B1 through B4, so they do not change these occupancy gauges. See Admission control metrics for panel queries and alert interpretation.
Per-request duration by agent
HTTP server metrics
Request duration
Active requests
Provider HTTP metrics
Alerting examples
The thresholds below are examples. Adjust them to your hardware, workload, and service objectives.Agent unhealthy
High routing failure rate
KV-cache pressure
GPU temperature
Policy exhaustion
Quota persistence failure
Recording rules
Recording rules can simplify expensive or frequently reused dashboard queries.Troubleshooting
Prometheus cannot reach the router
Check the endpoint directly:A metric is missing
A series often appears only after the relevant event or data has occurred. For example:- tenant metrics appear after requests
- engine metrics appear after a successful engine scrape
- TTFT and ITL appear after completions
- GPU metrics require NVML and visible NVIDIA devices
- policy counters appear after routing activity
- per-model quota gauges appear when those quota paths are used or seeded
An engine metric is missing
Check the backend endpoint locally on the agent host:- SGLang needs
--enable-metrics - llama.cpp needs
--metrics - Ollama, Infinity, and custom engines do not currently supply engine metrics
Prometheus shows duplicate or stale agents
Thepeer_id label identifies the agent.
If an agent starts with a new identity after every restart, Prometheus sees a new series.
Configure a persistent:
Tenant labels show anonymous or default
In no-auth mode:
deployment_id="unset" is expected before an agent is selected or when the agent does not advertise a deployment ID.
Histogram queries return no data
Check that the corresponding_bucket series exists:
rate() over a window that contains completed observations.
A new or idle engine may not have enough data yet.
Counter graphs drop after a restart
Prometheus counters are process-local series. Some per-agent lifetime counters are reseeded from BadgerDB when agents register again, but other router, policy, HTTP, tenant, and queue metrics begin again with the new router process. Userate() or increase() rather than graphing raw counter values when restart behavior matters.
Next steps
Grafana dashboards
Explore the provisioned dashboards, data sources, variables, and panels.
Audit logging
Query structured request records through Loki or local JSONL files.
Hardware metrics
Review how agents collect GPU, CPU, and memory data.

