需自行准备符合规范的 SLO 规格 YAML 文件作为输入;SLI 插件需参考独立仓库 slok/sloth-common-sli-plugins;Kubernetes 控制器模式需额外部署 CRD 与 operator

sloth
slokApache-2.0活跃维护从 SLO 定义自动生成 Prometheus 告警规则和记录规则,省去手写 PromQL 的麻烦,适合在 Kubernetes 上做服务等级目标监控。
🦥 Easy and simple Prometheus SLO (service level objectives) generator
sloth generate -i ./examples/getting-started.ymlREADME 未说明
用一份简单 SLO 规格自动生成 Prometheus SLO 指标与多窗口多燃烧率告警
从 SLO 定义自动生成 Prometheus 告警规则和记录规则,省去手写 PromQL 的麻烦,适合在 Kubernetes 上做服务等级目标监控。
核心能力
- 基于 Google SLO 与多窗口多燃烧率告警框架生成规则
- 自动生成不同时间窗口的 Prometheus SLI recording rules
- 自动生成 SLO 元数据规则与 page、warning 告警规则
- 提供 validate 命令校验 SLO 规格,适配 GitOps 与 CI
- 支持 Kubernetes Prometheus-operator、CRD 控制器与 OpenSLO
容易踩的坑
- sloth-helm-chart-0.16.0pre-release2026-04-04 · 2026-04-04 08:53 UTC
查看更新说明
Base chart for Sloth.
- v0.16.0最新正式版2026-04-04 · 2026-04-04 08:10 UTC
v0.16.0 - 2026-04-04
Check the release notes in discussions.
Added
- K8s transformer plugins to be able to customize the k8s resulting objects without depending on current Prometheys operator Rule CR.
sloth.dev/k8stransform/prom-operator-prometheus-rule/v1K8s transformer plugin.- Users can now create multiple K8s objects as the output of the SLO generated rules.
- Sloth lib support for K8s transformer plugins using
WriteResultAsK8sObjects. - New
servercommand that serves the new UI. - UI: Service listing and searching.
- UI: SLO listing, searching and filtered by service.
- UI: SLO details with stats, alerts state, SLI chart and budged burn in period chart.
- UI: Support SLO grouped by labels.
- UI: Redirect unmarshaled ID of grouped SLO labels to proper SLO ID.
- UI: Support service list sort by name and alert status.
- UI: Support alert firing, burning over budget and budget consumed in period SLO filtering on SLO listing.
- Update to Kubernetes v1.35.
validatecommand will check for SLO duplicates (disable with--ignore-slo-duplicates).
Changed
- Sloth now uses a dynamic
unstructuredplugin (sloth.dev/k8stransform/prom-operator-prometheus-rule/v1) to create and manage the prometheus operator Rule K8s CRs. - BREAKING: Plugin loader will ignore directories starting with
...
- sloth-helm-chart-0.15.0pre-release2025-10-31 · 2025-10-31 16:28 UTC
查看更新说明
Base chart for Sloth.
- v0.15.02025-10-31 · 2025-10-31 08:14 UTC
查看更新说明
Check out the announcement
v0.15.0 - 2025-10-31
Added
- Sloth SLO generation can be used as a Go library in
github.com/slok/sloth/pkg/lib. - Sloth lib
PrometheusSLOGeneratorwithGenerateFromSlothV1to generate SLOs based on Sloth v1 spec. - Sloth lib
PrometheusSLOGeneratorwithGenerateFromK8sV1to generate SLOs based on Kubernetes Sloth v1 spec. - Sloth lib
PrometheusSLOGeneratorwithGenerateFromOpenSLOV1Alphato generate SLOs based on OpenSLO v1Alpha spec. - Sloth lib
PrometheusSLOGeneratorwithGenerateFromRawto generate SLOs based on any raw string spec. - Sloth lib
WriteResultAsPrometheusStdhelper method to write generated SLO results into standard Prometheus rules YAML. - Sloth lib
WriteResultAsK8sPrometheusOperatorhelper method to write generated SLO results into Prometheus operator rules YAML. - The resulting SLO Prometheus rule group name can be customized by SLO plugins.
- SLO plugins have the ability to add extra Prometheus Rule groups.
Changed
- The CLI commands
generateandvalidateuse the public Sloth Go library.
- Sloth SLO generation can be used as a Go library in
- v0.14.02025-10-14 · 2025-10-14 18:26 UTC
查看更新说明
Check the announcement here
v0.14.0
Highlights
Added
- Add contrib plugin directory and CODEOWNERS policies.
- Contrib plugin:
/internal/plugin/slo/contrib/info_labels_v1/. - Allow
github.com/VictoriaMetrics/metricsqlmodule in SLO plugins. - Contrib plugin:
sloth.dev/contrib/validate_victoria_metrics/v1. - Contrib plugin:
sloth.dev/contrib/rule_intervals/v1. - Contrib plugin:
sloth.dev/contrib/error_budget_exhausted_alert/v1. - Contrib plugin:
sloth.dev/contrib/denominator_corrected_rules/v1. - Add
--slo-pluginsand-sflag (validate) to be able to declare SLO plugins at cmd level, these plugins will be applied to all SLOs. - Add
--disable-default-slo-pluginsflag (validate) to be able to disable default Sloth SLO plugins.
Changed
- Update chat git sync to v4.5.0
Detailed and Autogenerated
What's Changed
- Release Helm chart for Sloth v0.13.0 by @slok in https://github.com/slok/sloth/pull/665
- Add info_labels_v1 contrib SLO plugin by @slok in https://github.com/slok/sloth/pull/667
- Add Victoria metrics SLO validator plugin by @slok in https://github.com/slok/sloth/pull/668
- Simplify victoria metrics validator SLO plugin by @slok in https://github.com/slok/sloth/pull/669
- Increase integration tests in k8s eventual consistency waits by @slok in https://github.com/slok/sloth/pull/672
- build(deps): bump github.com/prometheus/prometheus from 0.305.0 to 0.306.0 by @dependabot[bot] in https://github.com/slok/sloth/pull/673
- Add rule intervals SLO plugin by @slok in https://github.com/slok/sloth/pull/671
- feat: error budget exhausted plugin by @wbollock in https://github.com/slok/sloth/pull/670
- Port denominator corrected feature as SLO plugin by @slok in https://github.com/slok/sloth/pull/674
- Relax stale issues by @slok in https://github.com/slok/sloth/pull/676
- Update deps by @slok in https://github.com/slok/sloth/pull/677
- Improve conventions by @slok in https://github.com/slok/sloth/pull/679
- Add optimized rules to denominator corrected plugin by @slok in https://github.com/slok/sloth/pull/681
- chore: tiny markdown heading fix by @wbollock in https://github.com/slok/sloth/pull/682
- Update deps by @slok in https://github.com/slok/sloth/pull/688
- Add app level SLO plugins support on validate cmd by @slok in https://github.com/slok/sloth/pull/689
- build(deps): bump github.com/prometheus-operator/prometheus-operator/pkg/client from 0.86.0 to 0.86.1 by @dependabot[bot] in https://github.com/slok/sloth/pull/691
- Bump v0.14.0 by @slok in https://github.com/slok/sloth/pull/692
Full Changelog: https://github.com/slok/sloth/compare/v0.13.0...v0.14.0
用户点评
登录用户的真实使用记录,可按版本和硬件筛选还没有人点评。第一个说出真实体验的人最有价值。
Sloth
Project status
Sloth is actively maintained and in continuous development.
We’re currently working on internal improvements to make Sloth even more extensible and adaptable to real-world use cases. While Sloth already supports custom SLI plugins, upcoming changes will bring more flexibility to how SLOs are generated, making it easier to adapt Sloth to your custom needs. Stay tuned for updates!
Introduction
Meet the easiest way to generate SLOs for Prometheus.
Sloth generates understandable, uniform and reliable Prometheus SLOs for any kind of service. Using a simple SLO spec that results in multiple metrics and multi window multi burn alerts.
Features
- Simple, maintainable and understandable SLO spec.
- Reliable SLO metrics and alerts.
- Based on Google SLO implementation and multi window multi burn alerts framework.
- Autogenerates Prometheus SLI recording rules in different time windows.
- Autogenerates Prometheus SLO metadata rules.
- Autogenerates Prometheus SLO multi window multi burn alert rules (Page and warning).
- SLO spec validation (including
validatecommand for Gitops and CI). - Customization of labels, disabling different type of alerts...
- A single way (uniform) of creating SLOs across all different services and teams.
- Automatic Grafana dashboard to see all your SLOs state.
- Single binary and easy to use CLI.
- Kubernetes (Prometheus-operator) support.
- Kubernetes Controller/operator mode with CRDs.
- Support different SLI types.
- Support for SLI plugins
- A library with common SLI plugins.
- OpenSLO support.
- Safe SLO period windows for 30 and 28 days by default.
- Customizable SLO period windows for advanced use cases.

Getting started
Release the Sloth!
sloth generate -i ./examples/getting-started.yml
version: "prometheus/v1"
service: "myservice"
labels:
owner: "myteam"
repo: "myorg/myservice"
tier: "2"
slos:
# We allow failing (5xx and 429) 1 request every 1000 requests (99.9%).
- name: "requests-availability"
objective: 99.9
description: "Common SLO based on availability for HTTP request responses."
labels:
category: availability
sli:
events:
error_query: sum(rate(http_request_duration_seconds_count{job="myservice",code=~"(5..|429)"}[{{.window}}]))
total_query: sum(rate(http_request_duration_seconds_count{job="myservice"}[{{.window}}]))
alerting:
name: "MyServiceHighErrorRate"
labels:
category: "availability"
annotations:
# Overwrite default Sloth SLO alert summmary on ticket and page alerts.
summary: "High error rate on 'myservice' requests responses"
page_alert:
labels:
severity: "pageteam"
routing_key: "myteam"
ticket_alert:
labels:
severity: "slack"
slack_channel: "#alerts-myteam"
This would be the result you would obtain from the above spec example.
Documentation
Check the docs to know more about the usage, examples, and other handy features!
SLI plugins
Looking for common SLI plugins? Check this repository, if you are looking for the sli plugins docs, check this instead.
Development and Contributing
Check CONTRIBUTING.md.