Skip to content

Stats Reference

bilbycast-relay exposes structured statistics on GET /api/v1/stats (in addition to the Prometheus metrics on GET /metrics). The structured endpoint is the right one to consume from a custom dashboard or monitoring script — it gives you the same numbers in a single JSON response without the overhead of scraping a Prometheus exposition.

This page documents every field in that response.

Auth: Required when api_token is configured (Bearer token).

Response: A single JSON object.

{
"uptime_secs": 86400,
"software_version": "0.7.1",
"totals": {
"bytes_in": 1234567890,
"bytes_out": 1234567890,
"datagrams_in": 1500000,
"datagrams_out": 1500000,
"streams_opened": 4200,
"active_connections": 12,
"active_tunnels": 8,
"active_edges": 16
},
"bandwidth": {
"current_in_bps": 245000000,
"current_out_bps": 245000000,
"current_total_bps": 490000000
},
"peaks": {
"peak_connections": 24,
"peak_tunnels": 12,
"peak_edges": 20,
"peak_bps": 980000000,
"peak_bps_at": "2026-04-06T18:42:11Z"
},
"tunnels": [
{
"tunnel_id": "550e8400-e29b-41d4-a716-446655440000",
"ingress_edge": "edge-syd-1",
"egress_edge": "edge-perth-1",
"bytes_in": 50000000,
"bytes_out": 50000000,
"datagrams_in": 60000,
"datagrams_out": 60000,
"current_bps": 122500000,
"bound_at": "2026-04-07T00:00:00Z"
}
]
}
FieldTypeMeaning
uptime_secsu64Seconds since the relay process started
software_versionstringBuild version (0.7.1, etc.)

Cumulative since process start. All counters are lock-free atomics.

FieldTypeMeaning
bytes_inu64Total bytes received from any edge across all tunnels
bytes_outu64Total bytes sent to any edge across all tunnels
datagrams_inu64Total UDP datagrams received
datagrams_outu64Total UDP datagrams sent
streams_openedu64Total bidirectional QUIC streams opened by edges
active_connectionsu64Number of edges currently connected to the relay
active_tunnelsu64Number of tunnels currently bound on both legs
active_edgesu64Number of distinct edge identities currently connected (different from active_connections if an edge has multiple connections)

Current bandwidth derived from the difference of byte counters over a sliding window (default ~1 s).

FieldTypeMeaning
current_in_bpsu64Current ingress bitrate to the relay
current_out_bpsu64Current egress bitrate from the relay
current_total_bpsu64Sum of in + out (the relay-side throughput observers care about)

Peak watermarks since process start, with timestamps.

FieldTypeMeaning
peak_connectionsu64Maximum concurrent edge connections
peak_tunnelsu64Maximum concurrent tunnels
peak_edgesu64Maximum distinct edges
peak_bpsu64Maximum total bandwidth observed
peak_bps_atstring (ISO 8601)When the bandwidth peak occurred

One entry per currently-active tunnel.

FieldTypeMeaning
tunnel_idUUIDTunnel identifier (matches the manager’s tunnel ID)
ingress_edgestringEdge ID of the ingress side (or null if not yet identified)
egress_edgestringEdge ID of the egress side
bytes_inu64Bytes received on the ingress leg
bytes_outu64Bytes sent on the egress leg
datagrams_inu64UDP datagrams on the ingress leg
datagrams_outu64UDP datagrams on the egress leg
current_bpsu64Current per-tunnel bitrate
bound_atstring (ISO 8601)When the tunnel was first bound (oldest leg)
Terminal window
curl -s -H "Authorization: Bearer $RELAY_TOKEN" \
http://relay.example.com:4434/api/v1/stats \
| jq '.totals.active_tunnels'
Terminal window
curl -s -H "Authorization: Bearer $RELAY_TOKEN" \
http://relay.example.com:4434/api/v1/stats \
| jq '.tunnels[] | {tunnel_id, current_bps}'
Terminal window
curl -s -H "Authorization: Bearer $RELAY_TOKEN" \
http://relay.example.com:4434/api/v1/stats \
| jq '.totals | (.bytes_in / .datagrams_in)'

Every field on this endpoint has a Prometheus counter or gauge on GET /metrics. Use the structured endpoint for one-off scripts and the Prometheus endpoint for time-series storage. Both read from the same atomics, so the numbers always agree.