How to Calculate an SLO From User-Journey Success

How to Calculate an SLO From User-Journey Success
How to Calculate an SLO From User-Journey Success

A service can return healthy HTTP responses while a customer still cannot complete a purchase, submit a document, or recover an account. Endpoint uptime is useful operational telemetry, but it is not automatically a measure of whether users achieved their goals. A user-journey service level objective (SLO) measures successful outcomes over a defined population of eligible attempts and a stated observation window.

The calculation is straightforward once its boundaries are explicit. The hard work is choosing the unit of measurement, deciding what counts as success, collecting complete evidence, and preventing retries, missing telemetry, and abandoned sessions from distorting the result. Google's guidance on implementing SLOs explicitly discusses complex user tasks that span multiple operations and the difficulty of inferring completion from logs.

Start with a user outcome, not an infrastructure metric

Choose a journey that a user recognizes: complete checkout, publish an article, upload a file, create a project, or reset a password. Describe it as an observable outcome rather than a list of internal services. A checkout may involve authentication, cart validation, payment authorization, inventory, and order persistence. The SLO need not require every dependency to be healthy; it asks whether the checkout completed under the agreed conditions.

An API success rate answers a different question. It may count a successful product-list response or a successful token refresh even when checkout fails. Conversely, a retryable transient error might be invisible to the customer because the client recovers. Both kinds of data matter, but aggregating unrelated requests into a single ratio can hide failures in important journeys.

Write a one-sentence specification: “For eligible checkout attempts started by real customers, the proportion that produces a confirmed order within the allotted time will meet the agreed target over the rolling observation window.” Replace each general phrase with an exact, testable definition before deploying instrumentation.

Define an eligible attempt and its terminal result

A defensible SLI begins with the denominator. An eligible attempt is not necessarily a page view, HTTP call, or button click. It may start when the user confirms an action that the product has accepted for processing. The start event needs a stable journey identifier, event time, journey type, and enough context to determine eligibility without storing unnecessary personal data.

Define terminal outcomes separately:

  • Good: the user-visible business outcome is committed and observable within the deadline.
  • Bad: the application reaches a terminal failure, or an eligible attempt exceeds its completion deadline without evidence of success.
  • Excluded: an event defined in advance as outside the service commitment, such as a known test transaction or an attempt rejected before admission for a documented reason.
  • Unknown: instrumentation is insufficient to classify the attempt; do not silently relabel unknown as success.

Product and engineering stakeholders should agree on how user cancellations, rejected payments, invalid input, and external-provider decisions affect eligibility. A correctly declined card is not necessarily a service failure. But an unexplained timeout after payment authorization may be, even if a later backend process reconciles it. The classification must reflect the user promise, not convenience for the dashboard.

The event contract should include a unique attempt ID, start timestamp, terminal timestamp when available, eligibility decision, outcome, and a bounded failure category. Avoid raw user IDs or request paths as Prometheus labels; high-cardinality dimensions are better stored in controlled logs or traces.

Calculate the success-based service level indicator

For an event-based SLI, use:

Journey success SLI = eligible good attempts / all eligible attempts.

The denominator comprises attempts that have reached a final classification or whose deadline has elapsed. Define the cohort rule explicitly: for example, attempts started during the reporting window and observed through a fixed grace period. Otherwise attempts started near a reporting boundary can appear successful or unsuccessful simply because their results arrive later.

Consider an illustrative 30-day checkout cohort of 200,000 eligible attempts. Suppose 199,200 complete successfully and 800 end unsuccessfully or miss the defined deadline. The observed success SLI is:

199,200 / 200,000 = 0.996 = 99.6%.

For a hypothetical 99.9% SLO, the allowable failure fraction is 1 - 0.999 = 0.001. Across 200,000 equally weighted eligible attempts, the budget would be 200 bad attempts, so the observed 800 bad attempts exceed that illustrative budget by 600. These are arithmetic examples, not production measurements or a recommendation that every checkout use a 99.9% target.

The same calculation can be written in terms of bad outcomes:

SLI = 1 - (bad_attempts / eligible_attempts).

Use one consistent aggregation method. Summing good and total attempts across the entire cohort weights every attempt equally; averaging daily success percentages gives each day equal weight regardless of traffic. The latter may be appropriate for a different stated objective, but should not be substituted unnoticed for an event-weighted SLO.

Choose the objective and window deliberately

The SLI is what you measured; the SLO is the target you agree to meet. A 99.9% SLO is not inherently more correct than 99.5% or 99%. The right target depends on user harm, product expectations, feasible engineering investment, and how much instability the system and its users can tolerate.

A rolling 28-day or 30-day window is often operationally useful for observing changes, but its length is a policy choice. Calendar-month windows and rolling windows produce different results near boundaries. Keep one definition in dashboards, alert rules, engineering reviews, and stakeholder reports. Document whether late-arriving records can revise a previously published window and how incomplete windows are displayed.

For a 99.9% target, the error budget fraction is 0.1% of eligible attempts. In a request-driven journey, the number of allowed failures changes with the denominator. It is not a fixed count of minutes offline. This differs from a time-based availability SLI, where the fraction of good observation intervals is the unit of measurement.

Google's SRE Workbook chapter on alerting explains error-budget consumption and burn-rate alerting. An SLO need not imply paging on every failed event; alerts should target meaningful rates of budget consumption and ongoing user impact.

Collect journey events across systems

There are several viable measurement designs. The simplest is to record a server-side success event at the authoritative point where the desired business effect commits. That gives strong evidence of completion but may miss a case where the backend succeeds and the client never receives confirmation. Client-side events capture user visibility, but browser exits, ad blockers, network loss, and incomplete uploads can make client telemetry unreliable.

