An open API service indexing awesome lists of open source software.

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

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.