https://github.com/closeio/prometheus-health-checker
https://github.com/closeio/prometheus-health-checker
Last synced: 10 months ago
JSON representation
- Host: GitHub
- URL: https://github.com/closeio/prometheus-health-checker
- Owner: closeio
- Created: 2021-08-10T21:12:18.000Z (almost 5 years ago)
- Default Branch: master
- Last Pushed: 2021-08-11T14:59:47.000Z (almost 5 years ago)
- Last Synced: 2025-09-07T06:36:34.448Z (10 months ago)
- Language: Rust
- Size: 9.77 KB
- Stars: 1
- Watchers: 21
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# prometheus-health-checker
A small health check adapter for retrieving and interpreting metrics from prometheus exporter in a process,
and communicating if the process is seen as healthy or not with a process exit code.
Intended to use with kubernetes or docker-compose.
# Features
- Check for "up" metrics, where expected value is 1.0 or above
- Check for "fresh" metrics, where expected value is close to current unix time, but not too far in the past.
- Check multiple metrics at once
- Fast
- Sensible defaults
- When a check fails, it outputs to stderr what exactly failed before exiting with status code 1, eliminating guesswork. Just look at your logs.
- Handles and reports connection failures correctly
- When everything looks as expected, it silently exits with status code 0
# Example
`prom_health_check --check-up cio_service_state --check-fresh last_iteration_time --fresh-for 300`
# Build
`cargo build --release` will output the binary to `target/release/prom_health_check`
# Usage
(run with --help) to get the same
```
Prometheus exporter health check
USAGE:
prom_health_check [OPTIONS]
FLAGS:
-h, --help Prints help information
-V, --version Prints version information
OPTIONS:
--check-fresh ... Checks if this metric is "fresh", not too far from current unix time in
seconds.
--check-up ... Checks if this metric is "up", 1.0 or greater
--fresh-for For how many seconds a metric is considered fresh [default: 300]
--url URL of prometheus exporter [default: http://localhost:8091]
```