Node lifespan

67 views
Skip to first unread message

rafra...@gmail.com

unread,
Aug 3, 2018, 4:20:34 AM8/3/18
to Prometheus Users
Hello my nodes have lifespan of 1000 hours after this i have to change the node.
Currently i think it's easy to make alert when node is up 1000 hours but that's not the case.
Because nodes can be restarted and in this way the lifetime would be set to 0.
So i need some counter which is aggregating node lifetime even if its restarted or turned off from time tot ime.
Can some one help me with achieving a solution for this ?
Or when can i look for answers if it's not a right place ?

Ben Kochie

unread,
Aug 3, 2018, 4:31:23 AM8/3/18
to rafra...@gmail.com, Prometheus Users
Just like `node_boot_time_seconds` can be used for uptime, you could use the textfile exporter to create a metric like `node_created_time_seconds` that is written once as part of the provisioning process.

Then you can use `time() - node_created_time_seconds` to find out the lifespan of the node.

--
You received this message because you are subscribed to the Google Groups "Prometheus Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to prometheus-use...@googlegroups.com.
To post to this group, send email to promethe...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/prometheus-users/00012065-6dd2-4bae-8837-4f8539290bbd%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

rafra...@gmail.com

unread,
Aug 3, 2018, 5:03:22 AM8/3/18
to Prometheus Users
But you know what if node will be down for lets say one week so your solutions is substracting 168 hours from lifespan
Reply all
Reply to author
Forward
0 new messages