mirror of
https://github.com/healthchecks/healthchecks.git
synced 2026-04-24 22:45:56 +03:00
[GH-ISSUE #959] Checks API field for last successful ping #671
Labels
No labels
bug
bug
bug
feature
good-first-issue
new integration
pull-request
question
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
starred/healthchecks#671
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @Kemichal on GitHub (Feb 10, 2024).
Original GitHub issue: https://github.com/healthchecks/healthchecks/issues/959
The /checks API already contains a field
last_ping, this value will be the date for the last ping, including start or fail pings (AFAIK).What I would like to know, via the API, is when the last successful ping happened.
Adding a new field like
last_successful_pingwould be very helpful.@cuu508 commented on GitHub (Feb 12, 2024):
We don't currently track the last successful ping in the database, so making this work would not be as simple as exposing an additional database field.
Out of curiosity, what is your use case, how would you use the last successful ping timestamp?
@Kemichal commented on GitHub (Feb 14, 2024):
I see
One of my use cases is to monitor background jobs (backups etc) on a lot of servers.
When these jobs start I send a start ping and then a success/fail ping when the job is done/crashed.
The thing is that some of these systems I'm monitoring are in environments where it's not unsual that the internet or power goes out for a few days.
So if some of my jobs goes down for a day or so I'm not going to start investigating the problem most of the time, but after a few days I'm more keen to look into it.
Therefor I have made an internal status page (using the API) that sorts the jobs in order of last successful ping (I thought) with extra visuals to signal a system that has been off for longer than 2 days.
@cuu508 commented on GitHub (Feb 15, 2024):
With what's available today, you could look at using the List check's status changes API. For checks that are currently down, you can use this API endpoint to determine when they went down (and so, for how long they have been down).
The downside of this approach is the additional HTTP requests to fetch this information.
@Kemichal commented on GitHub (Feb 15, 2024):
@cuu508 Thanks for the suggestion, I think I could get it to work with flips. The extra requests are no big deal for my use case.
This issue can be closed unless you want to track it.