External integrations for borgmatic check and prune #249

Closed
opened 2 years ago by nightah · 5 comments
nightah commented 2 years ago

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.
Poster

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 2 years ago
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!
witten closed this issue 2 years ago
Sign in to join this conversation.
No Milestone
No Assignees
2 Participants
Notifications
Due Date

No due date set.

Dependencies

This issue currently doesn't have any dependencies.

Loading…
There is no content yet.