prometheus / prometheus/node_exporter
Feature Request: Improve systemd collector with system state info and DBus timeouts
Nobody has claimed this yet.
- Dominant language
- Go
- Stars
- 13.8k
- Forks
- 2.7k
- Avg merge
- 1d 23h
- Merged PRs (30d)
- 8
Description
This proposal aims to enhance the systemd collector by providing more granular system state information and improving the reliability of DBus communications.
Proposed Changes
Added node_systemd_system_state_info metric: This metric exposes the systemd manager's state (e.g., running, degraded, maintenance) as a label, allowing for better monitoring of the overall system health.
Implemented Timed Contexts for DBus: Replaced context.TODO() with contexts that have a configurable timeout. This prevents the collector from hanging indefinitely if systemd or the DBus system becomes unresponsive.
New Flag --collector.systemd.dbus-timeout: Introduced a flag to allow users to configure the DBus call timeout (defaulting to 5s).
Motivation
Currently, the systemd collector can hang if DBus calls don't return, which can affect the overall performance and reliability of node_exporter. Additionally, having the system state as a metric allows for easier alerting on degraded system states.
Environment Information
Host operating system: Linux (Any distribution using systemd)
node_exporter version: Latest (master)
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 by locating the systemd collector and its DBus calls in the node_exporter codebase, then inspect how collector flags and metrics are defined. Trace the existing context.TODO() uses and the systemd manager state response. Done means exposing the system state metric and configurable DBus timeout without hanging when systemd is unresponsive.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- go, linux
- Domain
- observability-sre, operating-systems
- Issue type
- Feature
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Quiet
- Clarity
- Mostly clear
- Newbie friendliness
- 55/100