You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Applications need a simple way to publish their own metrics and to raise alerts when one of their services stops, without running an extra exporter or opening a new port. This issue covers only the core and metrics module parts of #8093, so they can be tested and released before the NethVoice part.
Core: a module can ship an export-metrics command. Every 5 minutes a timer on each node runs it and publishes the output through the node exporter, with a module="<id>" label added to each sample.
Metrics module: Prometheus copies the module label to module_id on node series, so module-provided alert rules (feat(alerts): allow module-provided rules ns8-metrics#91) match per-module container, volume and custom metrics. Core containers (module="core") and unattributed ones (module="unknown") are left unchanged.
How it works
A module command export-metrics is run every 5 minutes, and its output appears in the node exporter with the module label.
A failing command keeps the last output and logs the failure; a removed command makes its series disappear at the next run.
Invalid output of one module does not affect the others.
In Prometheus, ns8_container_info{module_id="metrics1"} returns the module containers, and ns8_container_info{module="core",module_id!=""} returns nothing.
Existing installations keep working after the core and metrics updates.
Wait up to 5 minutes, or run runagent -m node refresh-module-metrics.
Run curl -s localhost:9100/metrics | grep demo_value. It shows demo_value{module="openldap1"} 42
In Grafana, open Explore and search demo_value. The value is 42 and carries module_id="openldap1" or do a query using Prometheus UI
Test case 4: the app command fails
Change the command so it prints demo_value 99 and exits with an error (exit 1). After the next run, the value stays 42, and journalctl -u refresh-module-metrics shows a warning for openldap1.
Change the command so it waits 60 seconds. The run stops after 30 seconds, the old value stays, and the log says the command timed out.
Change the command so it prints its own module label, for example demo_value{module="other"} 5. The output is refused, the old value stays, and the log says the label is reserved.
Test case 5: bad output from one app does not affect the others
Add a valid command to ldapproxy1 that prints demo_proxy 7.
Change the OpenLDAP command so it prints this is not valid.
After the next run, demo_proxy{module="ldapproxy1"} 7 is still published, together with all the normal node metrics. Only the OpenLDAP value is missing.
Fix the OpenLDAP command so it prints demo_value 43. After the next run, the value is 43.
Test case 6: removing the command
Delete the command from both apps: runagent -m openldap1 rm -f ../bin/export-metrics and the same for ldapproxy1.
After the next run, demo_value and demo_proxy no longer appear.
QA passed on two Rocky 9 nodes with core:3.24.0-dev.2 and metrics:1.7.0-dev.1, clean install and update from 3.23.2. All test cases are fine and the Containers dashboard shows data.
Activity
gsanchietti commentedon Oct 22, 2026
Testing versions:
core:3.24.0-dev.2,metrics:1.7.0-dev.1Clean install:
Update:
Test case 1: clean install
openldap1) and an external LDAP domain (it createsldapproxy1).Test case 2: update from the current stable versions
Test case 3: an app publishes its own metric
runagent -m node refresh-module-metrics.curl -s localhost:9100/metrics | grep demo_value. It showsdemo_value{module="openldap1"} 42demo_value. The value is 42 and carriesmodule_id="openldap1"or do a query using Prometheus UITest case 4: the app command fails
demo_value 99and exits with an error (exit 1). After the next run, the value stays 42, andjournalctl -u refresh-module-metricsshows a warning foropenldap1.modulelabel, for exampledemo_value{module="other"} 5. The output is refused, the old value stays, and the log says the label is reserved.Test case 5: bad output from one app does not affect the others
demo_proxy 7.this is not valid.demo_proxy{module="ldapproxy1"} 7is still published, together with all the normal node metrics. Only the OpenLDAP value is missing.demo_value 43. After the next run, the value is 43.Test case 6: removing the command
runagent -m openldap1 rm -f ../bin/export-metricsand the same forldapproxy1.demo_valueanddemo_proxyno longer appear.stephdl commentedon Oct 22, 2026
QA passed on two Rocky 9 nodes with
core:3.24.0-dev.2andmetrics:1.7.0-dev.1, clean install and update from 3.23.2. All test cases are fine and the Containers dashboard shows data.set verified