process-exporter
process-exporter copied to clipboard
.ExeFull should be the fully-qualified path to the executable but isn't
My intent when I introduced the templating system for naming groups was that .ExeFull would yield the fully-qualified path to the executable. In practice it was implemented by looking at /proc/
I knew that a process can write to its argv to change what ps reports, but I somehow didn't think about the implications for .ExeFull while I was implementing it. If the process decides to change its argv then we're at the mercy of what it writes. It may even introduce spaces, which would never occur naturally since they should be replaced by NULLs.
I'm reluctant to change the existing behaviour because it may break existing configurations. One idea I had was to introduce a new 'exe' label which would have the value in /proc/
The use of .ExeBase
and .ExeFull
cause huge cardinality explosion when dealing with Chromium (and Electron) apps, which all seem to rewrite argv[0]
to be space delimited.
Configuration like this helps, but needs to be configured for each new electron app.
process_names:
- name: chrome
cmdline:
- "chrome .*"
- name: code
cmdline:
- "[cC]ode .*"
- name: signal-desktop
cmdline:
- "signal-desktop .*"
- name: slack
cmdline:
- "[sS]lack .*"
- name: "{{.ExeBase}}"
cmdline:
- '.+'