Skip to main content

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​

SettingValueEffect
AXON_METRICS_TOKENA value that you chooseA scrape must send Authorization: Bearer <token>. A call without the token gets a 401
AXON_METRICS_TOKENUnset or emptyThe 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​

SeriesTypeLabelsWhat the value shows
axon_upgaugenone1 when the gateway can serve, 0 before the database answers
axon_build_infogaugeversion, commit1 on the build that runs, with its version and its commit

The circuit of each vendor​

SeriesTypeLabelsWhat the value shows
axon_circuit_stategaugeprovider, state1 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​

SeriesTypeLabelsWhat the value shows
axon_failover_totalcounteroutcomeThe 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?

SeriesLabelsWhat the value shows
axon_overhead_secondssourceThe wall time of a call minus the time of its upstream attempts
axon_classifier_secondsbyThe wait of the classifier
axon_cache_secondskindThe wait on the response cache
axon_redis_secondsnoneThe wait on Redis
axon_postgres_secondsopThe 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​

SeriesTypeLabelsWhat the value shows
axon_http_requests_totalcountermethod, route, statusThe calls of the HTTP server, by method, route template and status code
axon_http_request_duration_secondshistogrammethod, route, statusThe time of each call of the HTTP server
axon_http_requests_in_flightgaugenoneThe calls that the server handles now
axon_requests_totalcounterprovider, outcomeThe upstream attempts, by vendor and result
axon_cost_millicents_totalcounterproviderThe cost of the calls, in thousandths of a cent
axon_cache_lookups_totalcounterresultThe 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.