Add systemd uptime metric collection#952
Conversation
41d45c1 to
8ae6035
Compare
|
@langesven Thanks for the PR! |
8ae6035 to
1c2a5a7
Compare
|
Hi @discordianfish - fair enough, I changed it to a CounterValue that is either 0 or the unix timestamp of when the job was started. Or would a Gauge be better suited but still keep track of just the timestamp? |
|
Note that there is also this PR #709 |
|
@langesven After some back and forth we decided to use gauges for timestamps in general, so yeah please change this to a gauge. |
discordianfish
left a comment
There was a problem hiding this comment.
Looking good in general, but we should also have some tests if possible.
collector/systemd_linux.go
Outdated
There was a problem hiding this comment.
Let's call this unit_start_time_seconds to be consistent with already existing process_start_time_seconds.
There was a problem hiding this comment.
@discordianfish That won't work, because process_start_time_seconds metric family has no labels, so the collector will fail.
There was a problem hiding this comment.
I think for consistency, we could name it unit_start_time_seconds.
There was a problem hiding this comment.
@SuperQ That's what I suggested! Should have put it in ```` though :)
There was a problem hiding this comment.
Sorry! I didn't read what you said closely enough. 🦆
|
@langesven Can you change the metric name? Beside this LGTM |
1c2a5a7 to
867690e
Compare
|
Thanks for your feedback. |
|
Oh, would you mind adding a |
77fdded to
388b97b
Compare
|
Added a feature changelog entry and rebased against master |
|
@langesven Looks like this still (again?) needs rebasing |
Signed-off-by: Sven Lange <tdl@hadiko.de>
Signed-off-by: Sven Lange <tdl@hadiko.de>
388b97b to
7f505fb
Compare
|
@discordianfish it was indeed again 😄 rebased |
* Add systemd uptime metric collection Signed-off-by: Sven Lange <tdl@hadiko.de>
The no longer available
systemd_exporterprovided uptime metrics for systemd services, as such I figured I'd propose this as an extension tonode_epxorter.This is somewhat relevant to #562 in that it exposes how long a service has been running for, not quite the timestamp of its start.
Exporting the duration makes it easier to define alerts on this metric in my opinion and would retain the functionality as provided by the previous project.