Skip to main content

Module metric_groups

Module metric_groups 

Source
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:

  • off exposes nothing;
  • warn (the group default) exposes only warn-tagged metrics;
  • info exposes warn and info metrics;
  • debug exposes everything except trace-tagged metrics;
  • trace exposes everything.

Metrics whose module belongs to no other group form the default group, covered by the default threshold (info unless configured), rendered as the leading default=LEVEL 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 hardware metrics are grouped together as one collector and registered with warn level, so the whole group shares a single level.

Structs§

MetricGroups
Per-group verbosity levels for the node’s predefined Prometheus metric groups.

Enums§

MetricLevel
Verbosity level for a metric.