Skip to content
ImagineWorld

Business Intelligence Views From Telemetry

node_idnode-book_mastering-distributed-observability-in-rust_chapter-08-business-intelligence-views-from-telemetry
node_typechapter-node
schema_profileworld.chapter_node.v1
statusactive
entropyhigh
manifoldworld
domainimagineworld.net
authorityinforms
layercorpus
chapter_num8
chapter_titleBusiness Intelligence Views From Telemetry
governed_byCORPUS
constitutional_citationCONSTITUTION
local graph

Chapter 8 — Business Intelligence Views From Telemetry

Section titled “Chapter 8 — Business Intelligence Views From Telemetry”

In Chapter 7, we completed the observability triad by adding structured logs. We watched an engineer trace a mysterious checkout failure down to a database transaction, and finally to a log entry revealing a subtle price-mismatch bug. The system is no longer a black box. Our services emit interconnected traces, HTTP metrics reveal request latency across the cluster, and rich logs provide exactly the context needed to debug complex state issues.

But solving the engineering whodunit is only half the battle. Imagine walking into the Monday morning leadership meeting equipped with those perfectly correlated traces and logs. The VP of Sales looks at your dashboards and asks, “So, we fixed the price mismatch bug. How much revenue did we lose while it was broken? And more importantly, can we guarantee the checkout won’t go down like that again during the Black Friday sale?”

This is exactly why we started instrumenting business metrics back in Chapter 6. While HTTP metrics told us how fast the API was responding, those business metrics started tracking user impact: checkout conversion rates, cart abandonment stages, and actual revenue per order. We built Grafana panels that visualized these KPIs alongside our latency histograms.

But those metrics alone can’t answer the VP’s questions. The gap between capturing business metrics and making business decisions is where Service Level Objectives (SLOs) come into play. SLOs are not a new monitoring tool. They are a decision-making framework that translates between the language of engineering (“p99 latency exceeded 2 seconds for 12 minutes”) and the language of business (“we lost $8,400 in revenue and consumed 28% of our monthly reliability budget”).

What this chapter covers:

  • The language of reliability: defining SLIs, SLOs, and SLAs
  • The business case: mapping latency to revenue and dollar impact
  • Defining clear SLIs (Availability, Latency, Correctness) for the checkout journey
  • Calculating Error Budgets and establishing an error budget policy
  • Building a Business Intelligence dashboard in Grafana
  • Configuring multi-window burn-rate alerting to replace noisy thresholds
  • The complete workflow from SLI violation to incident resolution
  • Minimal new code: two additions — an order.category log attribute on the existing order-creation log entry and a category dimension on a new inventory.stock.level gauge. Everything else leverages telemetry from Chapters 4–7

The Language of Reliability: SLIs, SLOs, and SLAs

Section titled “The Language of Reliability: SLIs, SLOs, and SLAs”

Before we instrument anything, we need a shared vocabulary. Three acronyms dominate reliability engineering conversations, and getting them confused leads to either over-engineering or broken promises. Let’s define each precisely, starting from the measurement and building up to the contract.

Service Level Indicators: What You Measure

Section titled “Service Level Indicators: What You Measure”

A Service Level Indicator (SLI) is a carefully defined quantitative measure of some aspects of the level of service you provide. That’s the definition from Google’s SRE book, and it’s worth reading twice. An SLI is not a dashboard panel or an alert threshold. It is the measurement itself.

Source: Google’s SRE Workbook: https://sre.google/books/

The most useful SLIs share a specific structure: they express the ratio of good events to total events. This produces a clean value between 0% and 100% that everyone, engineers, product managers, and executives, can understand intuitively.

SLI = (good events / total events) × 100%

For OpenTel E-Commerce, consider three candidate SLIs:

Availability SLI: Of all checkout requests received, what proportion completed without a server error?

Checkout Availability = (checkouts without 5xx errors / total checkout requests) × 100%

Latency SLI: Of all checkout requests received, what proportion completed within an acceptable time?

Checkout Latency = (checkouts completing in < 2 seconds / total checkout requests) × 100%

Correctness SLI: Of all completed orders, what proportion had no data integrity errors (price mismatches, double charges, missing items)?

Checkout Correctness = (orders without error.code / total completed orders) × 100%

Each SLI answers a different question about user experience, and each can be computed from the telemetry we already have. We’ll formalize these into PromQL in Section 8.3.

Not every metric is a good SLI. For request-driven services like our e-commerce platform, and both the OtelMart UI and the backend APIs, the recommended SLI types are availability (did the request succeed?), latency (was it fast enough?), and quality (was the response correct and complete?).

A good SLI must satisfy three properties:

User-facing**: It measures what customers actually experience**, not internal plumbing. CPU utilization is not an SLI. Database connection pool usage is not an SLI. These are important operational signals, but they don’t directly answer “Did the user’s request succeed?” A pod can be crash-looping while users are perfectly happy if a load balancer routes around it.

Binary per event**:** Each individual event must be classifiable as either “good” or “bad.” A checkout request that returns HTTP 200 in 1.2 seconds is good (against a 2-second latency SLI). One that returns 200 in 3.4 seconds is bad. This binary classification enables the ratio formula above.

Composable from existing telemetry**:** The best SLIs don’t require new infrastructure. They are built from metrics, logs, and traces you already have. We’ll demonstrate this repeatedly throughout this chapter.

Google recommends choosing five or fewer SLI types per service. More than that dilutes focus and overwhelms teams with alerts. For OpenTel E-Commerce’s checkout journey, three SLIs (availability, latency, correctness) cover the critical dimensions of user experience.

Service Level Objectives: What You Promise (Internally)

Section titled “Service Level Objectives: What You Promise (Internally)”

A Service Level Objective (SLO) sets a target value for an SLI over a defined time window. It answers the question: “How reliable is reliable enough?”

SLO: Checkout Availability SLI ≥ 99.9% over a 30-day rolling window

