mirror of
https://github.com/healthchecks/healthchecks.git
synced 2026-04-25 23:15:49 +03:00
[GH-ISSUE #664] Lots of alerts after Healthcheck downtime #475
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#475
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 @horschi on GitHub (Jun 8, 2022).
Original GitHub issue: https://github.com/healthchecks/healthchecks/issues/664
When the healthchecks service is down for some time, starting it up generates lots of alerts. It would be nice if there was a way to have a clean way of having healthchecks shut down (e.g. for updates/maintenance).
Ideally healthchecks would handle this itself.
Alternatively is there some way to cleanly shut-down healthchecks, so that it does not generate alerts on startup?
e.g. like this:
@phaer commented on GitHub (Jun 8, 2022):
I think you can use
manage.py prunenotifications(https://github.com/healthchecks/healthchecks/blob/master/hc/api/management/commands/prunenotifications.py) to delete after a successful ping.https://healthchecks.io/docs/self_hosted/ :
@cuu508 commented on GitHub (Jun 10, 2022):
The first and best option would be to avoid long downtimes :-)
The second option is to pause all checks before starting Healthchecks after an extended downtime. One way to do that would be with a SQL query:
(checks currently in the
upstate are the ones that could potentially go down whensendalertsresumes. So the above query only pauses those, and does not touch checks in thenew,downor already in thepausedstate)@horschi commented on GitHub (Jun 10, 2022):
@cuu508 : And after the startup and some grace time (to allow every host to ping) it would be best to reset the paused state. Otherwise if a service went down during the healthchecks maintenance, I would not get notified.
So afterwards something like this?
UPDATE api_check SET status='up' WHERE status='paused'Or to down state?
@cuu508 commented on GitHub (Jun 10, 2022):
Ah, I understand what you're after a little better now. You originally suggested:
I haven't tested this myself, but, at a glance, it should work. If all checks are green when you start sendalerts then sendalerts should be happy and not trigger any alerts.
@horschi commented on GitHub (Jun 17, 2022):
@cuu508 : I tried it, but used the following update after when bringing healthchecks back up:
UPDATE api_check SET status='down' WHERE status='paused'
This was working fine for all services the made a ping in time. A service that did not make make a ping while the "Wait for all services to call and make all statuses go green" phase, was being set into down state, but did not trigger any mails.
I guess setting paused states to up afterwards is better.