Metrics
The metrics block exposes Prometheus-formatted counters over plain HTTP. The same counters that the gRPC StatsService reports are surfaced at /metrics (and the runtime-debug pprof endpoints at /debug/pprof/).
Options
| Field | Type | Default | Allowed values | Description |
|---|---|---|---|---|
tag | string | (required for routing) | <inbound tag> | Routing tag for the metrics inbound. Required if you want to route the metrics endpoint with a rule (typically you do). |
listen | string | 127.0.0.1:0 | <host:port> | HTTP address the metrics endpoint listens on. Empty registers an in-process inbound only. |
Source: infra/conf/metrics.go:8-11 · pinned at v26.6.1 (94ffd50)
Example
json
{
"stats": {},
"metrics": {
"tag": "metrics",
"listen": "127.0.0.1:9099"
},
"policy": {
"system": {
"statsInboundUplink": true,
"statsInboundDownlink": true,
"statsOutboundUplink": true,
"statsOutboundDownlink": true
}
},
"routing": {
"rules": [
{ "type": "field", "inboundTag": ["metrics"], "outboundTag": "metrics" }
]
}
}Notes
metricsreuses the same counter store asstats; you still needstats: {}plus the relevant counter toggles inpolicy.- The endpoint serves both the Prometheus text format on
/metricsand Go'snet/http/pprofhandlers on/debug/pprof/. Keep the listen address localhost-only.
Source: infra/conf/metrics.go:8-11 · v26.6.1 (94ffd50)