A robust design can join these perspectives. Emit an admitted-attempt event from the entry point, link downstream work with a stable correlation ID, and record a terminal result from the component that owns the business outcome. Use tracing to diagnose the steps behind a failure, not as the sole accounting ledger for eligibility.

OpenTelemetry's HTTP metric semantic conventions define metrics including http.server.request.duration and standard attributes. Those metrics help explain component behavior, but do not magically encode checkout success or another business-specific outcome. Define separate, explicit journey counters or an event stream for this purpose.

For asynchronous workflows, a confirmation may arrive minutes after the initiating request. The state machine should distinguish accepted, processing, succeeded, failed, and timed out. Specify one terminal outcome per eligible attempt. A durable event store and an idempotent state transition are particularly useful when workers retry or events arrive out of order.

Handle retries without counting fictional success

Imagine a user clicks “Place order,” the first request times out, and the client transparently retries. If the backend eventually commits one order and the user receives confirmation before the journey deadline, the user experienced one successful journey, not two attempts with one failure and one success.

Count logical attempts using an idempotency or journey key rather than counting transport requests. If the user starts a genuinely new purchase, it should receive a new attempt key. The boundary between retry and new action must be documented; no metric system can infer it reliably from timestamps alone.

Duplicate events are another source of error. Event delivery can be at least once, while the SLO requires an exactly-one logical classification. Deduplicate by stable ID, retain the first valid admission, and apply a deterministic terminal-state policy. Late success after a previously assigned timeout requires an explicit reconciliation rule rather than an ad hoc dashboard correction.

Translate event data into a queryable ratio

One option is to classify raw journey events in a database or stream processor, then export low-cardinality cumulative counters to Prometheus. For example, an application could expose:

journey_attempts_total{journey="checkout",outcome="good"} 199200
journey_attempts_total{journey="checkout",outcome="bad"} 800

These values are illustrative and assume each eligible attempt has been assigned one final outcome. The metric name and label scheme are application-defined, not an OpenTelemetry standard. Do not put every unique journey ID in metric labels.

For a selected observation period, the conceptual PromQL ratio is:

sum(increase(journey_attempts_total{
  journey="checkout",outcome="good"
}[30d]))
/
sum(increase(journey_attempts_total{
  journey="checkout",outcome=~"good|bad"
}[30d]))

This query assumes continuously scraped counters and terminal-event accounting. It measures outcomes recorded during the window, which is not identical to a cohort of attempts started during the window when journeys cross its boundaries. To calculate an exact admission-cohort SLO, aggregate the underlying event ledger by start time and wait for the deadline/grace period before finalizing the cohort. Check missing series, scrape gaps, counter resets, retention, and low-volume intervals before trusting a displayed ratio.

Tools such as Sloth can generate Prometheus SLO recording and alerting rules from error and total queries. The generator cannot decide whether a payment decline is eligible or whether a long-running workflow has succeeded. The measurement contract belongs to the product and engineering team.

Test the measurement, not just the service

Before treating a new SLO as contractual, inject representative events and verify the counts. Test successful completion, terminal failure, timeout, user cancellation, invalid input, duplicate delivery, retry, late success, and missing start or terminal records. For each test, inspect both raw events and aggregate counters.

Reconcile independently: compare admitted attempts with an authoritative transaction or workflow log; verify that terminal outcomes are mutually exclusive; and alert on an unexpected rise in unknown attempts. Consider an instrumentation-quality metric, such as the fraction of admitted attempts with a valid terminal classification by the deadline. This is a separate quality measure, not a reason to suppress user-impacting failures.

Be careful with exclusions. If a feature is degraded and requests fail before they reach the component that records admission, a server-side denominator can shrink just when users are suffering. Supplement business-event SLIs with entry-point or client-side availability checks, and document the blind spots.

Use the error budget for decisions

A simple burn rate is the observed bad-outcome fraction divided by the allowed bad-outcome fraction. With an observed 0.4% bad rate against an allowance of 0.1%, the illustrative burn rate is 0.004 / 0.001 = 4. This describes the current rate of budget consumption relative to the target, not a prediction that the same pattern will persist.

Multiwindow, multi-burn-rate alerting can combine a longer window that detects meaningful budget consumption with a shorter window that confirms the problem is ongoing. The Google SRE Workbook describes this approach and its trade-offs. Low-volume journeys demand additional judgment: a handful of failures can produce a volatile ratio, while a single failure can still have serious business impact.

Link the SLO to operational action. On sustained budget burn, investigate failing journey stages and prioritize fixes. During a healthy period, use the remaining budget to discuss releases and product trade-offs. Avoid interpreting the target as a guarantee to every individual customer or treating an apparently compliant aggregate as proof that all user segments are healthy.

Segment carefully, without hiding the global result

A single success ratio may conceal failures concentrated in one region, payment method, device class, or customer tier. Preserve a global SLO with its agreed eligible population, then inspect a controlled set of diagnostic slices. If a segment represents a different reliability commitment, define a separate SLO rather than quietly changing weighting rules.

Segmentation also has a statistical and operational cost. Small cohorts may be noisy; uncontrolled labels increase cardinality and monitoring expense; and collecting sensitive dimensions can create avoidable privacy risk. Prefer a limited vocabulary of useful dimensions and implement appropriate data retention and access controls.

A well-designed user-journey SLO is therefore a measurement agreement: the exact action being protected, the observable condition for success, the population of eligible attempts, the deadline and window, the instrumentation assumptions, and the remediation decisions it supports. The division is the easy part. Reliability improves when the numerator and denominator describe the experience users actually depend on.