Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: add heartbeat metrics #100

Closed
wants to merge 1 commit into from
Closed

feat: add heartbeat metrics #100

wants to merge 1 commit into from

Conversation

mtoohey31
Copy link
Contributor

Prometheus is a bit overkill for my use case, so I was wondering if you'd be interested in adding a more simple metrics option. Basically, if the user provides a non-empty URL, gickup makes a GET request to the URL after each backup. I totally understand if this seems like an unecessary feature though. Similar functionality can already be accomplished by using your own scheduling method and making the request with CURL if gickup exited successfully, though this feels kind of hacky too since scheduling is already built-in.

If you're interested in adding this feature, I had one implementation question: should I make the config section a mapping with a url key so we can expand it without breaking changes if neccessary (though I can't think of how we'd need to), or should I just make heartbeat a string that takes the url?

@cooperspencer
Copy link
Owner

I am not against, but I don't really get the use case. In my opinion a heartbeat would make more sense for the sources/destinations if they are reachable.

Otherwise if you want to implement it like this, I think the url parameter is fine. Maybe it makes sense to make a list of urls, if there is more to monitor.

@mtoohey31
Copy link
Contributor Author

My specific usecase is https://healthchecks.io/. I have a handful of scripts running here and there for backups and other important things that need to run on a regular schedule, so I have them make a request to there whenever they succeed, and that service notifies me if they haven't checked in within the required interval.

Having multiple urls is definitely a good idea, but thinking about this more, it kind of feels like feature creep. Like I mentioned, this is already possible if you use an external cron scheduler to schedule gickup conf.yaml && curl ..., so I think what I'll do is create a repo with a Dockerfile that extends the main gickup container and takes the URL(s) as an environment variable. I'll link it here once it's done in case anyone looking for a similar solution comes across this PR.

@mtoohey31 mtoohey31 closed this Mar 2, 2022
cooperspencer pushed a commit that referenced this pull request May 17, 2022
* feat: add heartbeat metrics

* feat: Support multiple heartbeat URLs

#100 introduced heartbeat support but only supported one URL. This PR was closed, however I've re-introduced this feature and added support for multiple heartbeat URLs as discussed in the #100 discussion.

This also resolves #108 which is a feature request for the heartbeat feature.

* fix: When sending the heartbeat fails, log an error but don't crash the program

This prevents problems with external services from causing the program to quit.

Co-authored-by: Matthew Toohey <contact@mtoohey.com>
Co-authored-by: Jordan Crawford <>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants