Skip to content

Fix indentation of collector arguments in node_exporter systemd unit - #888

Open
cod3mas0n wants to merge 1 commit into
prometheus-community:mainfrom
cod3mas0n:main
Open

Fix indentation of collector arguments in node_exporter systemd unit#888
cod3mas0n wants to merge 1 commit into
prometheus-community:mainfrom
cod3mas0n:main

Conversation

@cod3mas0n

Copy link
Copy Markdown

Fixes #886

Changes

  • Restructured the Jinja2 loop that emits collector flags so that every argument is emitted with a consistent 4-space indent.
  • Simplified the if collector is mapping / else conditions and removed the problematic whitespace-control markers that caused the first line of a mapping collector to lose its indentation.

Before

ExecStart=/usr/local/bin/node_exporter \
    '--collector.systemd' \
'--collector.textfile' \
    '--collector.textfile.directory=/var/lib/node_exporter' \
'--collector.filesystem' \
    '--collector.filesystem.ignored-fs-types=^(sys|proc|auto)fs$' \
    '--collector.filesystem.ignored-mount-points=^/(sys|proc|dev)($|/)' \
    '--web.listen-address=0.0.0.0:9100' \
    '--web.telemetry-path=/metrics'

After

ExecStart=/usr/local/bin/node_exporter \
    '--collector.systemd' \
    '--collector.textfile' \
    '--collector.textfile.directory=/var/lib/node_exporter' \
    '--collector.filesystem' \
    '--collector.filesystem.ignored-fs-types=^(sys|proc|auto)fs$' \
    '--collector.filesystem.ignored-mount-points=^/(sys|proc|dev)($|/)' \
    '--web.listen-address=0.0.0.0:9100' \
    '--web.telemetry-path=/metrics'

Signed-off-by: cod3mas0n <a.mehraji75@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Inconsistent indentation in node_exporter systemd unit ExecStart line

1 participant