Metrics
A Proxium gateway serves GET /metrics in the Prometheus text format. The page holds one series for each counter, gauge and histogram below. Each series exists before its first call, so a dashboard shows a zero rate and not "no data".
Guard the page with a token
| Setting | Value | Effect |
|---|---|---|
AXON_METRICS_TOKEN | A value that you choose | A scrape must send Authorization: Bearer <token>. A call without the token gets a 401 |
AXON_METRICS_TOKEN | Unset or empty | The page stays open. This is the default |
Leave the variable unset when only a Prometheus inside the cluster reaches the /metrics Service. Set it when the page is reachable from a network that you do not control.
The health of the gateway
| Series | Type | Labels | What the value shows |
|---|---|---|---|
axon_up | gauge | none | 1 when the gateway can serve, 0 before the database answers |
axon_build_info | gauge | version, commit | 1 on the build that runs, with its version and its commit |
The circuit of each vendor
| Series | Type | Labels | What the value shows |
|---|---|---|---|
axon_circuit_state | gauge | provider, state | 1 on the state that holds, 0 on the other two |
The label state holds closed, half_open or open. A breaker that one project owns is left out of the page. Its scope carries the project, so a label for it would grow with every project.
Failover
| Series | Type | Labels | What the value shows |
|---|---|---|---|
axon_failover_total | counter | outcome | The calls through the failover chain |
The label outcome holds one of three values. first_hop means the call reached its first vendor. later_hop means a later vendor of the chain answered. exhausted means no vendor of the chain answered.
The latency of the gateway
These are histograms in seconds. Each one answers a part of one question: when a call is slow, where did the time go?
| Series | Labels | What the value shows |
|---|---|---|
axon_overhead_seconds | source | The wall time of a call minus the time of its upstream attempts |
axon_classifier_seconds | by | The wait of the classifier |
axon_cache_seconds | kind | The wait on the response cache |
axon_redis_seconds | none | The wait on Redis |
axon_postgres_seconds | op | The wait on a Postgres read of the request path |
The label source of axon_overhead_seconds holds the caller of the gateway: chat, pi, memory, console, bot or other.
The label by of axon_classifier_seconds holds who picked the tier: system_one, llm, fallback, timeout, reused or other.
The label kind of axon_cache_seconds holds the cache that answered: question, exact or store.
The label op of axon_postgres_seconds holds the read: key_lookup, catalog, pricing, settings or routing.
axon_overhead_seconds rises when the gateway spends the time itself. Read the four dependency histograms of the same window to see where it waits. A bucket is the series with the _bucket suffix. The series with _count and _sum hold the number of calls and their total time.
The traffic of the gateway
| Series | Type | Labels | What the value shows |
|---|---|---|---|
axon_http_requests_total | counter | method, route, status | The calls of the HTTP server, by method, route template and status code |
axon_http_request_duration_seconds | histogram | method, route, status | The time of each call of the HTTP server |
axon_http_requests_in_flight | gauge | none | The calls that the server handles now |
axon_requests_total | counter | provider, outcome | The upstream attempts, by vendor and result |
axon_cost_millicents_total | counter | provider | The cost of the calls, in thousandths of a cent |
axon_cache_lookups_total | counter | result | The reads of the response cache, by hit or miss |
The route is a template such as /v1/chat/completions and never a path with an id, so the number of series stays fixed.
Read a first page
curl -sS http://localhost:4000/metrics | grep -E '^axon_(up|overhead_seconds_count)'
Import the dashboard
dashboards/axon.json in the repository holds the panels for these series: the two histograms of the gateway, the circuit state and the failover outcomes. Import it into Grafana and pick your Prometheus data source.