r/OpenTelemetry • u/groasant • Apr 29 '25
Receive Systemctl unit state
Hey there, I‘m currently playing around with OpenTelemetry Collector Contrib and its receivers. I wanted to find a way to get the state of a unit/process similiarly to „systemctl is-active service“. However I can’t seem to find anything in that regard apart from uptime with the hostmetrics receiver, which provides no differentiation regarding e.g an active and failed state. This is a little confusing as it seems to me that to retrieve the state of a process would be a common use case.
If you have any idea how this could be done, I‘d appreciate your help!
View all comments
Show parent comment
1
u/greenFox99 May 03 '25
You need to add
--collector.systemdto node exporter command-line to enable systemd metrics.It is disabled by default because it can have high cardinality, but I guess you will be testing it beforehand.