feat(metrics): serve /metrics endpoint with prometheus-save-to-file - #667
Open
alex-ganin wants to merge 3 commits into
Open
feat(metrics): serve /metrics endpoint with prometheus-save-to-file#667alex-ganin wants to merge 3 commits into
alex-ganin wants to merge 3 commits into
Conversation
Adds an experimental HTTP endpoint that exposes a profile's
prometheus-save-to-file together with the Go runtime metrics on /metrics,
so a sidecar Prometheus can scrape the last backup status from either the
schedule command or a stand-alone sidecar.
Two integration points, both opt-in via the hidden --metrics-port flag
(or RESTICPROFILE_METRICS_PORT):
* resticprofile --metrics-port <port> schedule --all
schedules cron jobs as usual, then blocks on SIGINT/SIGTERM
serving /metrics for every profile and group. Textfile paths are
de-duplicated across profiles that share one.
* resticprofile --metrics-port <port> <profile> serve-metrics
long-running single-profile sidecar.
Response contract:
* 200 OK runtime metrics + textfile body
* 503 Service textfile not yet created (first backup has not run).
Unavailable Prometheus treats this as up == 0 instead of a 404
every scrape.
* 500 Internal other I/O errors.
The endpoint binds on 0.0.0.0:<port> for network_mode: host containers.
The serve command no longer mounts a companion metrics server; the two
endpoints above cover the documented use cases without coupling the
metrics feature to the experimental client/server mode.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Adds an experimental HTTP endpoint that exposes a profile's prometheus-save-to-file together with the Go runtime metrics on /metrics, so a sidecar Prometheus can scrape the last backup status from either the schedule command or a stand-alone sidecar.
Two integration points, both opt-in via the hidden --metrics-port flag (or RESTICPROFILE_METRICS_PORT):
resticprofile --metrics-port schedule --all schedules cron jobs as usual, then blocks on SIGINT/SIGTERM serving /metrics for every profile and group. Textfile paths are de-duplicated across profiles that share one.
resticprofile --metrics-port serve-metrics long-running single-profile sidecar.
Response contract:
Unavailable Prometheus treats this as up == 0 instead of a 404
every scrape.
The endpoint binds on 0.0.0.0: for network_mode: host containers.
The serve command no longer mounts a companion metrics server; the two endpoints above cover the documented use cases without coupling the metrics feature to the experimental client/server mode.