This means over any 30-day period, at least 99.9% of checkout requests must complete without server errors. The remaining 0.1% is the error budget, the amount of unreliability you’re explicitly accepting.

That last point is crucial and counterintuitive. An SLO of 99.9% is not a ceiling you’re trying to reach. It’s a target you’re trying to stay near. Google’s SRE book is emphatic on this point: 100% is always the wrong reliability target.

The most practical reason: roughly 70% of outages are caused by changes (deployments, configuration updates, infrastructure migrations). An error budget of zero means zero changes: no new features, no bug fixes, no security patches. The system hardens. Beyond that, each additional “nine” of reliability costs roughly 10 times as much as the previous one. Moving from 99.9% to 99.99% means reducing your failure rate by a factor of 10, which typically requires redundant infrastructure, sophisticated failover mechanisms, and engineering effort that could otherwise be devoted to building features.

The SLO is a balance that is reliable enough to keep users happy, yet unreliable enough to ship features.

The difference between SLO targets is best understood as “how much downtime per time period”:

SLO TargetError BudgetAllowed Downtime/MonthAllowed Downtime/Year
99% (two nines)1%7 hours 18 minutes3 days 15 hours
99.9% (three nines)0.1%43 minutes 50 seconds8 hours 46 minutes
99.95%0.05%21 minutes 55 seconds4 hours 23 minutes
99.99% (four nines)0.01%4 minutes 23 seconds52 minutes 36 seconds
99.999% (five nines)0.001%26 seconds5 minutes 15 seconds

Table 8.1 – SLO targets, error budgets, and allowed downtime per month and per year (the “nines table”)

Look at the jump from 99.9% to 99.99%. You go from 43 minutes of error budget per month to 4 minutes. A single bad deployment that takes 5 minutes to roll back exhausts your entire monthly budget at four nines. At three nines, that same deployment consumes only 11.4% of the budget, concerning but manageable.

For OpenTel E-Commerce, a startup or mid-size retailer, 99.9% is an ambitious but realistic target for the checkout flow. Three nines gives the team a 43-minute monthly error budget, enough room to deploy several times a week while maintaining user trust.

Service Level Agreements: What You Promise (Externally, with Consequences)

Section titled “Service Level Agreements: What You Promise (Externally, with Consequences)”

A Service Level Agreement (SLA) wraps SLOs in a business contract with financial consequences for violations. If there’s no explicit consequence (no refund, no credit, no penalty), then it’s an SLO, not an SLA.

Cloud providers like AWS, Azure, and GCP publish SLAs for their infrastructure, but the compensating credits are trivial relative to actual business impact. A 10% credit on a 500/monthhostingbillis500/month hosting bill is 50, but the outage that triggered it may have cost $50,000 in lost sales. This asymmetry is why internal SLOs should always be stricter than external SLAs, giving you a safety margin to detect and fix problems before they become contractual violations.

For OpenTel E-Commerce, we won’t define an external SLA in this chapter. But we will set internal SLOs strict enough that any breach is investigated long before customers or business partners notice.

A note on where these concepts come from**:** The SLI/SLO/SLA framework and error budgets were popularized by Google’s SRE books (2016, 2018). This chapter applies those ideas to OpenTelemetry-based Rust systems and business telemetry.

How Others Define Their SLIs: Real-World Examples

Section titled “How Others Define Their SLIs: Real-World Examples”

Theory is useful but seeing how production systems define SLIs makes the concepts concrete.

Slack publishes a 99.99% monthly uptime SLA, roughly 4 minutes of allowed downtime per month. Their SLI is not server uptime. They measure availability by monitoring key user workflows. If any critical interaction (sending a message, loading a channel, or receiving a notification) fails to meet a success threshold, those minutes count as downtime.

Netflix measures its primary SLI as the proportion of successful stream starts divided by total stream start attempts, capturing the exact moment a customer cares about most. A revealing example: when a device plays HD instead of 4K, itself reports no error. Only by correlating device capabilities, available formats, and actual playback quality can Netflix detect the degradation. Infrastructure monitoring sees green dashboards while users get a subtly inferior experience.

Home Depot created the VALET framework (Volume, Availability, Latency, Errors, Tickets) as a standardized SLO taxonomy across their platform, growing from about 50 services to over 800 services collecting VALET data.

Google’s SRE Workbook provides an example SLO document for a game service API with seven SLOs across three service types, all measured over a four-week rolling window. With 1,000,000 API requests in four weeks, a 97% availability SLO yields an error budget of 30,000 allowable errors, a concrete, trackable number.

These examples share a pattern: the SLI always measures user experience, not infrastructure health. Slack measures message delivery, not server CPU. Netflix measures stream starts, not pod restarts. This is the lens we’ll apply to OpenTel E-Commerce.

Business Case: Why OpenTel E-Commerce Needs SLOs

Section titled “Business Case: Why OpenTel E-Commerce Needs SLOs”

With the dashboards and logging pipeline from Chapters 6 and 7 live, the next question is: what does latency cost in dollars?

Latency and Revenue: The Connection That Matters

Section titled “Latency and Revenue: The Connection That Matters”

Before we define SLOs, we need to understand why latency matters to the business in dollar terms. This isn’t academic. It is the foundation for attaching cost to SLO violations.

The e-commerce industry has extensive data on the relationship between page speed and conversion. Amazon found that every 100 milliseconds of additional latency costs approximately 1% in sales[^linden]. Google reported that increasing search results page load time by 500 milliseconds led to a 20% drop in traffic and revenue[^mayer]. Walmart’s analysis showed that every 1-second improvement in page load yielded up to a 2% increase in conversion rate[^walmart]. For a broader collection of latency and conversion case studies, WPO Stats https://wpostats.com is a useful aggregator.

For OpenTel E-Commerce, we can quantify this using existing metrics. In Chapter 6, we built the orders.checkout.duration histogram and the checkout.funnel.completed / checkout.funnel.started counters. By correlating checkout latency with conversion rate over time windows, we can establish our own latency-to-revenue relationship:

