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
{{ message }}
Repository navigation
Metrics: rule checks log under random container names #8365
Install an application that ships its own alert rules for the Metrics module, or change its rules, so Metrics checks them. For example, publish a rule in module/<module_id>/metrics_alert_rules and emit the metrics-alert-rules-changed event.
Look at the system log of the node that runs Metrics, e.g. journalctl --since -1h _UID=$(id -u metrics1).
Expected behavior
Log lines written while Metrics checks the alert rules carry a fixed log name (syslog identifier), like the other Metrics services, e.g. prometheus.
Actual behavior
Every rule check runs promtool in a new, unnamed container. Podman gives each one a random name, and that name becomes the log name of its output. In one hour, a node with a single application rule set logged under more than 20 different random names:
The Loki log server indexes log names, so the number of indexed values grows with every rule check and never stops. The lines are also hard to find, because they do not carry the Metrics name.
api-cli run update-module --data '{"module_url":"ghcr.io/nethserver/metrics:1.7.2-dev.2","instances":["metrics1"],"force":true}'
Install an application that publishes alert rules (e.g. Porthos, see feat(metrics): alert on failed snapshot ns8-porthos#39), or publish a rule in module/<module_id>/metrics_alert_rules and emit the metrics-alert-rules-changed event.
On the Metrics node, check that the rules are loaded: ls /home/metrics1/.config/state/rules.d/ lists the generated rule file, and the Prometheus UI shows the rules.
Check the log: journalctl --since -10min _UID=$(id -u metrics1) -o json | jq -r .SYSLOG_IDENTIFIER | sort | uniq -c. Expected: only fixed names (e.g. prometheus, alertmanager, grafana, agent), no random container names like agitated_lamport.
Publish an invalid rule (e.g. a broken PromQL expr) and emit the event again: the error is still logged under a fixed name and the invalid rule set is not loaded.
Activity
DavidePrincipi commentedon Dec 2, 2026
Test case
Image:
ghcr.io/nethserver/metrics:1.7.2-dev.2module/<module_id>/metrics_alert_rulesand emit themetrics-alert-rules-changedevent.ls /home/metrics1/.config/state/rules.d/lists the generated rule file, and the Prometheus UI shows the rules.journalctl --since -10min _UID=$(id -u metrics1) -o json | jq -r .SYSLOG_IDENTIFIER | sort | uniq -c. Expected: only fixed names (e.g.prometheus,alertmanager,grafana,agent), no random container names likeagitated_lamport.expr) and emit the event again: the error is still logged under a fixed name and the invalid rule set is not loaded.gsanchietti commentedon Dec 2, 2026
Verified with
ghcr.io/nethserver/metrics:1.7.2-dev.2on a single-node cluster: all steps pass.module_idscoping, a test alert fires.agent@metrics9.Note:
1.7.2-dev.1lacks the fix; the test case image should read1.7.2-dev.2.