Statistics and metrics history configuration for Radiator operators
statistics
Radiator keeps runtime counters, gauges, and histograms in memory while it runs. The Management UI uses the local history to show traffic, errors, backend behavior, and latency.
For real-time production monitoring and long-term retention, see the Prometheus scraping article.
Default local history
Without a statistics block, new counters, gauges, and histograms keep
2016 local history samples. This is 7 days at 5-minute intervals.
Most installations should use the defaults.
The example below sets one day of local history at 1-minute intervals.
statistics {
defaults {
samples 1440;
interval 60s;
}
}
Namespaces
Counters and histograms use the same namespaces as log entries. A namespace is a path such as:
server::radius-udp::AUTH_SERVER::policy::DEFAULT::handler::PAP_HANDLER
backend::SQL::USERS_DB
custom::app::requests
See Namespaces for the full namespace hierarchy and for examples from logging and counters.
Configuration
You usually do not need a statistics block.
Add one only when the local Management UI history needs a different window for a clear operational reason. The block changes only local history.
The statistics block can contain:
| Block or statement | Where | Description |
|---|---|---|
defaults { ... } | statistics | Fallback history settings for new metrics |
counter /pattern/ { ... } | statistics | History settings for counters whose namespace matches the regex |
histogram /pattern/ { ... } | statistics | History settings for histograms whose namespace matches the regex |
samples N; | defaults, counter, histogram | Number of local history samples to keep |
interval DURATION; | defaults, counter, histogram | Time between local history samples |
interval accepts duration units such as ms, s, m, h, d, and
w. See Duration Units for the full
syntax.
Example
statistics {
# Keep the built-in local history for most metrics.
defaults {
samples 2016;
interval 5m;
}
# Keep a shorter local chart for high-volume custom counters.
counter /^custom::loadtest::/ {
samples 288;
interval 5m;
}
# Keep a higher-resolution local chart while investigating SQL latency.
histogram /^backend::SQL::.*::latency$/ {
samples 720;
interval 30s;
}
}
Pattern matching
Patterns use Rust regex syntax and are written as /pattern/ or
/pattern/flags. Supported flags are i, m, and s.
Without ^ and $, a regex can match anywhere in the namespace path.
Use anchors when the rule should match a specific path shape.
Examples:
| Pattern | Matches |
|---|---|
/handler::/ | Any namespace that contains handler:: |
/::errors$/ | Any namespace that ends with ::errors |
/^backend::SQL::.*::latency$/ | SQL backend latency histograms |
/.*::auth.*/i | Any namespace that contains auth, case-insensitive |
Counters and histograms are created automatically when Radiator uses them. Use regex rules only when you want to change local history settings.
Regex rules are checked in the order they appear in the file. Put specific regex rules before broad regex rules.
Management API history
The Management UI reads local history through the statistics API. These endpoints are useful for the UI and for short troubleshooting scripts:
GET /api/v1/statistics/counter/time-series/{namespace}
GET /api/v1/statistics/counters/time-series/{namespace}
GET /api/v1/statistics/histogram/time-series/{namespace}
The namespace is written as path components in these URLs. For example,
server::radius-udp::AUTH_SERVER becomes
server/radius-udp/AUTH_SERVER.