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

Stats export #64

Open
m90 opened this issue Feb 13, 2022 · 3 comments
Open

Stats export #64

m90 opened this issue Feb 13, 2022 · 3 comments
Labels
enhancement New feature or request help wanted Extra attention is needed

Comments

@m90
Copy link
Member

m90 commented Feb 13, 2022

#60 introduced the collection of stats about a backup run (e.g. size, duration, number of pruned items). These stats can currently be consumed in post-backup notifications, however it should also be possible to send these to arbitrary monitoring systems (e.g. Prometheus) so that users can monitor their backups on such systems.

I don't know too much about the monitoring landscape out there, but in case someone would like to use this feature, I'd be happy to hear from you about how this could work in your setup.

@m90 m90 added enhancement New feature or request help wanted Extra attention is needed labels Feb 13, 2022
@rpatel3001
Copy link
Contributor

Instrumenting for prometheus should be fairly easy (https://prometheus.io/docs/guides/go-application/). I think most common monitoring systems can ingest the data by scraping the /metrics page.

@pixxon
Copy link
Contributor

pixxon commented Nov 1, 2023

Instrumenting the Go application is indeed fairly easy, since Prometheus itself provides the tools, but the issue here comes from the application not running continuously. This can be connected to #268, which would also require the application to take control and be the entrypoint of the containers.

Regarding how Prometheus operates, the microservices expose a metrics endpoint, most commonly /metrics ( and sometimes on a seperate port than where the service itself serves ). This is scraped by Prometheus itself periodically and it stores the information in its database. Grafana can be added on top of this, to visualize the data and create dashboards for easier monitoring.

I would personally try to avoid having a state for a backup application, so the metrics should be limited to information available since last startup. The metrics I would be interested in: sum of backups, percentage of successful backups, how long were the containers stopped, how long it took to complete the backup.

@m90
Copy link
Member Author

m90 commented Nov 1, 2023

I looked into this in https://github.com/offen/docker-volume-backup/tree/serve-metrics once. busybox comes with a simple enough HTTP server that can run if requested and serve a file containing the Prometheus-formatted metrics since last startup.

All it would need is some logic that serializes the already available metrics (plus maybe some others) into the correct format and writes them to a file.

This can be connected to #268, which would also require the application to take control and be the entrypoint of the containers.

That'd also be an option in case busybox's httpd has some limitations I don't know of yet

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

3 participants