# Conversion rate per 5-minute window
(
rate(checkout_funnel_completed_total[5m])
/ rate(checkout_funnel_started_total[5m])
) * 100
# Overlaid with p99 checkout latency
histogram_quantile(0.99,
sum(rate(orders_checkout_duration_seconds_bucket[5m])) by (le)
)

When these two curves are overlaid on the same Grafana panel (different Y axes), the relationship becomes visible: as p99 latency rises above 2 seconds, conversion rate drops. This isn’t surprising. Users abandon slow checkouts. But now it’s measurable, and measurable means we can set thresholds.

Chapter 6 already provides the revenue rate:

# Revenue per hour
sum(rate(orders_total_amount_USD_sum[5m])) * 3600

This is the baseline for all cost calculations in this chapter. If OpenTel E-Commerce generates 9,000/hourduringpeakhours,thena1−minutetotalcheckoutoutagecostsroughly9,000/hour during peak hours, then a 1-minute total checkout outage costs roughly 150, a 10-minute partial degradation where half of checkouts fail costs roughly $750, and a 4-hour subtle conversion drop from 82% to 55% can accumulate to thousands in lost revenue.

That last scenario, the silent degradation, is exactly what SLOs are designed to catch. Threshold alerts might not fire because the error rate stays below 5%. But the error budget is burning at 6× the sustainable rate, which burn-rate alerting would detect within minutes.

Now we formalize the SLIs. Each indicator maps directly to metrics defined in previous chapters, with no new instrumentation required beyond two small exceptions noted below.

What it measures: The proportion of checkout requests that complete without a server-side error.

Source telemetry: The http.server.request.duration histogram from Chapter 6 (via axum‑otel‑metrics), filtered to the POST /orders route on the Orders service.

Good event definition: Any checkout request that returns a status code other than 5xx. Note that 4xx responses (bad request, validation errors) are not counted as SLI violations. A customer submitting an invalid order is not a system failure.

PromQL:

# Checkout Availability SLI (instantaneous)
1 - (
sum(rate(http_server_request_duration_seconds_count{
job="orders",
http_route="/orders",
http_request_method="POST",
http_response_status_code=~"5.."
}[5m]))
/
sum(rate(http_server_request_duration_seconds_count{
job="orders",
http_route="/orders",
http_request_method="POST"
}[5m]))
)

This query divides the rate of 5xx responses by the total number of responses, then subtracts from 1 to get the proportion of “good” requests. At 99.9%, this means fewer than 1 in 1,000 checkout requests hit a server error.

What it measures: The proportion of checkout requests that complete within an acceptable time.

Source telemetry: The same http.server.request.duration histogram, filtered to the checkout route.

Good event definition: A checkout request that completes in under 2.5 seconds. We chose this threshold because the default OpenTelemetry histogram bucket boundaries include 0.75, 1.0, 2.5, 5.0 seconds — there is no le="2.0" bucket, so an exact 2-second SLI would have to interpolate between buckets and be inaccurate. The chapter 6 conversion data show that latency above ~2 seconds correlates strongly with abandonment, and 2.5s is the closest bucket boundary that captures that signal cleanly. Real teams should either validate this threshold against their own data or customize the histogram boundaries to include their exact target (see Chapter 6, “Customizing Histogram Buckets”).

PromQL:

# Checkout Latency SLI - proportion of requests under 2.5 seconds
sum(rate(http_server_request_duration_seconds_bucket{
job="orders",
http_route="/orders",
http_request_method="POST",
le="2.5"
}[5m]))
/
sum(rate(http_server_request_duration_seconds_count{
job="orders",
http_route="/orders",
http_request_method="POST"
}[5m]))

The le="2.5" (le means “less than or equal to”) bucket gives us the count of requests completing in 2.5 seconds or less. Dividing by the total count gives the proportion. A latency SLO of 99% means that at most 1 in 100 checkout requests can exceed 2.5 seconds. If you need a tighter SLI at exactly 2.0s, customize the histogram bucket boundaries in code (Chapter 6) so that le="2.0" exists — querying a missing boundary returns no data.

What it measures: The proportion of completed orders that have no data integrity errors.

Source telemetry: Structured logs from Chapter 7, specifically the error.code field on Orders service log entries. This SLI uses LogQL in Loki rather than PromQL.

Good event definition: A completed order with no error.code entry indicating a price mismatch, double charge, or missing item.

This SLI is harder to express as a simple PromQL ratio because correctness errors are captured in logs, rather than counters. Two options:

Option A: Counter-based (recommended). We already have orders_checkout_failures_total{failure_reason="price_mismatch"} from Chapter 7. We can build a correctness ratio from existing counters:

# Correctness SLI - orders without correctness errors vs total attempts
1 - (
sum(rate(orders_checkout_failures_total{failure_reason="price_mismatch"}[5m]))
/
sum(rate(orders_checkout_attempts_total[5m]))
)

The failure_reason label name matches the failure.reason attribute set by the Orders service in Chapter 7 (OpenTelemetry attribute dots are converted to underscores by the Prometheus exporter). Additional correctness failure reasons (e.g., double_charge, missing_item) can be added to the regex once those failure paths are instrumented in later chapters.

Option B: Log-based (for richer analysis). LogQL in Loki can aggregate correctness errors for investigative dashboards:

# Count of correctness errors in Orders service
sum(count_over_time({service_name="orders"} | json | error_code=~"PRICE_MISMATCH" [5m]))

For the SLO alert, we’ll use Option A (counter-based) because Prometheus alerting rules are more mature than Loki alerting. For the investigation dashboard, we’ll include both.

Two small additions make category-level analysis possible, both bounded to a low-cardinality root-category attribute:

order.category log attribute (Orders service). When logging the successful order creation event (the tracing::info! at the end of create_order), add the order’s root category as a structured field. For a single-category order, this is the shared root category name; for an order whose line items span multiple root categories, it is the sentinel "mixed". This keeps cardinality bounded to the small set of root categories, plus mixed and unknown. The field powers LogQL aggregation of revenue by category in Loki for the business dashboard in Section 8.5.

