Expand description
Predefined groupings of the node’s Prometheus metrics.
Most groups are filter-based: they key on the module path of the metrics
(preferred over the metric name, because module paths are stable and names
are not) and are rendered into a METRICS_FILTER-style string via
MetricGroups::to_filter_string.
Each filter-based group is set to a MetricLevel, a verbosity threshold.
Individual metrics declare their own level where they are registered,
defaulting to MetricLevel::Debug. A group’s level decides which of its
metrics are exposed on the metrics endpoint — a metric is exposed when
the group’s level is at least as verbose as the metric’s:
offexposes nothing;warn(the group default) exposes onlywarn-tagged metrics;infoexposeswarnandinfometrics;debugexposes everything excepttrace-tagged metrics;traceexposes everything.
Metrics whose module belongs to no group are covered by the default
threshold (info unless configured), rendered as the leading catch-all
directive.
The levels never affect collection: a filter-based group’s metrics are registered and keep collecting regardless of the configured level.
Note the two defaults differ: an untagged metric is exposed from level
debug, while a group defaults to the warn threshold, so the default
config exposes only the warn-tagged metrics.
The node applies MetricGroups::default() when the config omits
metrics.groups entirely, so an omitted and an empty section behave the
same.
The hw hardware metrics are registered as a prometheus collector and
so bypass the filtering macros entirely. They cannot be level-filtered
individually: the hardware group’s level is read once at registration
time — MetricLevel::Off skips the whole group, any other level
registers it.
Structs§
- Metric
Groups - Per-group verbosity levels for the node’s predefined Prometheus metric groups.
Enums§
- Metric
Level - Verbosity level for a metric.