0Pricing
System Observability: Logging, Metrics & Tracing (ELK + OpenTelemetry) · 课时

SLO、SLI 与错误预算

了解如何定义和实施服务级别目标(SLO)与服务级别指标(SLI)。学习如何管理错误预算以开展可靠性工程。

SLO、SLI 与错误预算 是 CoddyKit 上的免费 System Observability: Logging, Metrics & Tracing (ELK + OpenTelemetry) 课时。 这是第 3 节课,共 4 节。 你可以在下方免费阅读本课时的完整内容 — 然后在浏览器中使用内置代码编辑器和全天候 AI 导师进行实践。 这是 System Observability: Logging, Metrics & Tracing (ELK + OpenTelemetry) 学习路径的一部分,你的进度在网页和 CoddyKit 应用中同步。 System Observability: Logging, Metrics & Tracing (ELK + OpenTelemetry) 课程共包含 4 节课。

本课时的部分内容尚未翻译,以英文显示。

Reliability Goals: SLOs & SLIs

Welcome! In this lesson, we'll dive into Service Level Objectives (SLOs), Service Level Indicators (SLIs), and Error Budgets. These are crucial concepts for defining and maintaining the reliability of your services.

Understanding them helps teams communicate expectations, prioritize work, and ensure a consistent user experience.

What are Service Level Indicators (SLIs)?

An SLI, or Service Level Indicator, is a quantitative measure of some aspect of the service you provide. Think of it as a direct measurement of your system's performance or behavior.

SLIs tell you how well your service is doing from a user's perspective. They are the raw data points we use to evaluate reliability.

Common Types of SLIs

Many different metrics can serve as SLIs. Here are some of the most common ones:

  • Latency: The time it takes for a service to respond to a request. (e.g., 99th percentile request latency)
  • Error Rate: The proportion of requests that result in an error. (e.g., HTTP 5xx responses)
  • Availability: The percentage of time a service is operational and reachable.
  • Throughput: The number of requests successfully processed per unit of time.

Choosing Meaningful SLIs

Selecting the right SLIs is key. They should directly reflect what truly matters to your users. For an e-commerce site, for example, the latency of adding an item to a cart is more critical than the latency of an internal admin endpoint.

Focus on user-facing metrics and those that indicate business impact. A few good SLIs are better than many irrelevant ones.

Defining Service Level Objectives (SLOs)

An SLO, or Service Level Objective, is a target value or range for an SLI over a specific period. It's the explicit goal you set for your service's performance.

For example, an SLO might be: "99.9% of requests will have a latency of less than 300ms over a 30-day rolling window."

Crafting Effective SLOs

Good SLOs are:

  • Specific: Clearly state what is being measured.
  • Measurable: Based on quantifiable SLIs.
  • Achievable: Realistic given your resources and system complexity.
  • Relevant: Important to users and the business.
  • Time-bound: Defined for a specific period (e.g., 7 days, 30 days).

SLOs help align teams on what reliability means for their service.

Introducing Error Budgets

An Error Budget is the maximum amount of time a system can fail or be unavailable without violating its SLO. It's essentially 1 minus your SLO.

If your SLO is 99.9% availability, you have a 0.1% error budget. This budget represents the acceptable amount of 'bad' performance or downtime.

Calculating Your Error Budget

Let's calculate an error budget for a common SLO:

  • SLO: 99.9% availability over 30 days.
  • Total time in 30 days: 30 days * 24 hours/day * 60 minutes/hour = 43,200 minutes.
  • Error Budget Percentage: 100% - 99.9% = 0.1%.
  • Error Budget (minutes): 43,200 minutes * 0.001 = 43.2 minutes.

This means your service can be unavailable for up to 43.2 minutes within a 30-day period without violating the SLO.

Managing with Error Budgets

Error budgets are powerful decision-making tools. When your error budget is healthy (plenty of 'bad time' left), teams might prioritize new features or experimental changes.

However, if the error budget is nearly depleted, it signals that reliability work (e.g., bug fixes, stability improvements) must take precedence over new feature development to avoid violating the SLO.

Test Your Knowledge!

Ready to check your understanding of today's concepts?

Recap: SLOs, SLIs, & Error Budgets

Great job! You've learned the core concepts of service reliability engineering:

  • SLIs are the specific, measurable metrics of your service.
  • SLOs are the target goals set for those SLIs.
  • Error Budgets are the acceptable amount of 'unreliability' before an SLO is violated, guiding decisions between features and stability.

These tools are fundamental for building and maintaining highly reliable systems!

常见问题解答

「SLO、SLI 与错误预算」课时是免费的吗?

是的 — 「SLO、SLI 与错误预算」的完整文本可在网页上免费阅读。要进行交互式练习(内置代码编辑器和全天候 AI 导师)并解锁 System Observability: Logging, Metrics & Tracing (ELK + OpenTelemetry) 课程的其余内容,请升级到 CoddyKit PRO。 System Observability: Logging, Metrics & Tracing (ELK + OpenTelemetry) 课程共包含 4 节课。

「SLO、SLI 与错误预算」这节课中我会学到什么?

了解如何定义和实施服务级别目标(SLO)与服务级别指标(SLI)。学习如何管理错误预算以开展可靠性工程。 你通过在浏览器中直接运行的动手代码来练习 System Observability: Logging, Metrics & Tracing (ELK + OpenTelemetry),全天候 AI 导师会在你学习这节课的过程中回答你的问题。

学习 System Observability: Logging, Metrics & Tracing (ELK + OpenTelemetry) 需要有经验吗?

无需任何先前经验。CoddyKit 上的 System Observability: Logging, Metrics & Tracing (ELK + OpenTelemetry) 课程适合初学者到高级学习者,你可以从这里开始或从头开始,按照自己的节奏学习。 这是第 3 节课,共 4 节。

「SLO、SLI 与错误预算」课时需要多长时间?

大多数 CoddyKit 课程大约需要 5–10 分钟。每节课都很精短且互动,所以你能稳步进步,并在网页和应用中从离开的地方继续。

我能在这节 System Observability: Logging, Metrics & Tracing (ELK + OpenTelemetry) 课中编写并运行代码吗?

能。每节 System Observability: Logging, Metrics & Tracing (ELK + OpenTelemetry) 课都包含内置代码编辑器,你可以在浏览器中直接编写并运行真实代码,并获得即时 AI 反馈 — 无需本地设置。

此课程中的所有课时

  1. 关联日志、指标与追踪
  2. 异常检测与人工智能运维
  3. SLO、SLI 与错误预算
  4. RED 与 USE 方法
← 返回 System Observability: Logging, Metrics & Tracing (ELK + OpenTelemetry)