inventory.stock.level gauge with a category dimension (Inventory service). A new observable gauge reports total available stock units, broken down by product root category. The OpenTelemetry async-gauge callback runs synchronously and cannot executeadatabasequeryitself,soabackgroundtaskrefreshesaHashMap< category, units> snapshot every 15 seconds (matching the Prometheus scrape interval), and the callback emits one observation per category. Cardinality is naturally bounded to the small set of root categories (e.g., Electronics, Clothing, Books).

Both additions are lightweight: a single attribute on an existing log entry and a single low-cardinality gauge. See the Chapter 8 companion code for the exact implementation.

With SLIs defined, we set targets (SLOs) and compute the budget for acceptable failures.

Based on the team’s analysis of user expectations, industry benchmarks, and current system performance, the SLO targets for the checkout journey are:

SLISLO TargetWindowRationale
Availability99.9%30-day rollingIndustry standard for mid-tier e-commerce; gives 43 minutes of error budget
Latency (< 2s)99%30-day rolling1% slow checkouts are acceptable; tighter targets require infrastructure investment
Correctness99.99%30-day rollingData integrity errors are far more damaging than slowness; near-zero tolerance

Table 8.2 – SLO targets for the three checkout SLIs with rationale

Why different targets for different SLIs? Because the impact of violations differs. A slow checkout frustrates users. Some will retry, some will leave. But a checkout that charges the wrong price fundamentally damages trust and may have legal implications. The correctness SLI gets four nines; latency gets two.

The error budget is simply 1 ‑ SLO target, expressed as a count of allowable bad events over the window.

Availability error budget:

Budget = (1 - 0.999) × total_requests_in_30_days
= 0.001 × total_requests

If OpenTel E-Commerce processes 100,000 checkout requests per month:

Budget = 0.001 × 100,000 = 100 allowable failed requests per month

Or expressed as time: 0.1% of 30 days = 43.2 minutes where the checkout can be fully unavailable (or longer at partial degradation).

Latency error budget:

Budget = (1 - 0.99) × 100,000 = 1,000 slow requests per month

One percent of checkouts are allowed to exceed 2 seconds. That sounds like a lot, but distributed evenly it’s about 33 slow requests per day, roughly one every 45 minutes. A database connection pool exhaustion event that causes 200 slow requests in 10 minutes consumes 20% of the monthly budget in one incident.

Error budget as a Grafana panel**:**

This is the single most important panel in the business dashboard. It shows budget consumption over time:

# Error budget remaining (Availability) - percentage
1 - (
(
sum(increase(http_server_request_duration_seconds_count{
job="orders",
http_route="/orders",
http_request_method="POST",
http_response_status_code=~"5.."
}[30d]))
)
/
(
0.001 * sum(increase(http_server_request_duration_seconds_count{
job="orders",
http_route="/orders",
http_request_method="POST"
}[30d]))
)
)

When this value is 1.0 (100%), no budget has been consumed. At 0.0 (0%), the budget is exhausted. Color thresholds: green above 60%, amber above 25%, red below 25%. Note that the query returns a 0–1 ratio: configure the Grafana panel with the Percent (0.0–1.0) unit, or multiply the expression by 100 if you prefer the Percent (0–100) unit, but mismatching the two will display 0.99 instead of 99%.

A note on long-range queries**:** Prometheus’s increase() over 30-day windows can produce inaccurate results due to counter resets and staleness handling. In production, teams typically use recording rules that compute hourly error counts and then sum over 30 days. The query above is conceptually correct and works for moderate traffic volumes, but high-traffic production deployments should use the recording-rule approach for accuracy.

The math is straightforward. The cultural impact is profound.

Before error budgets, reliability decisions are driven by instinct, politics, or the negotiating skills of whoever’s in the room. Product managers push for faster deployments, SREs push for more testing, and neither side has data. Every incident triggers the same debate: “Should we slow down?” The answer depends on who argues loudest.

With error budgets, the data answers the question. If 70% of the monthly budget remains and the team wants to ship a risky feature, go ahead. The budget exists to be spent. If only 10% remains and there are two weeks left in the window, slow down, increase testing, and defer non-critical changes.

Google reports that error budgets make product development teams self-policing. Developers become advocates for reliability when the budget is low, not because SRE forced them, but because the data makes the tradeoff visible.

The flip side is equally important. If a service consistently exceeds its SLO by a wide margin, running at 99.999% against a 99.9% target, the team might be over-investing in reliability. That engineering effort could go toward features, tech debt reduction, or cost optimization. Revisit SLOs after each 30-day window: if the budget is consistently untouched, the target may be too loose; if it’s exhausted every cycle, either tighten engineering practices or relax the target. The goal is productive tension, not a target that is trivially met or perpetually violated.

The Error Budget Policy: Teeth for the Framework

Section titled “The Error Budget Policy: Teeth for the Framework”

An error budget without a policy is just a number on a dashboard. The policy defines what happens at different budget levels:

Budget RemainingStatusAction
> 50%HealthyNormal development velocity. Deploy at will.
25 to 50%CautionIncrease code review scrutiny. Run additional integration tests before deployment.
10 to 25%WarningHalt non-critical deployments. Focus engineering effort on reliability improvements.
< 10%CriticalFreeze all changes except P0 bug fixes and security patches. Conduct a reliability review.
ExhaustedExceededAll changes halted until SLI recovers. Post-mortem required.

Table 8.3 – The error budget policy: actions at each budget level

This policy needs cross-functional agreement. Product managers must accept that a budget freeze delays features. Engineering leads must accept that a healthy budget means less gatekeeping. The CTO signs off on, stating that reliability and velocity are managed by data, not hierarchy.

Crucially, the policy includes exceptions. If a company-wide infrastructure outage (e.g., a cloud provider failure or a DNS issue) drains the budget, the checkout team isn’t penalized. The outage is annotated and excluded from the local team’s budget calculation.

