-
-
Notifications
You must be signed in to change notification settings - Fork 122
Closed
Description
Bug description
Newlines in process' cmdline aren't escaped and break Prometheus output format.
To Reproduce
- start a process containing a newline in its command line:
# bash -c 'sleep infinity; > echo plop' - query metrics endpoint. The response looks like this:
Prometheus fails to parse scaphandre's output and ignore all metrics from scaphandre job.
[…] # HELP scaph_process_power_consumption_microwatts Power consumption due to the process, measured on at the topology level, in microwatts # TYPE scaph_process_power_consumption_microwatts gauge scaph_process_power_consumption_microwatts{cmdline="bash-csleep infinity; echo plop",exe="bash",pid="2786006"} 0 […]
Expected behavior
newlines should be either escaped or replaced by spaces like in ps.
Environment
- Debian buster
- Kernel version: 5.10.0-9-amd64
Thanks!
Metadata
Metadata
Assignees
Labels
bugSomething isn't workingSomething isn't working
Type
Projects
Status
Previous releases
