prometheus / prometheus/node_exporter
finer grain control of systemd metrics
Nobody has claimed this yet.
- Dominant language
- Go
- Stars
- 13.8k
- Forks
- 2.7k
- Avg merge
- 1d 23h
- Merged PRs (30d)
- 8
Description
As raised at https://github.com/prometheus/node_exporter/issues/1201#issuecomment-540264723, it isn't possible to get --collector.systemd.enable-restarts-metrics without pulling in other, very numerous metrics that come with --collector.systemd.
For example, on our prometheus deployment, metric node_systemd_unit_state represents 14% of our total metric key space. It's wasteful, as we only need node_systemd_service_restart_total (which is 2% of key space).
non-solution: "filter at the server side". We want to prevent these sizable, unneeded metrics from affecting the leaves and intermediaries of the system.
questionable-solution: "use systemd exporter". Why must we learn, configure, and deploy another exporter when node_exporter already has the metric we need?
Proposal: add a new flag to disable the default metrics of --collector.systemd (method collectUnitStatusMetrics of the collector)
cc: @pgier
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start in collector/systemd_linux.go at collectUnitStatusMetrics and trace how --collector.systemd.enable-restarts-metrics is registered and used. Add the proposed control for the default systemd metrics, then verify that restart metrics remain available without the unwanted unit-state metrics. Done means the collector can emit only the requested restart metrics.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- go
- Domain
- observability
- Issue type
- Feature
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Clearly specified
- Newbie friendliness
- 45/100