Attaching Dollar Amounts to SLO Violations

Section titled “Attaching Dollar Amounts to SLO Violations”

Every SLO violation has a cost. Using the revenue-per-minute baseline from Section 8.2:

Cost of unavailability = revenue_per_minute × duration_minutes × severity_fraction

Where severity_fraction represents the proportion of requests affected. A total outage is 1.0; an error rate that jumps from a 2% baseline to 52% (a 50-percentage-point increase) means roughly half of all requests fail, so severity_fraction ≈ 0.5.

In Grafana, we can annotate each SLO violation event with its estimated dollar impact:

# Revenue per minute (for cost calculation)
sum(rate(orders_total_amount_USD_sum[5m])) * 60

This transforms the on-call conversation. Instead of “we had a 12-minute incident,” the post-mortem says “the 12-minute incident consumed 28% of our monthly error budget and cost approximately $1,800 in lost revenue.” That precision makes engineering investment decisions concrete.

The investigation workflows from Chapter 7 ‘s “Three Pillars Unified” section worked, but they were ad hoc. When the price mismatch caused checkout failures, the team manually queried Grafana, Loki, and Jaeger. This section formalizes that process into a persistent Grafana dashboard that answers business questions at a glance.

The dashboard is organized in three rows, from business impact at the top to technical detail at the bottom:

Row 1: Business Health (what leadership cares about)

PanelTypeData SourceQuery Basis
Revenue Rate ($/hour)StatPrometheusorders_total_amount_USD_sum rate × 3600
Checkout Conversion %GaugePrometheuscheckout_funnel_completed_total / checkout_funnel_started_total
Error Budget RemainingGaugePrometheusBudget consumption formula from 8.4

Table 8.4 – Business intelligence dashboard, Row 1 (Business Health)

Row 2: SLI Status (the reliability contract)

PanelTypeData SourceQuery Basis
Availability SLI (30d)StatPrometheusSLI formula from 8.3
Latency SLI (30d)StatPrometheusProportion of requests < 2s
Correctness SLI (30d)StatPrometheus1 - (correctness errors / total checkout attempts)
Budget Burn RateTime SeriesPrometheusError rate / (1 - SLO target) over time

Table 8.5 – Business intelligence dashboard, Row 2 (SLI Status)

Row 3: Investigation (drill-down for engineers)

PanelTypeData SourceQuery Basis
Checkout Failure Reasons (1h)Pie ChartPrometheusorders_checkout_failures_total by failure_reason label
Latency vs Conversion (5m)Dual-axis Time SeriesPrometheusp99 checkout latency overlaid with conversion rate
Stock Level by CategoryBar GaugePrometheusinventory_stock_level_units by category (new)
Revenue by Category (24h)Bar ChartLokiLogQL aggregation on order_category field (new)
Correctness ErrorsLogsLokiFiltered Orders log lines for price-mismatch / double-charge events

Table 8.6 – Business intelligence dashboard, Row 3 (Investigation)

The revenue panel uses the orders.total.amount histogram from Chapter 6:

# Revenue per hour
sum(rate(orders_total_amount_USD_sum[5m])) * 3600

Configure this as a Stat panel with sparkline enabled. Set units to “Currency > Dollars ()".Addthresholdsbasedonexpectedrevenue:greenabove)". Add thresholds based on expected revenue: green above 5,000/hour, yellow above 2,500/hour,redbelow2,500/hour, red below 2,500/hour. Adjust these thresholds based on actual traffic patterns, as peak hours will differ from to overnight.

The conversion funnel counters from Chapter 6 (checkout.funnel.started, checkout.funnel.completed) provide a rolling conversion rate:

(
rate(checkout_funnel_completed_total[5m])
/ rate(checkout_funnel_started_total[5m])
) * 100

Display as a Gauge panel with thresholds: green above 80%, yellow above 65%, red below 65%. The thresholds reflect the industry range. Healthy e-commerce platforms achieve 70-90% conversion, and anything below 65% indicates a systemic problem.

This is the most important panel on the dashboard. It uses the error budget formula from the section SLOs and Error Budgets to show what percentage of the monthly budget has been consumed so far.

Display as a Gauge panel where 0% consumed (full budget) is green, 75% consumed is amber, and 90%+ consumed is red. The value represents “percentage of budget spent”. When it hits 100%, the SLO has been violated for the 30-day window.

With the revenue rate and error budget panels side by side, we develop a reusable mental model:

If checkout p99 latency increases by X seconds:
→ conversion drops by approximately Y%
→ revenue decreases by $Z per hour
→ error budget burns at W× the sustainable rate
→ budget will be exhausted in N days at this rate

For OpenTel E-Commerce, suppose the data shows:

  • Baseline: p99 = 800ms, conversion = 82%, revenue = $6,000/hour
  • Degraded: p99 = 3.2s, conversion = 58%, revenue = $4,200/hour
  • Cost: $1,800/hour in lost revenue during degradation
  • Budget burn: error rate for latency SLI jumps to ~24% (vs 1% sustainable), burning at 24× rate
  • Time to exhaustion: about 30 hours at this rate

This mental model turns abstract SLO numbers into a concrete business impact that anyone in the organization can understand.

Revenue by Category: Using the New Log Field

Section titled “Revenue by Category: Using the New Log Field”

The order.category log attribute we added in Section 8.3 enables category-level revenue analysis in Loki. This panel answers “which product categories are driving revenue, and are any categories disproportionately affected by issues?”

# Revenue by category (last 24 hours)
sum by (order_category) (
sum_over_time({service_name="orders"} | json | unwrap order_total [24h])
)

Display as a horizontal bar chart. During an incident, this panel reveals whether the impact is uniform across categories or concentrated. The reserve_stock latency issues we identified in Chapter 5 might disproportionately affect high-value categories like Electronics that have the most inventory contention, and that category-level visibility lets us prioritize the fix by revenue impact.

A note on field names Loki’s JSON parser flattens dotted attribute names into underscored labels, so the order.total and order.category fields emitted by the Orders service appear as order_total and order_category in LogQL unwrap and sum by clauses.

The current alerting setup from Chapter 6 uses simple thresholds: “fire an alert if the checkout error rate exceeds 5% for more than 5 minutes.” This approach has three fundamental problems.

Problem 1: Sensitivity mismatch A 5% error rate sustained for 5 minutes sounds alarming, but it consumes only ~0.58% of a monthly error budget at 99.9% SLO (a burn rate of 50× over 5 minutes of a 30-day window). You could ignore it completely and still meet the SLO. But if you lower the threshold to 0.1% to match the SLO, the alert fires on normal variance, and nobody trusts it.

Problem 2: No severity scaling, a 100% outage, and a 0.2% error rate increase both take the same 5 minutes to trigger a threshold alert. But a 100% outage consumes the entire monthly budget in 43 minutes, whereas a 0.2% increase is sustainable indefinitely. The alert treats them identically.

Problem 3: Slow reset, extending the evaluation window to reduce noise (e.g., “error rate > 0.1% over 6 hours”) catches real problems but creates a 6-hour reset time. The alert keeps firing for hours after the problem is fixed, wasting on-call attention.

Burn rate solves all three problems by normalizing the observed error rate against what the SLO allows:

burn_rate = observed_error_rate / (1 - SLO_target)

For a 99.9% availability SLO:

  • Burn rate 1.0: Errors occurring at exactly the sustainable rate. Budget exhausts in exactly 30 days. No action needed.
  • Burn rate 6.0: Errors at 6× the sustainable rate. Budget exhausts in 5 days. Worth investigating during business hours.
  • Burn rate 14.4: Errors at 14.4× the sustainable rate. Budget exhausts in about 2 days (specifically, consumes 2% of the budget in 1 hour). This warrants immediate attention.
  • Burn rate 1000: Total outage. Budget exhausted in 43 minutes. Wake someone up.

Burn rate inherently scales severity. A total outage produces a massive burn rate that triggers immediately. A slight degradation produces a low burn rate that generates a ticket rather than a page.

Google’s SRE Workbook recommends combining burn rate with multiple time windows. Each alert uses two windows: a long window to confirm the error rate has been sustained, and a short window (typically 1/12th of the long window) to ensure a fast reset after resolution. The alert fires only when both windows exceed the threshold.

For the 99.9% Checkout Availability SLO over 30 days:

SeverityBurn RateLong WindowShort WindowBudget Consumed at AlertResponse
Page (critical)14.4×1 hour5 minutes2%Wake someone up
Page (urgent)6×6 hours30 minutes5%Page during business hours
Ticket1×3 days6 hours10%File an engineering ticket

Table 8.7 – Multi-window, multi-burn-rate alert tiers for the 99.9% availability SLO

How to read this table: The “Page (critical)” alert fires when the burn rate exceeds 14.4× both in the last hour and in the last 5 minutes. The 1-hour window ensures the alert doesn’t fire on a 30-second blip. The 5-minute window ensures the alert resets within minutes of resolution.

Why 14.4×? Because 14.4 × (1 hour / 720 hours in 30 days) = 2% budget consumption. The alert fires when 2% of the monthly budget has been consumed in the last hour, a rate that would exhaust the budget in about 2 days if sustained.

# prometheus-rules.yml (excerpt — see companion code for full configuration)
groups:
- name: slo-checkout-recording
rules:
# Pre-compute error ratios at each window size
# 0.001 = (1 - SLO_target) for our 99.9% Availability SLO
- record: checkout:availability_error_ratio_1h
expr: |
(sum(rate(http_server_request_duration_seconds_count{
job="orders", http_route="/orders", http_request_method="POST",
http_response_status_code=~"5.."
}[1h])) or vector(0))
/
sum(rate(http_server_request_duration_seconds_count{
job="orders", http_route="/orders", http_request_method="POST"
}[1h]))
# Repeat for 5m, 30m, 6h, and 3d windows

The same pattern produces checkout:availability_error_ratio_5m, checkout:availability_error_ratio_30m, checkout:availability_error_ratio_6h, and checkout:availability_error_ratio_3d. Then define alerting rules that combine a long and short window:

- name: slo-checkout-alerts
rules:
# Critical page: 14.4× burn rate over 1h AND 5m
- alert: CheckoutAvailabilityBudgetCritical
expr: |
(checkout:availability_error_ratio_1h > (14.4 * 0.001))
and
(checkout:availability_error_ratio_5m > (14.4 * 0.001))
for: 2m
labels:
severity: critical
slo: checkout-availability
annotations:
summary: "Checkout availability error budget burning at 14.4× rate"
description: "Budget exhausts in ~2 days at this rate. Consumed ~2% in the last hour."
# Similar rules for Urgent (6× over 6h/30m) and Ticket (1× over 3d/6h)

The companion code includes the complete prometheus‑rules.yml with all recording rules, all three alert tiers, and parallel rule sets for the Latency (checkout:latency_* / CheckoutLatencyBudget*) and Correctness (checkout:correctness_* / CheckoutCorrectnessBudget*) SLOs. For the 99% latency SLO, replace 0.001 with 0.01; for the 99.99% correctness SLO, use 0.0001.

Burn-rate alerting has a well-known weakness with low-traffic services. If OpenTel E-Commerce receives only 10 checkout requests per hour during overnight hours, a single failure produces a 10% error rate, which is a burn rate of 100×. That would trigger the critical alert for one bad request. Common mitigations include setting a minimum request count threshold (e.g., suppress alerts when the total request count in the short window is below 50) or using wider evaluation windows during low-traffic periods. Keep this in mind when tuning alerts for services with uneven traffic patterns.

