Allow configuring healthchecks.io ping behavior #525

Closed
opened 3 months ago by tommy · 3 comments
tommy commented 3 months ago

I would like to be able to configure the pings to healthchecks.io in a more fine grained manner, specifically so that borgmatic doesn't send a started or fail ping, and instead only sends the success ping if everything finished successfully.

What is the use case for this? Well I want to give my backup healthchecks some leniency, as I'm running a distributed cluster where the backups are run nigthly, and some nights a client may or may not be up and running (which is not critical by any means). In this situation I configure my healthchecks to wait 3 days before switching to the DOWN state, since the backup will likely succeed within a few days when the client is back up again.

This is currently not possible to do since borgmatic sends the fail ping as soon as a backup fails, which means that healthchecks.io pushes failure notifications immediately even though the situation is not critical.

Essentially I would like to have some kind of simple configuration option to control this behavor, perhaps somethings along these lines:

    healthchecks: https://ping-url
    	ping_start: false
        ping_fail: false
I would like to be able to configure the pings to healthchecks.io in a more fine grained manner, specifically so that borgmatic doesn't send a `started` or `fail` ping, and instead only sends the `success` ping if everything finished successfully. What is the use case for this? Well I want to give my backup healthchecks some leniency, as I'm running a distributed cluster where the backups are run nigthly, and some nights a client may or may not be up and running (which is not critical by any means). In this situation I configure my healthchecks to wait 3 days before switching to the `DOWN` state, since the backup will likely succeed within a few days when the client is back up again. This is currently not possible to do since borgmatic sends the `fail` ping as soon as a backup fails, which means that healthchecks.io pushes failure notifications immediately even though the situation is not critical. Essentially I would like to have some kind of simple configuration option to control this behavor, perhaps somethings along these lines: ``` healthchecks: https://ping-url ping_start: false ping_fail: false ```
Owner

That makes sense to me! Thanks for filing the ticket and describing your use case. I think this change would require a configuration schema change to work, as the current heathchecks key just has a single scalar value: the URL. But it does seem like we're going to need multiple configuration options at some point, so it might as well be for this feature.

That makes sense to me! Thanks for filing the ticket and describing your use case. I think this change would require a configuration schema change to work, as the current `heathchecks` key just has a single scalar value: the URL. But it does seem like we're going to need multiple configuration options at some point, so it might as well be for this feature.
Owner

This is implemented in master now! I ended up going with a list option instead of a set of flags though. Here's how it would look to configure borgmatic to only ping for the success state:

hooks:
    healthchecks:
        ping_url: https://...
        states:
            - finish

This will be part of the next release! Thanks again for the idea.

This is implemented in master now! I ended up going with a list option instead of a set of flags though. Here's how it would look to configure borgmatic to only ping for the success state: ``` hooks: healthchecks: ping_url: https://... states: - finish ``` This will be part of the next release! Thanks again for the idea.
witten closed this issue 3 months ago
Owner

Released in borgmatic 1.6.1!

Released in borgmatic 1.6.1!
Sign in to join this conversation.
No Milestone
No Assignees
2 Participants
Notifications
Due Date

No due date set.

Dependencies

No dependencies set.

Reference: borgmatic-collective/borgmatic#525
Loading…
There is no content yet.