node_exporter icon indicating copy to clipboard operation
node_exporter copied to clipboard

Feature Request: Improve systemd collector with system state info and DBus timeouts

Open bahattinyunus opened this issue 6 months ago • 0 comments

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)

bahattinyunus avatar May 07 '26 16:05 bahattinyunus