Skip to content
/ slo-cue Public

Generate Prometheus alerting & recording rules for SLOs using CUE.

License

Notifications You must be signed in to change notification settings

cbrgm/slo-cue

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

10 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

SLO CUE

Generate Prometheus alerting & recording rules for SLOs with CUE.

Highly experimental!

Usage

First, a service must be defined with associated SLOs.

import (
	"github.com/cbrgm/slo-cue/schema"
)

services: schema.#ServiceDefinition

services: "foo_service": [
	{
		name:        "read"
		errorsQuery: "sum(rate(promhttp_metric_handler_requests_total{namespace='default',job='fooapp',code=~'5..'}[$__range]))"
		totalQuery:  "sum(rate(promhttp_metric_handler_requests_total{namespace='default',job='fooapp'}[$__range]))"
		threshold:   0.999
	}
]

This service definition must be saved in the tools folder (for example as foo_service.cue).

Dump the Prometheus Alerting & Recording Rules as JSON.

cd tools && cue dumpjson

or as yaml

cd tools && cue dump

Acknowledgements

This project was inspired by

Literature:

Contributing & License

Feel free to submit changes! See the Contributing Guide. This project is open-source and is developed under the terms of the Apache 2.0 License.

About

Generate Prometheus alerting & recording rules for SLOs using CUE.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published