SLOs, Error Budgets, and Burn Rate Alerts
The idea in one sentence
Section titled “The idea in one sentence”A Datadog SLO turns a target like “99.9% good over 30 days” into a trackable error budget, and Datadog gives you two different kinds of SLO alert because “how much budget is gone” and “how fast it’s going” are two different problems.
Three ways to define an SLO
Section titled “Three ways to define an SLO”Metric-based — a ratio of two metric queries, good events over total events:
{ "name": "Checkout API availability", "type": "metric", "query": { "numerator": "sum:trace.http.request.hits{service:checkout-api,!http.status_code:5*}.as_count()", "denominator": "sum:trace.http.request.hits{service:checkout-api}.as_count()" }}Monitor-based — built from the uptime history of one or more existing monitors. The SLO’s “good” time is however much of the window those monitors spent not triggered:
{ "name": "Checkout API monitor-based SLO", "type": "monitor", "monitor_ids": [111111, 222222]}Time Slice — evaluates a query per fixed time slice across the window, for example “was p99 latency under 300ms in each 5-minute slice”:
{ "name": "Checkout API p99 latency SLO", "type": "time_slice", "sli_specification": { "time_slice": { "query": { "formula": "query1", "queries": ["p99:trace.http.request.duration{service:checkout-api}"] }, "comparator": "<", "threshold": 300, "query_interval_seconds": 300 } }}The error budget
Section titled “The error budget”A target like 99.9% over a 30-day window implies an allowed amount of “bad” time or events — that allowance is the error budget.
Target: 99.9% over 30d30d = 43200 minutesAllowed bad time (error budget) = 0.1% x 43200 = 43.2 minutesEvery bad event or minute of bad time consumes part of that 43.2-minute budget. Once the budget hits 0%, the window has already fallen below its 99.9% target.
Error budget alerts vs. burn rate alerts
Section titled “Error budget alerts vs. burn rate alerts”This is the distinction that matters most in this lesson, and Datadog gives you two separate SLO alert types for it.
Error budget alert — threshold-based on the cumulative percentage of the budget consumed so far in the window. For example, alert once 75% of the budget is gone, and optionally warn earlier at 50%:
{ "type": "slo alert", "query": "error_budget(\"<slo_id>\").over(\"30d\") > 75", "message": "@slack-checkout-oncall 75% of the 30d error budget for checkout-api is already consumed."}Burn rate alert — notifies when the rate of error-budget consumption exceeds a threshold and stays sustained over a period:
{ "type": "slo alert", "query": "burn_rate(\"<slo_id>\").over(\"1h\").long_window(\"6h\") > 10", "message": "@pagerduty-checkout-critical Burn rate is 10x normal - at this rate the entire 30d budget is gone in about 3 days."}The two solve different problems. An error budget alert tells you “we’re running out” — it’s about the total consumed so far, useful for deciding whether it’s safe to ship a risky change this week. A burn rate alert tells you “we’re running out fast, right now” — it’s about velocity, not total. A sustained fast burn can exhaust an entire 30-day budget in hours, and a burn rate alert catches that within the first hour, well before the cumulative-consumption threshold that an error budget alert watches would ever cross.
flowchart LR
SLO[SLO target 99.9% over 30d] --> Budget[Error budget]
Budget --> EBA{Error budget alert: percent consumed above threshold}
Budget --> BRA{Burn rate alert: consumption rate above threshold, sustained}
EBA -->|e.g. 75 percent consumed| Notify1[Notify: budget running out]
BRA -->|e.g. 10x burn rate for 1h| Notify2[Notify: fast incident right now]