Defines SLI, SLO and SLA, covers choosing user-centred SLIs and where to measure them, turning latency percentiles into ratio-based SLOs from histograms, error budget maths and an error budget policy.
An SLI is a measurement of user experience expressed as a ratio of good events to valid events, for example requests to /api/orders answered in under 300 ms with a non-5xx status ÷ all requests. An SLO is the internal target for that SLI over a rolling window, such as 99% over 28 days. An SLA is the external contract with financial penalties, deliberately looser than the SLO (say 99.5% vs 99.9%) so you breach the SLO first.
To turn a latency percentile into an SLO, rephrase it as a threshold ratio: "99% of requests complete in under 300 ms", computed from the ASP.NET Core http.server.request.duration histogram buckets, not by averaging p99s. The error budget is 1 − SLO: at 99.9% over 30 days that is about 43 minutes or 0.1% of requests. When the budget is spent, risky releases pause and reliability work takes priority. The trade-off: each extra nine costs far more engineering and infrastructure.
"An SLI, a service level indicator, is a number that reflects what users experience, and I always express it as a ratio: good events over valid events. For a .NET API that might be 'requests that returned a non-5xx status in under 300 milliseconds, divided by all requests, excluding health checks and synthetic traffic'. An SLO is the target I set for that ratio over a rolling window, for example 99.5% over 28 days. It's internal and it's an engineering tool. An SLA is a contract with customers, with credits or penalties if we miss it, so it's set looser than the SLO: if we promise 99.5%, we aim for 99.9% internally so we see trouble long before we owe anyone money.
Choosing SLIs is the part people rush. I start from user journeys, like 'place an order' or 'view my bookings', and pick two or three indicators per journey: availability, latency, and for async work freshness, like 'order confirmation emails sent within five minutes'. I measure as close to the user as I can: at the gateway or with ASP.NET Core's
http.server.request.durationhistogram rather than inside one method. For latency, I don't say 'p99 under 300 ms'; I say '99% of requests are faster than 300 ms' and compute it from histogram buckets, because that's a ratio I can add up across instances and time, whereas percentiles can't be averaged.The error budget is just one minus the SLO. At 99.9% over 30 days, that's 0.1% of requests, or about 43 minutes of full downtime. The budget turns reliability into a decision: while there's budget left we ship freely; when it's gone, the error budget policy kicks in, risky releases pause and the team works on reliability. The mistake I see is picking SLOs at 99.99% because it sounds good, without checking what the dependencies can actually deliver."
| Term | What it is | Who sees it | Example |
|---|---|---|---|
| SLI | A measured ratio of good to valid events | Engineers | 99.82% of checkout requests succeeded in < 300 ms this week |
| SLO | Target for an SLI over a window | Engineering and product | 99.5% over 28 days |
| SLA | Contract with consequences | Customers, legal | 99.5% monthly availability or 10% service credit |
| Journey type | SLI | Measured from |
|---|---|---|
| Request/response API | Availability: non-5xx ÷ all valid requests | http.server.request.duration count by http.response.status_code, or App Insights requests |
| Request/response API | Latency: requests < threshold ÷ all | Histogram bucket at the threshold (le="0.3") |
| Async processing | Freshness: messages processed within 5 min ÷ all | Custom histogram of enqueue-to-done time |
| Data pipeline | Correctness: records passing validation ÷ all | Custom counter |
| Low-traffic service | Synthetic availability: successful runs ÷ runs | Availability tests |
Decide what counts as valid: usually exclude health checks, synthetic traffic (or measure it separately) and client errors such as 400 and 404, but count 429 if you throttled users unfairly.
| SLO | Budget (ratio) | Downtime equivalent over 30 days |
|---|---|---|
| 99% | 1% | 7 h 12 min |
| 99.5% | 0.5% | 3 h 36 min |
| 99.9% | 0.1% | 43.2 min |
| 99.95% | 0.05% | 21.6 min |
| 99.99% | 0.01% | 4.3 min |
If your API needs App Service (99.95%) and Azure SQL (99.99%) in series, the best you can expect is roughly 0.9995 × 0.9999 ≈ 99.94% before your own bugs, so a 99.99% SLO would be fiction. Redundancy (zone-redundant SQL, multiple regions) raises the composite.
For an [order API] we set 99.5% availability and "99% under 400 ms" over 28 days, measured from the ASP.NET Core request duration histogram at the ingress. In [March] a [slow EF Core query release] consumed [70%] of the latency budget in four days; under the error budget policy we paused feature releases for [one sprint], fixed the query and added a performance test to CI, and the budget recovered by the end of the window.
Checks the candidate can define SLIs, SLOs and SLAs precisely, choose meaningful SLIs, do the error budget maths and use the budget to make decisions.
Green flags
Red flags
Ratios of good to valid events have useful properties: they're between 0 and 1, they can be summed across instances and time (add numerators and denominators), and they map directly to user experience ("1 in 200 requests failed"). Percentiles have none of these: the p99 of two instances is not the average of their p99s.
instance A: 1,000 requests, 10 bad ┐
instance B: 9,000 requests, 9 bad ├─► SLI = (10 + 9) / (1,000 + 9,000) = 99.81%
┘ (averaging 99.0% and 99.9% would give 99.45%: wrong)
ASP.NET Core (since .NET 8) publishes http.server.request.duration as a histogram in seconds. With OpenTelemetry, buckets are configurable; set a bucket boundary exactly at your threshold (0.3 s), otherwise the SLI is interpolated and inaccurate.
buckets: ... 0.1 | 0.25 | 0.3 | 0.5 | 1 ...
good = count(le="0.3") valid = count(+Inf)
SLI = good / valid
In KQL against Application Insights requests: countif(duration < 300 and success) / count().
user ─► Front Door ─► ingress ─► Kestrel/ASP.NET Core ─► handler ─► SQL
▲ best for availability ▲ good, easy ▲ too deep: misses queueing and routing
The closer to the user, the more failures you see (TLS, routing, queueing before Kestrel). Server-side metrics are easier and usually good enough; complement them with synthetic tests and RUM.
A rolling window (28 or 30 days) gives a continuous view and is what alerts use; a calendar window (monthly) matches SLA reporting. 28 days contains exactly four of each weekday, which avoids the weekly pattern skewing comparisons.
An SLO without a policy is just a chart. A typical policy, agreed with the product owner:
| Budget remaining | Response |
|---|---|
| > 50% | Ship normally; consider experiments |
| 25-50% | Extra review for risky changes |
| < 25% | Only low-risk releases; reliability items prioritised |
| Exhausted | Feature freeze except fixes and security; postmortem for the biggest consumers |
The budget also works in the other direction: if you never spend it, the SLO is probably too loose or you're over-investing in reliability.
SLA breaches usually mean service credits. Azure publishes per-service SLAs, and your SLA to customers must account for what you depend on. Australian B2B contracts often include availability schedules; legal and product own the SLA, engineering owns the SLO that protects it.
http.server.request.duration including 0.3, and export to Prometheus.requests.Setting histogram buckets so the latency SLI is exact, plus the SLI queries in PromQL and KQL.
// Program.cs (.NET 10). Packages: OpenTelemetry.Extensions.Hosting, OpenTelemetry.Instrumentation.AspNetCore,
// OpenTelemetry.Exporter.OpenTelemetryProtocol
using OpenTelemetry.Metrics;
var builder = WebApplication.CreateBuilder(args);
builder.Services.AddOpenTelemetry()
.ConfigureResource(r => r.AddService("orders-api"))
.WithMetrics(metrics => metrics
.AddAspNetCoreInstrumentation()
// Put a bucket boundary exactly on the SLO threshold (0.3 s) so "good" is counted, not interpolated.
.AddView("http.server.request.duration", new ExplicitBucketHistogramConfiguration
{
Boundaries = [0.05, 0.1, 0.2, 0.3, 0.5, 1, 2, 5]
})
.AddOtlpExporter());
var app = builder.Build();
// Health and other non-user endpoints should not count as valid events.
app.MapHealthChecks("/health/ready").DisableHttpMetrics();
app.MapGet("/api/orders/{id:int}", (int id) => Results.Ok(new Order(id, "Placed")));
app.Run();
record Order(int Id, string Status);
# Availability SLI over 28 days: non-5xx ÷ all
1 - (
sum(increase(http_server_request_duration_seconds_count{service="orders-api",http_response_status_code=~"5.."}[28d]))
/ sum(increase(http_server_request_duration_seconds_count{service="orders-api"}[28d]))
)
# Latency SLI over 28 days: requests under 300 ms ÷ all
sum(increase(http_server_request_duration_seconds_bucket{service="orders-api",le="0.3"}[28d]))
/ sum(increase(http_server_request_duration_seconds_count{service="orders-api"}[28d]))
# Error budget remaining (SLO 99.5%)
1 - ((1 - <availability SLI>) / (1 - 0.995))
// Same SLIs from Application Insights, excluding synthetic traffic
requests
| where timestamp > ago(28d) and cloud_RoleName == "orders-api"
| where isempty(customDimensions["synthetic"]) and name !startswith "GET /health"
| summarize valid = count(),
available = countif(toint(resultCode) < 500),
fast = countif(toint(resultCode) < 500 and duration < 300)
| extend availability = 100.0 * available / valid,
latency_sli = 100.0 * fast / valid,
budget_left_pct = 100.0 * (1 - (1.0 - 1.0 * available / valid) / (1 - 0.995))
SLOs are a product decision expressed in engineering terms. The number should come from what users need and what the business will pay for, checked against history and the composite SLA of the dependencies, not from a wish for many nines. Their real value is the error budget: it turns "should we ship or fix?" from an argument into a policy the product owner agreed to in advance.
| SLO choice | When it fits | Cost | When not to |
|---|---|---|---|
| 99% | Internal tools, batch, back-office | Low | Customer-facing payments |
| 99.5-99.9% | Most customer-facing APIs on a single region with zone redundancy | Moderate: zone-redundant SQL, good deploys | When dependencies can't reach it |
| 99.95%+ | Payments, auth, core platform | Multi-region, active-active, strong release safety | Without matching investment and on-call maturity |
I measure the SLO programme by whether it changes decisions: how often the policy was triggered, what reliability work it funded, and whether customer-reported incidents dropped.
An average mixes fast and slow requests into one number that describes almost nobody. If 95 requests take 50 ms and 5 take 3 s, the average is (95 × 50 + 5 × 3,000) / 100 ≈ 198 ms, which looks fine while 1 in 20 customers waits 3 seconds. Percentiles describe the distribution: p50 is the typical request, p95/p99 is the slow tail people complain about.
Percentiles come from a histogram: count requests into buckets, then find the bucket where 99% of the count is reached and interpolate (put bucket boundaries close to your SLO threshold so the estimate is tight). Because a percentile is not additive, you cannot average p99 across pods or time windows; you merge the bucket counts first and then take the quantile, which is what histogram_quantile(0.99, sum by (le) (rate(...[5m]))) does.
The trade-off: high percentiles need enough traffic and well-chosen buckets to be trustworthy, so chart the request count next to them and alert on SLO burn rate rather than a raw p99.
Alert on symptoms users feel, such as the request error-rate or latency SLI, failed synthetic journeys or orders per minute dropping, because causes like CPU at 80% often hurt nobody and miss failures with no resource signal at all. The best symptom alert is SLO burn rate: how fast you are spending the error budget. With a 99.9% SLO, a 14.4× burn over 1 hour (confirmed over 5 minutes) spends 2% of a 30-day budget and pages; 6× over 6 hours pages; slower burns raise a ticket.
Every alert needs who gets paged (the owning team's rotation), the threshold and window, a severity that decides page versus ticket, a dashboard link and a runbook with the first mitigation steps. Cause metrics stay on dashboards for diagnosis. The trade-off: fewer pages means a slightly later warning for slow-building problems, which tickets cover.
Synthetic monitoring runs scripted requests or user journeys against your app on a schedule from outside, typically from several regions. Unlike real user monitoring, it works when no users are active (3 am, a new region) and gives a consistent baseline; unlike health checks, it tests the whole path users take: DNS, TLS, Front Door, the app and its dependencies.
On Azure, an Application Insights standard test sends one HTTP request every 5-15 minutes from chosen locations and checks the status code, content and certificate expiry. For multi-step journeys (sign in, add to cart, pay) you run a Playwright script on a timer and report the result with TrackAvailability, using synthetic accounts with fake data and the payment provider's test mode, never real customers or cards.
Alert when several locations fail (for example 3 of 5), not one. The trade-off: synthetic tests are cheap and predictable but only cover the paths you script, so pair them with RUM and server-side SLIs.
How to tell it (STAR)
**S:** At [company] our [order API] had SLOs for availability and latency, plus an error budget policy the product owner had signed. **T:** After a release, the slow-burn alert told us we'd used [70%] of the monthly latency budget in four days, and I [owned the investigation]. **A:** I split the SLI by route, traced the slow requests to one EF Core query whose plan had changed because of a non-sargable comparison, and rolled the feature back with its flag. Then I fixed the query and index, and because the budget was nearly gone we followed the policy: one sprint without feature releases, spent on performance tests in CI. **R:** The latency SLI went back above [99.7%] daily, we finished the window within the SLO, and the CI test has since blocked [two] similar regressions before release.
Last updated 23 Nov 2026.