Open darknetehf opened 8 months ago
Update and possible fix:
I installed the package manually from this repo instead of using the Debian package. In the releases I picked this file: process-exporter_0.7.10_linux_amd64.deb
and installed it with dpkg.
It should be noted that there are differences between this package and the Debian package version.
On Debian the systemd service is named: prometheus-process-exporter.service
In ncabatoff package it is: process-exporter.service
The unit files differ as well:
On Debian:
● prometheus-process-exporter.service - Prometheus exporter that mines /proc to report on selected processes
Loaded: loaded (/lib/systemd/system/prometheus-process-exporter.service; enabled; vendor preset: enabled)
Active: active (running) since Wed 2023-12-20 18:27:04 GMT; 4h 5min ago
Docs: https://github.com/ncabatoff/process-exporter
man:prometheus-process-exporter(1)
Main PID: 4095383 (prometheus-proc)
Tasks: 5 (limit: 1115)
Memory: 20.0M
CPU: 2.980s
CGroup: /system.slice/prometheus-process-exporter.service
└─4095383 /usr/bin/prometheus-process-exporter
ncabatoff:
● process-exporter.service - Process Exporter for Prometheus
Loaded: loaded (/lib/systemd/system/process-exporter.service; enabled; preset: enabled)
Active: active (running) since Wed 2023-12-20 22:16:30 GMT; 15min ago
Main PID: 4727 (process-exporte)
Tasks: 5 (limit: 1108)
Memory: 16.5M
CPU: 3.066s
CGroup: /system.slice/process-exporter.service
└─4727 /usr/bin/process-exporter --config.path /etc/process-exporter/all.yaml --web.listen-address=:9256
And the EnvironmentFile directive in the systemd unit file differs as well. The file /etc/process-exporter/all.yaml is not present when installing the Debian package. Contents:
process_names:
- name: "{{.Comm}}"
cmdline:
- '.+'
This seems to be the missing piece.
A quick fix is to create that missing all.yaml
file and adapt the service CLI to use that config file:
For example this command will properly expose the metrics on port 9257:
/usr/bin/prometheus-process-exporter -debug --web.listen-address=:9257 --config.path /tmp/all.yaml
In conclusion the issue seems to be with the Debian packaging.
Listing files provided by package:
apt-file list prometheus-process-exporter
Output:
prometheus-process-exporter: /etc/default/prometheus-process-exporter
prometheus-process-exporter: /etc/init.d/prometheus-process-exporter
prometheus-process-exporter: /etc/logrotate.d/prometheus-process-exporter
prometheus-process-exporter: /lib/systemd/system/prometheus-process-exporter.service
prometheus-process-exporter: /usr/bin/prometheus-process-exporter
prometheus-process-exporter: /usr/share/doc/prometheus-process-exporter/README.md.gz
prometheus-process-exporter: /usr/share/doc/prometheus-process-exporter/changelog.Debian.amd64.gz
prometheus-process-exporter: /usr/share/doc/prometheus-process-exporter/changelog.Debian.gz
prometheus-process-exporter: /usr/share/doc/prometheus-process-exporter/copyright
prometheus-process-exporter: /usr/share/doc/prometheus-process-exporter/examples/all.yaml
prometheus-process-exporter: /usr/share/man/man1/prometheus-process-exporter.1.gz
The all.yaml
file is provided so it is sufficient to edit this file: /etc/default/prometheus-process-exporter
as follows:
ARGS="-config.path /usr/share/doc/prometheus-process-exporter/examples/all.yaml"
Then restart the service:
systemctl restart prometheus-process-exporter
Process metrics will be returned on the /metrics endpoint on port 9256.
Hi,
This is a possibly related issue: #284
Output of
prometheus-process-exporter -version
:OS: Debian GNU/Linux 12 (bookworm) How the package was installed: the package was installed using Ansible:
Running in debug mode, on a different port (9257):
prometheus-process-exporter -debug -web.listen-address :9257
We can see that process discovery seems to be taking place normally, but no metrics are returned on the /metrics endpoint:Output from endpoint on port 9256: