External integrations for borgmatic check and prune #249

Closed
opened 2019-11-20 06:51:22 +00:00 by nightah · 5 comments

What I'm trying to do and why

Ensure that external integrations are successfully fired off during a start, success or failure for:

  • borgmatic check
  • borgmatic prune

Other notes / implementation ideas

Currently it appears that a hit to the /start and success endpoint for healthchecks is only triggered for a borgmatic create, this should also be extended to the above borgmatic commands.

#### What I'm trying to do and why Ensure that external integrations are successfully fired off during a start, success or failure for: - `borgmatic check` - `borgmatic prune` #### Other notes / implementation ideas Currently it appears that a hit to the `/start` and success endpoint for healthchecks is only triggered for a `borgmatic create`, this should also be extended to the above borgmatic commands.
Owner

Thanks for filing. Stray thought: I wonder if the determining factor on whether a borgmatic action should ping external monitoring services like Healthchecks is if the current terminal is an interactive one or not. That way, if you run the command manually (with any actions), it won't ping Healthchecks. If you run it non-interactively (with any actions), like in a cron job, it will ping Healthchecks. One downside I can see is that it may make manual testing harder.

Thoughts? I don't feel super strongly either way.

Thanks for filing. Stray thought: I wonder if the determining factor on whether a borgmatic action should ping external monitoring services like Healthchecks is if the current terminal is an interactive one or not. That way, if you run the command manually (with any actions), it won't ping Healthchecks. If you run it non-interactively (with any actions), like in a cron job, it will ping Healthchecks. One downside I can see is that it may make manual testing harder. Thoughts? I don't feel super strongly either way.
Author

Yeah from my perspective I'm not particularly fussed either way.

The downside I can see is that if something fails and I want to re-execute a command and have it fix a potentially failed healthchecks ping I would have to do this manually, or force cron to execute the job again which might actually be more effort than it's worth.

It's probably a good thought, maybe if we are going to do that also include an opt-in flag/option which can allow us to hit the monitoring endpoint when run interactively?

Yeah from my perspective I'm not particularly fussed either way. The downside I can see is that if something fails and I want to re-execute a command and have it fix a potentially failed healthchecks ping I would have to do this manually, or force cron to execute the job again which might actually be more effort than it's worth. It's probably a good thought, maybe if we are going to do that also include an opt-in flag/option which can allow us to hit the monitoring endpoint when run interactively?
Owner

Good idea. I'll play around with some of the approaches and see what appears to work well.

Good idea. I'll play around with some of the approaches and see what appears to work well.
Owner

Related issue: #255.

Related issue: #255.
witten added this to the per-action hooks milestone 2019-12-05 21:16:57 +00:00
Owner

Well, I went with the simpler approach for now, and just expanded the Healthchecks integration to trigger when there are any prune, create, or check actions. We can always revisit.

Just released in borgmatic 1.4.20. Let me know how it works for you, and thanks again for the idea!

Well, I went with the simpler approach for now, and just expanded the Healthchecks integration to trigger when there are any `prune`, `create`, or `check` actions. We can always revisit. Just released in borgmatic 1.4.20. Let me know how it works for you, and thanks again for the idea!
Sign in to join this conversation.
No Milestone
No Assignees
2 Participants
Notifications
Due Date
The due date is invalid or out of range. Please use the format 'yyyy-mm-dd'.

No due date set.

Dependencies

No dependencies set.

Reference: borgmatic-collective/borgmatic#249
No description provided.