get time for last sucessful probe

43 views
Skip to first unread message

Amit Das

unread,
Jun 10, 2021, 4:03:44 AM6/10/21
to Prometheus Users
Hi 
i was looking for getting the time, date when the last probe sucess was 1 let it be 20 days or 5min time just need when it was successful.
Do i need to add write any recording rules or any other functions available?.

Thanks,
Amit

Guy

unread,
Jun 10, 2021, 11:10:53 AM6/10/21
to Prometheus Users
I guess you mean that there is only one point of probe (one application that Prometheus follows). Assuming that, why don'tyoiu just create a gauge and fill it with the tick count every second? When you query Prometheus with that gauge, you can convert it into a DateTime. The value will be the last time the query passed.

-Guy

Amit Das

unread,
Jun 20, 2021, 7:26:59 AM6/20/21
to Prometheus Users
Hi 
Just saw the reply. Can you provide some example so i can refer. Its not with probe sucess it can be uptime when my server lattime was down like up ==0 want to get the date and time.
i get current time  date only when i use   time()  - up(job{"new"}) == 0  which is wrong.


Thanks,
Reply all
Reply to author
Forward
0 new messages