Skip to content

feat(prometheus): add module_id to node series - #105

Merged
gsanchietti merged 2 commits into
module-alert-rulesfrom
containers_add_module_id
Oct 16, 2026
Merged

gsanchietti merged 2 commits into
module-alert-rulesfrom
containers_add_module_id

Conversation

@gsanchietti

@gsanchietti gsanchietti commented Oct 16, 2026 •

Copy link
Copy Markdown
Member

Modules need to alert when one of their own services stops, without running an extra exporter for it. Core 3.22.0 already publishes per-module container and volume series on each node, but they carry a module label, while module alert rules only match series by module_id. Related to NethServer/dev#8093.

Prometheus now copies module to module_id on node series, only when the series has no module_id yet and the value is a module ID. Core containers (module="core") and unattributed ones (module="unknown") are left unchanged. Alerts on these series now follow the same grouping as other module alerts.

  • provision-prometheus: add the relabel rule to the scrape job
  • tests/30__node_module_id.robot: new suite, skipped on cores without container metrics
  • Containers dashboard: hide the duplicated module_id column in tables
  • README: new "Per-module node series" section with example rules

How to test

  • Install or update the module on a node with core 3.22.0 or later
  • In Prometheus, query ns8_container_info{module_id="metrics1"}: it returns the module containers
  • Query ns8_container_info{module="core",module_id!=""}: it returns nothing

See also


Generated by Claude Code:claude-haiku-5-5 with nethserver-pr

Core 3.22.0 publishes per-module series on the node exporter, such as
ns8_container_* and ns8_module_*_bytes, labeled with "module". Module
alert rules are scoped by "module_id", so they could not match them.

Copy "module" to "module_id" on node targets, only when the series has
no module_id and the value is a module ID. Modules can then alert on
their own containers without running a dedicated exporter.

Assisted-by: Claude Code:claude-sonnet-5-5
Node series now carry module_id, a copy of module. The raw
ns8_container_info query of the Containers table would show it as an
extra, duplicated column.

Assisted-by: Claude Code:claude-haiku-5-5
@gsanchietti
gsanchietti force-pushed the containers_add_module_id branch from afbbed5 to 825bee3 Compare October 16, 2026 09:47
@gsanchietti
gsanchietti changed the base branch from main to module-alert-rules October 16, 2026 09:47
@gsanchietti
gsanchietti marked this pull request as ready for review October 16, 2026 12:11
@gsanchietti
gsanchietti merged commit 432cc29 into module-alert-rules Oct 16, 2026
5 checks passed
@gsanchietti
gsanchietti deleted the containers_add_module_id branch October 16, 2026 12:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant