cx-slos
Compare original and translation side by side
🇺🇸
Original
English🇨🇳
Translation
ChineseSLO Management Skill
SLO管理技能
An SLO (Service Level Objective) defines a reliability target for a service —
e.g. "99.9% of requests succeed over 28 days". Use this skill to inspect SLO
definitions, judge whether they are healthy, and manage their lifecycle.
SLO(服务水平目标)为服务定义了可靠性目标——例如“28天内99.9%的请求成功”。使用此技能可查看SLO定义、判断其是否正常,并管理其生命周期。
CLI Commands
CLI命令
| Command | Purpose |
|---|---|
| List all SLO definitions |
| Get a single SLO by ID |
| Create an SLO from a JSON definition [requires |
| Replace an SLO definition from JSON [requires |
| Delete an SLO [requires |
- All commands support for structured output and
-o json(repeatable) for multi-profile fan-out.-p <profile> - /
createread fromupdate, or--from-file <path>for stdin (the default).- - ,
create, andupdateare write operations and requiredeletein non-interactive / agent mode.--yes
| 命令 | 用途 |
|---|---|
| 列出所有SLO定义 |
| 通过ID获取单个SLO |
| 从JSON定义创建SLO [需要 |
| 从JSON替换SLO定义 [需要 |
| 删除SLO [需要 |
- 所有命令支持以输出结构化数据,支持
-o json(可重复使用)实现多配置文件扩展。-p <profile> - /
create从update读取数据,或使用--from-file <path>从标准输入读取(默认方式)。- - 、
create和update为写入操作,在非交互/Agent模式下需要delete参数。--yes
SLO Definition
SLO定义
The fields surfaced on every SLO:
| Field | Meaning |
|---|---|
| Human-readable SLO name |
| Optional description |
| The objective, e.g. |
| |
| Rolling window, e.g. |
| The pillar the SLO is computed from, e.g. |
每个SLO包含以下字段:
| 字段 | 含义 |
|---|---|
| 便于人类阅读的SLO名称 |
| 可选描述信息 |
| 目标值,例如 |
| |
| 滚动时间窗口,例如 |
| 计算SLO的支柱类型,例如 |
Monitoring SLO Health
监控SLO健康状态
bash
undefinedbash
undefinedAll SLOs with their target and window
查看所有SLO的目标值和时间窗口
cx slos list -o json | jq '[.[] | {name, targetThresholdPercentage, sloType, sloTimeFrame}]'
cx slos list -o json | jq '[.[] | {name, targetThresholdPercentage, sloType, sloTimeFrame}]'
Inspect a single SLO in full
查看单个SLO的完整信息
cx slos get <slo-id> -o json
Compare the live attainment against `targetThresholdPercentage` to judge whether
the SLO is healthy or burning error budget. A **request-based** SLO measures the
fraction of good events; a **window-based** SLO measures the fraction of good time
windows. After triage, pivot to the `cx-telemetry-querying` skill to find the root
cause of a breach in logs, spans, or metrics.cx slos get <slo-id> -o json
将实时达标率与`targetThresholdPercentage`对比,判断SLO是否正常或是否在消耗错误预算。**基于请求的SLO**衡量正常事件的占比;**基于时间窗口的SLO**衡量正常时间窗口的占比。完成分类后,可切换至`cx-telemetry-querying`技能,在日志、追踪和指标中查找违规的根本原因。Creating and Updating SLOs
创建和更新SLO
The safest way to author an SLO is to round-trip an existing one — template from the
exact field shape that returns rather than hand-writing JSON:
getbash
undefined编写SLO定义最安全的方式是复用现有SLO——以命令返回的精确字段结构为模板,而非手动编写JSON:
getbash
undefinedTemplate from an existing SLO, edit, then create
从现有SLO生成模板,编辑后创建新SLO
cx slos get <existing-slo-id> -o json > slo.json
cx slos get <existing-slo-id> -o json > slo.json
Edit slo.json: change name, targetThresholdPercentage, sloType, sloTimeFrame, etc.
编辑slo.json:修改名称、targetThresholdPercentage、sloType、sloTimeFrame等字段
cx slos create --from-file slo.json --yes
cx slos create --from-file slo.json --yes
Replace an existing definition
替换现有SLO定义
cx slos update --from-file slo.json --yes
`update` and `delete` report the alert IDs they affect (`effectedSloAlertIds`), so
review that list — changing or removing an SLO can disable the alerts attached to
it.cx slos update --from-file slo.json --yes
`update`和`delete`会报告受影响的告警ID(`effectedSloAlertIds`),请查看该列表——修改或删除SLO可能会禁用与其关联的告警。Key Principles
核心原则
- Check attainment vs. target, not just existence — an SLO at 99.91% against a 99.9% target has almost no error budget left and needs attention before it breaches.
- Round-trip definitions — template create/update payloads from rather than hand-writing JSON, to keep the exact field shape the API expects.
cx slos get - /
create/updateneeddeletein agent / non-interactive mode.--yes - Watch affected alerts — /
updatereturndelete; deleting an SLO can silence its alerts.effectedSloAlertIds - Multi-profile fan-out with (repeatable) to compare SLOs across environments.
-p <profile>
- 对比达标率与目标值,而非仅检查存在性——目标值为99.9%的SLO若达标率为99.91%,则剩余错误预算已所剩无几,需在违规前引起重视。
- 复用定义模板——以的输出为模板创建/更新负载,而非手动编写JSON,确保字段结构符合API要求。
cx slos get - 在Agent/非交互模式下,/
create/update需要delete参数。--yes - 关注受影响的告警——/
update会返回delete;删除SLO可能会静默其关联的告警。effectedSloAlertIds - 使用(可重复使用)实现多配置文件扩展,跨环境对比SLO。
-p <profile>
Related Skills
相关技能
- — the alert definitions that fire when an SLO's error budget burns.
cx-alerts - — investigate the logs, spans, and metrics behind an SLO breach.
cx-telemetry-querying - — triage the cases that group the alert events raised against a service.
cx-cases
- ——当SLO错误预算耗尽时触发的告警定义。
cx-alerts - ——调查SLO违规背后的日志、追踪和指标。
cx-telemetry-querying - ——分类处理针对服务触发的告警事件所关联的工单。
cx-cases