https://github.com/codesome/prometheus-slo
Generate Prometheus rules for your SLOs
https://github.com/codesome/prometheus-slo
prometheus slo
Last synced: 4 months ago
JSON representation
Generate Prometheus rules for your SLOs
- Host: GitHub
- URL: https://github.com/codesome/prometheus-slo
- Owner: codesome
- Created: 2021-06-19T10:28:10.000Z (over 3 years ago)
- Default Branch: main
- Last Pushed: 2021-06-19T18:42:25.000Z (over 3 years ago)
- Last Synced: 2024-08-04T08:04:17.746Z (7 months ago)
- Topics: prometheus, slo
- Language: Go
- Homepage:
- Size: 7.81 KB
- Stars: 16
- Watchers: 2
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# prometheus-slo
Generates Prometheus rules for alerting on SLOs. Based on https://developers.soundcloud.com/blog/alerting-on-slos.
## Usage
### Build and Run
```
$ go build -o prometheus-slo *.go
$ ./prometheus-slo # Takes prometheus-slo.yaml as the default config file
2021/06/19 18:18:01 Generating cortex.yaml
2021/06/19 18:18:01 Generating example.yaml
$ ./prometheus-slo --config= # For config at other paths
```### Config file format
```yaml
slo_files:
:
- service: # Service name
slo_name: # SLO name
alertname: # Name of the SLO alert
alert_summary: # Summary of this alert
# PromQL query giving the count of requests *within SLO*.
# Put $__range for the range in the range selector.
success_query:
# PromQL query giving the total count of requests.
# Put $__range for the range in the range selector.
total_query:
threshold: # Quantile values in terms of %, example: 99.9, 99.95```
Look at [`prometheus-slo.yaml`](./prometheus-slo.yaml) for an example of the config.