Add support for auto-provisioning Healthchecks jobs #815
Labels
No Label
bug
data loss
design finalized
good first issue
new feature area
question / support
security
waiting for response
No Milestone
No Assignees
2 Participants
Notifications
Due Date
No due date set.
Dependencies
No dependencies set.
Reference: borgmatic-collective/borgmatic#815
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 would like to do
I'm a happy user of borgmatic (running on Docker Swarm) combined with a self-hosted version of Healthchecks. Since Healthchecks version 3.0, their Ping API supports the
create
query parameter, which allows you to auto-provision checks for the slug that you are passing. I have configured borgmatic to use an "archive-prefix" constant as a base for the archive names and I'm using this same constant as a slug in the healthchecks url, instead of a check uuid. Each backup job therefore has its own check and I can track progress/failure for each of them. If you are adding a bunch of jobs to borgmatic, it can be tedious and easily forgotten to provision the Healthchecks checks manually for all added jobs.What I have tried
I have searched the borgmatic documentation, but I could not find an option to specify this query parameter, which should be added to each call that is made to Healthchecks. It cannot be added to the ping_url configuration key, because that url is merely a prefix for the full url that is eventually called by borgmatic.
What I propose
Add support for a configuration option that enables or disables Healthchecks check-auto-provisioning. When the option is enabled, a query parameter
?create=1
will be added to each call that is made to Healthchecks. When the option is disabled, no query parameter is added to the call.Additional information
Healthchecks Ping API documentation
Other notes / implementation ideas
No response
Makes sense to me.. Thanks for taking the time to file this! I'm thinking this feature should be disabled by default, such that you have to opt into it with a borgmatic configuration option.. And maybe the new configuration option should look something like this?
Let me know your thoughts.
Thank you @witten! I agree that the option should be disabled by default, since this is also the default in the Healtchecks API. Using the same name for the configuration option sounds consistent too. There is one catch: the create param is only valid when you are using slugs, combined with a ping-key. So maybe it's better to name the option
create_slug
orauto_create_slug
, so it's clear that this only works when using this url schemehttps://hc-ping.com/<ping-key>/<slug>
as opposed tohttps://hc-ping.com/<uuid>
.Sounds good, thanks!
Implemented by @estebanthi in main and will be part of the next release!