Add Watchgoose monitoring hook #1335
Labels
No labels
blocked
breaking
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#1335
Loading…
Reference in a new issue
No description provided.
Delete branch "%!s()"
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'd like to do and why
Watchgoose is a Europe-hosted and owned service for monitoring backups, cron jobs, Kubernetes jobs, scripts, etc. (They contribute a portion of profits to open source projects and provide free monitoring for them as well.)
This ticket is for adding a native Watchgoose monitoring hook to borgmatic. Reportedly, the existing Healthchecks hook actually works with Watchgoose when configuring a Watchgoose ping URL instead of a Healthchecks one. That likely means that the Healthchecks hook can be forked to serve as a basis for any Watchgoose hook.
Open questions that should be answered before this work can begin:
logstate like Healthchecks does? Do sent logs get surfaced somewhere in the Watchgoose UI??create=1on certain ping URLs to create a new monitor from the command-line?As for implementation to dos:
watchgoose:option. Modify as appropriate.Other notes / implementation ideas
No response
Hi Dan,
Thanks for taking care of this. Answers in the order:
Yes. Watchgoose supports the
/logstate. A request tohttps://watchgoose.com/ping/<uuid>/logrecords the provided body as a log event. The event and body are visible in the check event history and ping details UI. A log event is state neutral, it does not mark the check up or down, reset its expected schedule or trigger an alert.Yes. Watchgoose supports auto provisioning using the ping-key/slug URL form:
https://watchgoose.com/ping/<ping-key>/<lowercase-slug>?create=1. Thecreate=1option applies only to the ping key/slug form, not UUID URLs.An existing check returns
200 OK, a newly created check returns201 Created. A missing check withoutcreate=1returns404 Not Found. If the account has reached its check limit, Watchgoose returns403with the plain text bodycheck limit reached. An ambiguous duplicate slug returns409withambiguous slug.https://watchgoose.com/ping/<uuid>.The lifecycle suffixes are also the same:
https://watchgoose.com/ping/<uuid>/starthttps://watchgoose.com/ping/<uuid>/failhttps://watchgoose.com/ping/<uuid>/logExit-status suffixes from
/0through/255are supported as well. Status0means success, while a non zero status means failure. The optionalrid=<uuid>query parameter is supported for associating lifecycle events with the same run.The current ping body limit is 10,000 bytes. Watchgoose truncates larger request bodies to that limit and includes this response header:
Ping-Body-Limit: 10000. Borgmatic can safely truncate logs to 10,000 bytes before sending them.The ping protocol is compatible with modern Healthchecks semantics. Watchgoose accepts GET, POST, HEAD, and other HTTP methods. Successful normal pings return plain-text
OKwith HTTP 200; newly auto-provisioned checks return plain textCreatedwith HTTP 201.The main deliberate difference is auto provisioning at the plan limit: Watchgoose rejects creation immediately with HTTP 403 rather than allowing Healthchecks’ additional check-count headroom. Plan limits and event-retention counts also differ.
The free tier includes 10 checks and retains the newest 200 events per check.
/logevents and their bodies are recorded and displayed on the free tier in the same way as on paid plans so it should be sufficient for implementing and testing the hook.Let me know if you'd have any more questions or would need any help around this implementation.
Kind regards,
Bartek Rutkowski
Thanks, this is all very helpful! I think for this initial version, I'll focus on parity with the existing Healthchecks feature set. And then we can always discuss additional features (e.g.
rid=, etc.) on future tickets.This is implemented in main and will be part of the next release. Thanks again!
Released in borgmatic 2.1.7!