Healthchecks integration for independent operations #366
Labels
No Label
bug
data loss
design finalized
good first issue
new feature area
question / support
security
waiting for response
No Milestone
No Assignees
3 Participants
Notifications
Due Date
No due date set.
Dependencies
No dependencies set.
Reference: borgmatic-collective/borgmatic#366
Loading…
Reference in New Issue
No description provided.
Delete Branch "%!s(<nil>)"
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?
What I'm trying to do and why
(This is related to witten/borgmatic#255)
I have 2 cron jobs, one that runs the
prune
andcreate
operations multiple times a day and acheck
job that runs once a week at a given time.I'd like to monitor both using the healthchecks integration.
Steps to reproduce (if a bug)
The healthchecks integration pings the healthchecks URL for both these cron jobs but it is impossible to set a schedule on a single healthchecks monitor that covers the expected starting times of both these cron jobs.
If I set the schedule of the monitor to match the multiple-times-a-day cron job, pings from the
check
job will be extraneous and will not trigger alerts when missed and vice-versa if I use the schedule of the 2nd cron job.While I could stop using the integration and use manual
curl
commands to make it work, I then lose the benefits of the integration which provides more than just pinging URLs.Actual behavior (if a bug)
See the previous section
Expected behavior (if a bug)
TBD as this is a feature request but it will be helpful to have a way to override/specify the healthchecks URL for specific actions.
Other notes / implementation ideas
Environment
borgmatic version: 1.5.10
borgmatic installation method: Installed in a
virtualenv
environment from PyPI.Borg version: 1.1.14
Python version: 3.7.3
operating system and version: Debian 10 Buster
Thank you for taking the time to file this! A couple of thoughts here..
One way I could see to satisfy this need would be to expand the existing Healthchecks configuration schema to encompass different ping URLs per action. Made-up example:
Another idea is to leave the existing configuration schema as-is, but then override the ping URL on the command-line when running each action in a cron job. And use a separate ping URL / Healthchecks monitor for each cron job. Example:
This approach has the benefit of working today without any changes to borgmatic. The downside of course is you need to put the ping URL in your cron job.
Let me know your thoughts!
@witten, thanks for the very quick response 🙂
I'm perfectly fine with using this solution for my needs if a lot of effort and thought has to be put into implementing the former. It will be good to document this scenario and solution.
It might be easier to declare a default URL and override only the ones that have to be different.
#518 is a very similar change on the Cronitor monitoring hook. It's possible that work there could apply to Healthchecks as well.
Subscribing since I have the same issue!