{"id":13638891,"url":"https://github.com/cbrgm/slo-cue","last_synced_at":"2025-04-30T04:51:05.535Z","repository":{"id":46953802,"uuid":"406152670","full_name":"cbrgm/slo-cue","owner":"cbrgm","description":"Generate Prometheus alerting \u0026 recording rules for SLOs using CUE.","archived":false,"fork":false,"pushed_at":"2021-09-20T17:08:11.000Z","size":46,"stargazers_count":7,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-04-25T00:54:33.219Z","etag":null,"topics":["cue","prometheus","slo"],"latest_commit_sha":null,"homepage":"","language":"CUE","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/cbrgm.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2021-09-13T22:54:28.000Z","updated_at":"2024-06-24T22:26:32.000Z","dependencies_parsed_at":"2022-08-30T10:30:58.739Z","dependency_job_id":null,"html_url":"https://github.com/cbrgm/slo-cue","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cbrgm%2Fslo-cue","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cbrgm%2Fslo-cue/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cbrgm%2Fslo-cue/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cbrgm%2Fslo-cue/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/cbrgm","download_url":"https://codeload.github.com/cbrgm/slo-cue/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":251644827,"owners_count":21620630,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["cue","prometheus","slo"],"created_at":"2024-08-02T01:00:55.099Z","updated_at":"2025-04-30T04:51:05.510Z","avatar_url":"https://github.com/cbrgm.png","language":"CUE","funding_links":[],"categories":["Projects"],"sub_categories":[],"readme":"# SLO CUE\n\nGenerate Prometheus alerting \u0026 recording rules for SLOs with CUE.\n\n__Highly experimental!__\n\n## Usage\n\nFirst, a service must be defined with associated SLOs.\n\n```cue\nimport (\n\t\"github.com/cbrgm/slo-cue/schema\"\n)\n\nservices: schema.#ServiceDefinition\n\nservices: \"foo_service\": [\n\t{\n\t\tname:        \"read\"\n\t\terrorsQuery: \"sum(rate(promhttp_metric_handler_requests_total{namespace='default',job='fooapp',code=~'5..'}[$__range]))\"\n\t\ttotalQuery:  \"sum(rate(promhttp_metric_handler_requests_total{namespace='default',job='fooapp'}[$__range]))\"\n\t\tthreshold:   0.999\n\t}\n]\n```\n\n\nThis service definition must be saved in the `tools` folder (for example as `foo_service.cue`). \n\nDump the [Prometheus](https://prometheus.io) Alerting \u0026 Recording Rules as JSON.\n\n```\ncd tools \u0026\u0026 cue dumpjson\n```\n\nor as yaml\n\n```\ncd tools \u0026\u0026 cue dump\n```\n\n## Acknowledgements\n\nThis project was inspired by\n\n* [metalmatze/slo-libsonnet](https://github.com/metalmatze/slo-libsonnet) by [@metalmatze](https://github.com/metalmatze)\n* [https://github.com/codesome/prometheus-slo](https://github.com/codesome/prometheus-slo) by [@codesome](https://github.com/codesome)\n\nLiterature:\n\n* [Implementing Service Level Objectives](https://www.oreilly.com/library/view/implementing-service-level/9781492076803/); Alex Hidalgo; O'Reilly Media, Inc., 2020; ISBN: 9781492076810\n* [Google SRE: Alerting on SLOs](https://sre.google/workbook/alerting-on-slos/); Steven Thurgood et al.\n\n## Contributing \u0026 License\n\nFeel free to submit changes! See the [Contributing Guide](https://github.com/cbrgm/contributing/blob/master/CONTRIBUTING.md). This project is open-source and is developed under the terms of the [Apache 2.0 License](https://github.com/cbrgm/slo-cue/blob/master/LICENSE).\n\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcbrgm%2Fslo-cue","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcbrgm%2Fslo-cue","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcbrgm%2Fslo-cue/lists"}