-
Notifications
You must be signed in to change notification settings - Fork 145
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Prometheus metric for repository's last update
A new gauge metric `rest_server_repo_last_update_timestamp` was added to monitor each repository's last write access. This allows a basic monitoring for each repository's freshness. In order to have this metric available at startup, a basic preloading for Prometheus metrics has been implemented. This operates by scanning the file system for restic repositories and using their last modified time. Subsequently, each write access updates the last update time. If scanning each repository takes too long, it can be disabled through the `--prometheus-no-preload` flag. This might be related to the feature request in #176.
- Loading branch information
Showing
6 changed files
with
194 additions
and
40 deletions.
There are no files selected for viewing
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
Enhancement: Prometheus metric for repository's last update | ||
|
||
A new gauge metric `rest_server_repo_last_update_timestamp` was added to | ||
monitor each repository's last write access. This allows a basic | ||
monitoring for each repository's freshness. | ||
|
||
This metric can be configured as an alerting rule. For example, to be | ||
notified if some repository is older than two days: | ||
> time() - rest_server_repo_last_update_timestamp >= 172800 | ||
|
||
In order to have this metric available at startup, a basic preloading for | ||
Prometheus metrics has been implemented. This operates by scanning the file | ||
system for restic repositories and using their last modified time. | ||
Subsequently, each write access updates the last update time. | ||
|
||
If scanning each repository takes too long, it can be disabled through the | ||
`--prometheus-no-preload` flag. |
This file contains 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
This file contains 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
This file contains 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
This file contains 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