With burn-rate alerting, on-call engineers shift from reactive firefighting to proactive budget management. A CheckoutErrorBudgetCritical alert at 3 AM means “this is consuming budget fast enough to matter, investigate now.” A CheckoutErrorBudgetSlow alert at 10 AM means “open a ticket, look at it this sprint.” Normal deployment-related blips that briefly spike error rates but quickly resolve never trigger at all because the short window drops below the threshold within minutes.

The Complete Workflow: From SLI to Resolution

Section titled “The Complete Workflow: From SLI to Resolution”

Let’s tie everything together by walking through how the SLO framework handles a realistic incident, the kind of silent degradation that the Chapter 7 price-mismatch scenario illustrated.

Scenario: On a Tuesday afternoon, a database index becomes fragmented after a large batch import. The SELECT reserve_stock query (instrumented in Chapter 5) starts taking 3 to 4 seconds instead of its usual 50ms. No errors, just slowness. The system returns correct results; it just takes longer.

Step 1: Burn-rate alert fires (T+15 minutes). The latency SLI drops as checkout requests exceed the 2-second threshold. The CheckoutErrorBudgetCritical alert fires because the latency burn rate exceeds 14.4× over both the 1-hour and 5-minute windows. The on-call engineer receives a page: “Checkout latency error budget burning at 14.4× rate.”

Step 2: Dashboard confirms impact (T+16 minutes). The engineer opens the business intelligence dashboard. Row 1 shows: revenue rate dropped from 6,000/hourto6,000/hour to 4,200/hour. Conversion dropped from 82% to 58%. The error budget gauge is amber: ~1% of the monthly latency budget has already been consumed in the first 15 minutes (24× burn rate × 15 min / 43,200 min in 30 days), and the burn rate trend shows the budget will be fully exhausted in about 30 hours if the degradation continues.

Step 3: SLI panels narrow the scope (T+17 minutes). Row 2 shows: Availability SLI is 99.95% (healthy). Correctness SLI is 99.99% (healthy). Latency SLI is 76% (violated; only 76% of checkouts complete in under 2 seconds). The problem is latency, not errors.

Step 4: Traces pinpoint the bottleneck (T+20 minutes). The engineer opens Jaeger, filtered to the 2:00 to 2:30 PM window. The TRANSACTION checkout parent span (Chapter 5) shows a total of 5.1 seconds. Inside, the SELECT reserve_stock child span accounts for 3.8 seconds, roughly 75% of the total time. The database spans attributes from Chapter 5 (db.system.name, db.namespace, db.operation.name), confirming it’s the inventory database.

Step 5: Logs reveal the context (T+22 minutes). Searching Loki for {service_name="inventory"} | json | level="WARN" within the same timeframe shows log entries labeled “Stock reservation slow” with duration_ms values ranging from 3200 to 4100. The structured product.uuid fields show the slowness is across all products, not category-specific.

Step 6: Resolution (T+35 minutes). The DBA identifies the fragmented index, runs REINDEX, and latency returns to normal. Total incident duration: 35 minutes. Error budget consumed: approximately 2% of the monthly latency budget (24× burn rate × 35 min / 43,200 min in 30 days ≈ 1.94%).

Step 7: Post-mortem annotation (T+40 minutes). The engineer adds a Grafana annotation at the incident window with: “Fragmented index on inventory.stock table. 35-minute latency degradation. Consumed ~2% of the monthly latency error budget. Estimated revenue impact: $1,050.”

What would have happened without SLOs? The threshold alerts might not have fired. The error rate stayed near zero because the system wasn’t returning errors, only slow responses. The VP of Sales might have noticed the revenue dip in the weekly finance report five days later. By that point, the index fragmentation would have worsened, and the revenue impact would have been five to ten times larger.

What changed (added in Chapter 8):

AdditionWherePurpose
order.category log fieldOrders service create_order handlerCategory-level revenue analysis in Loki
inventory.stock.level gauge with category dimensionInventory service telemetry::register_stock_level_gaugePer-category stock visibility in Prometheus
Business Intelligence dashboardGrafana provisioningRevenue, SLI, and error budget panels
Prometheus recording rulesprometheus‑rules.ymlPre-computed error ratios for burn-rate alerting
Alerting rulesprometheus‑rules.ymlMulti-window, multi-burn-rate alerts

Table 8.8 – New telemetry and configuration added in Chapter 8

Everything else, the metrics, traces, logs, and infrastructure, reuses telemetry from Chapters 4 through 7 as-is.

Compare this to the Chapter 7 investigation of the price-mismatch incident. That workflow was effective but reactive: a threshold alert fired, the team manually queried three tools, and the root cause emerged through ad hoc exploration. Here, three things changed:

  • The alert was budget-aware, not threshold-based, firing on impact to the reliability commitment rather than an arbitrary error percentage
  • The dashboard showed dollar impact alongside technical metrics, making the business cost visible immediately
  • The post-mortem annotation included budget consumption and revenue loss, giving leadership a concrete data point for prioritizing the fix versus other work

Teams new to SLOs consistently fall into predictable traps. These mistakes, drawn from industry experience and engineering blogs, are worth calling out explicitly so you can avoid them.

An SLO of 100% eliminates the error budget entirely. Zero budget means zero deployments, zero experiments, and inevitable burnout. Engineers spend all their time preventing failures instead of building features. The irony: pursuing 100% reliability often decreases actual reliability over time because the team can’t deploy fixes or improvements.

If stakeholders push for 100%, reframe the conversation: “100% means we can never deploy. Let’s instead commit to 99.99% and define what happens when we approach that limit.”

Every SLO implies an alert, and every alert demands response capacity. A team with 25 SLOs across 8 services will spend more time managing the SLO system than improving the product. Start with 2-3 SLOs per critical user journey. For OpenTel E-Commerce, three SLIs covering the checkout path is sufficient to start. Add SLOs for product search and inventory browsing only once the checkout SLOs are stable and well understood.

Mistake 3: Measuring Infrastructure Instead of User Experience

Section titled “Mistake 3: Measuring Infrastructure Instead of User Experience”

