Skip to content

fix: stop logging promtool runs to journald - #124

Merged
DavidePrincipi merged 1 commit into
hardening_2from
bug-8365
Dec 2, 2026
Merged

DavidePrincipi merged 1 commit into
hardening_2from
bug-8365

Conversation

@DavidePrincipi

Copy link
Copy Markdown
Member

Every time Metrics checks the alert rules of an application, it runs promtool in a new, unnamed container. The container output was also copied to the system log under the random container name, so the Loki log server indexed a new log name at every check, and the lines were hard to find. NethServer/dev#8365

The container log copy is now disabled for these promtool runs. Nothing else changes: the script still reads the promtool output directly, and rule errors are still logged by Prometheus provisioning as before.

How to test

  • Publish a rule set in module/<module_id>/metrics_alert_rules and emit the metrics-alert-rules-changed event, or install an application that ships one, like Porthos.
  • Check that the rules are provisioned under rules.d/ and loaded by Prometheus.
  • Check that journalctl --since -10min _UID=$(id -u metrics1) shows no lines under random container names.
  • Publish an invalid rule and check that the error is still logged.

See also


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

@DavidePrincipi DavidePrincipi self-assigned this Dec 1, 2026
@gsanchietti
gsanchietti changed the base branch from main to hardening_2 December 2, 2026 07:21
Each alert rule check starts promtool in a new unnamed container. With
the default journald log driver, its output was copied to the journal
under the random container name, so the log server indexed a new log
name at every check.

The caller already captures promtool output and reports errors, so
disable the container log driver for these runs.

Assisted-by: Claude Code:claude-opus-5-5
@DavidePrincipi
DavidePrincipi merged commit e37ba6f into hardening_2 Dec 2, 2026
4 of 6 checks passed
@DavidePrincipi
DavidePrincipi deleted the bug-8365 branch December 2, 2026 08:53
gsanchietti pushed a commit that referenced this pull request Dec 2, 2026
Each alert rule check starts promtool in a new unnamed container. With
the default journald log driver, its output was copied to the journal
under the random container name, so the log server indexed a new log
name at every check.

The caller already captures promtool output and reports errors, so
disable the container log driver for these runs.

Assisted-by: Claude Code:claude-opus-5-5
gsanchietti pushed a commit that referenced this pull request Dec 2, 2026
Each alert rule check starts promtool in a new unnamed container. With
the default journald log driver, its output was copied to the journal
under the random container name, so the log server indexed a new log
name at every check.

The caller already captures promtool output and reports errors, so
disable the container log driver for these runs.

Assisted-by: Claude Code:claude-opus-5-5
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.

2 participants