CPU utilization, memory consumption, pod restarts, and disk I/O are operational signals. They help you diagnose problems. But they are not SLIs. A pod can restart 50 times in an hour, and if the load balancer routes around it seamlessly, users experience zero impact. Conversely, a single configuration change that doesn’t affect any infrastructure metric can break every checkout.

SLIs must answer “did the user get what they needed?” not “is the server running?”

Without a documented, cross-functional policy defining what happens when the budget runs low, the SLO is just a number on a dashboard. When the budget is at 15%, someone will argue “we should slow down” and someone else will argue “we need to ship this feature.” Without a pre-agreed policy, the decision depends on who argues loudest, which is exactly the situation SLOs were designed to fix.

Write the policy before the first SLO violation. Get sign-off from engineering, product, and leadership.

Mistake 5: Using Historical Data as the Only Input

Section titled “Mistake 5: Using Historical Data as the Only Input”

If the system ran at 99.99% last quarter, that doesn’t automatically mean 99.99% should be the SLO. If users are satisfied with 99.9%, then the 99.99% target wastes engineering capacity on unnecessary reliability. Use historical performance to inform the conversation but anchor SLO targets on user expectations and business requirements. Start with a modest target, measure for a quarter, and tighten only when the data supports it.

Technical telemetry and business intelligence are not separate disciplines. They are different views of the same data. The metrics, traces, and logs built across Chapters 4 to 7 already contain the signals needed to measure revenue impact, define SLOs, and alert on business-level degradation. The gap was never in the data. It was in the questions we asked.

This chapter transformed that data into a decision-making framework:

What we defined:

  • Three SLIs for the checkout journey: availability, latency, and correctness
  • SLO targets: 99.9% availability, 99% latency (< 2s), 99.99% correctness
  • Error budgets: the amount of acceptable unreliability per 30-day window
  • An error budget policy: documented actions at each budget level
  • Revenue-per-minute baseline: connecting SLO violations to dollar amounts

What we built:

  • A three-row business intelligence dashboard in Grafana: business health, SLI status, and investigation detail
  • Error budget consumption panels that track reliability as a depleting resource
  • Prometheus recording rules for pre-computed error ratios across multiple time windows
  • Multi-window, multi-burn-rate alerting rules that replace noisy threshold alerts

What we added to the application (minimal):

  • order.category log attribute for category-level revenue analysis
  • inventory.stock.level gauge with a category dimension for per-category stock visibility

Key principles:

  • SLIs measure user experience, not infrastructure health
  • SLOs are targets, not aspirations. 100% is always the wrong goal
  • Error budgets transform reliability from a political debate into a data-driven engineering decision
  • Burn-rate alerting scales severity to budget impact, eliminating false alarms
  • Dollar amounts make incidents concrete for every stakeholder

Appendix 8. A: References and Further Reading

Section titled “Appendix 8. A: References and Further Reading”

This chapter draws on concepts and frameworks from several authoritative sources in the reliability engineering community.

The SLI/SLO/SLA framework, error budget concept, and burn-rate alerting methodology are extensively documented across two Google publications:

  • Site Reliability Engineering (Betsy Beyer, Chris Jones, Jennifer Petoff, Niall Richard Murphy, O’Reilly 2016). Chapter 3 (“Embracing Risk”) introduces the error budget concept. Chapter 4 (“Service Level Objectives”) defines SLIs, SLOs, and SLAs with the canonical “if there is no explicit consequence, then you are almost certainly looking at an SLO” distinction. Available free at https://sre.google/sre-book/.
  • The Site Reliability Workbook (Betsy Beyer, Niall Richard Murphy, David K. Rensin, Kent Kawahara, Stephen Thorne, O’Reilly 2018). Chapter 2 (“Implementing SLOs”) provides the SLI specification vs. implementation distinction and the SLI menu by service type. Chapter 5 (“Alerting on SLOs”) walks through six progressively sophisticated alerting approaches, culminating in the multi-window multi-burn-rate method used in Section 8.6. Appendix A provides the example SLO document for a game service. Appendix B provides the example error budget policy. Available free at https://sre.google/workbook/.

The allowed-downtime-per-target calculations in Section 8.1 are straightforward arithmetic, yet they are commonly referenced in cloud provider documentation and SRE training materials. The specific numbers (e.g., 99.9% = 43 minutes 50 seconds per month) are derived from:

downtime_per_month = (1 - target) × 30 days × 24 hours × 60 minutes

The cloud provider SLA comparison in Section 8.1 is compiled from publicly available SLA documents:

SLA terms and numbers change periodically. Verify current values before making architectural decisions based on specific SLA commitments.

The real-world SLO examples referenced in Section 8.1:

The latency-to-revenue data cited in Section 8.2:

  • Amazon’s 100ms = 1% sales finding: Attributed to Greg Linden’s presentation at a Stanford research forum and widely cited in the performance optimization community. Original blog post: http://glinden.blogspot.com/2006/11/marissa-mayer-at-web-20.html (November 2006).
  • Google’s 500ms = 20% traffic drop: Reported by Marissa Mayer at the Web 2.0 Conference (2006), documented in the same blog post above.
  • Walmart’s 1-second = 2% conversion improvement: Presented at the Velocity Conference (2012) by Walmart Labs.

These figures are frequently cited in the web performance community. While the specific ratios will vary by business, the general principle that latency directly impacts conversion and revenue is consistently supported by subsequent research.

The multi-window, multi-burn-rate alerting method in Section 8.6 is directly based on the SRE Workbook Chapter 5. Practical implementations referenced:

  • “Implementing Service Level Objectives” by Alex Hidalgo (O’Reilly, 2020). A comprehensive book entirely focused on SLOs, covering organizational adoption, mathematical foundations, and cultural challenges in detail beyond what this chapter can address.
  • “The Case for SLOs” - Honeycomb Blog (https://www.honeycomb.io/blog/case-for-slos). A practitioner’s perspective on why SLOs matter for product teams, not just SRE teams.