Data engineering teams routinely juggle complex pipelines, divergent SLAs, and noisy alerts. Moving from ad-hoc checks to an SLO-driven approach for data quality reduces alert fatigue, aligns priorities with business risk, and creates a predictable feedback loop for engineering and stakeholders.
What this guide covers
- Concrete SLI definitions for freshness, completeness, and accuracy
- How to measure SLIs in batch and streaming pipelines (SQL + metrics)
- How to set SLOs, compute error budgets, and map to alerting tiers
- Patterns for automated remediation and preventing repeat incidents
- Dashboards, runbooks, and organizational rollout advice
Why an SLO-driven approach matters for data
SLOs make subjective statements (“data is fresh enough”) explicit and measurable. For analytics and ML consumers, the business impact of stale or incomplete data is quantifiable: missed revenue opportunities, model drift, or reporting errors. An SLO-driven program helps answer three vital questions:
- How often are we violating our consumer expectations?
- What level of reliability is worth the engineering cost?
- When should we auto-remediate vs. page an on-call engineer?
Step 1 — Choose practical SLIs (and keep them small)
Start with 3 focused SLIs that cover the largest consumer risks. For most analytics platforms the highest-leverage SLIs are:
- Freshness (latency) — time between source event and visibility in target table.
- Completeness — percent of expected records (or partitions) present compared to source.
- Accuracy (sanity checks) — aggregate-level checks that catch silent corruption, e.g., total transactions within expected range.
Keep SLI definitions narrow and consumer-focused. Instead of “completeness of entire system,” define “completeness for daily orders table used by revenue reports.”
Example SLI definitions
- Freshness SLI for daily_orders: measuring the 95th-percentile ingest lag in minutes across partitions, computed hourly.
- Completeness SLI for daily_orders: percentage of merchant-day partitions present (target: 99.5% of expected partitions in last 24 hours).
- Accuracy SLI for daily_orders: relative deviation of total daily order_sum from rolling 30-day median, flagged if >5%.
Step 2 — Measure SLIs: queries and metrics
Measurement varies by pipeline type, but two patterns work well:
- Compute SLIs via SQL on the target store (warehouse or materialized view) and emit numeric values to your metrics system.
- Instrument pipeline code to emit fine-grained metrics (ingest lag, rows processed, schema change events) directly to your monitoring backend.
Concrete examples (replace table and column names with yours):
- Freshness SLI (SQL, run hourly): compute 95th percentile of (ingest_timestamp_diff) per partition: SELECT percentile_cont(0.95) WITHIN GROUP (ORDER BY extract(epoch FROM (ingest_time - event_time))/60) AS p95_mins FROM daily_orders WHERE partition_date >= current_date - interval '2 days'; Emit p95_mins to Prometheus/Grafana as gauge data.daily_orders.freshness_p95_mins.
- Completeness SLI (SQL, run daily): expected_partitions = count of distinct merchant_id in merchant_catalog for date D; present_partitions = count of merchant_id present in daily_orders for D; completeness_pct = present_partitions / expected_partitions * 100. Emit as data.daily_orders.completeness_pct.
- Accuracy SLI (SQL, run daily): today_sum = SELECT sum(amount) FROM daily_orders WHERE partition_date = current_date; median_30 = SELECT percentile_cont(0.5) WITHIN GROUP (ORDER BY day_sum) FROM (SELECT SUM(amount) AS day_sum FROM daily_orders WHERE partition_date BETWEEN current_date - interval '40 days' AND current_date - interval '10 days' GROUP BY partition_date); accuracy_pct = abs(today_sum - median_30) / median_30 * 100.
Emit these numbers to a time-series store (Prometheus, Influx, metrics API) every evaluation window, and keep raw SLI samples for at least one error-budget period (e.g., 30 days).
Step 3 — Set SLOs and compute error budgets
An SLO translates an SLI into a consumer-facing target. Examples:
- Freshness SLO: p95 ingest lag ≤ 30 minutes 99% of the time per 30-day window.
- Completeness SLO: completeness_pct ≥ 99.5% per day, 99% of the time over 30 days.
- Accuracy SLO: daily totals deviation ≤ 5% at least 99% of days per quarter.
Compute the error budget as allowed violation rate. For a 99% SLO over 30 days, you allow 7.2 hours (30 days * 24 * 1% = 7.2 hours) of aggregated violations for time-based SLIs, or 0.3 days of violation for calendar-day SLOs. Use the budget to make decisions: if budget is consumed, schedule engineering work; if budget is healthy, prioritize feature work.
Step 4 — Map SLO states to alerting and runbooks
Not every SLO violation should page an on-call engineer. Use a tiered alerting model tied to error budget consumption and severity:
- Notice (info) — SLI breaches that are transient and under error budget; send Slack notifications to data-team channel with context and links to dashboard.
- Warning — error budget burn rate > 5% in last 24 hours; create a ticket in your backlog and notify product owner.
- Critical (page) — SLI breach persists and error budget will be exhausted within N hours (e.g., 48 hours) or business-critical pipeline fails; page on-call and execute runbook.
Runbooks should be concise, prescriptive, and automatable. Each runbook entry must include:
- How to confirm the SLI failure (query and dashboard link).
- Quick triage steps (check recent deploys, schema changes, backlog sizes).
- Safe remediation steps (restart job, replay source, trigger partition backfill).
- Escalation criteria and post-incident checklist.
Step 5 — Automate remediation where safe
Automation reduces toil and Mean Time To Resolution (MTTR). Use automation for routine, low-risk fixes and human intervention for risky operations.
Safe automated patterns
- Auto-replay limited to small recent windows — if freshness p95 > threshold for a single partition and rows_missing small limit, automatically replay that partition and emit an audit event.
- Auto-retry of transient connector errors — exponential backoff and circuit-breakers in connectors (Debezium, ingestion agents).
- Degraded-mode feature flags — switch consumers to a less-precise but still safe dataset while engineering works on root cause.
When not to automate
- Schema drift that causes silent corruption — requires human validation.
- Large backfills that cost a significant amount in compute or could overwrite clean data.
Step 6 — Observability and dashboards
Good dashboards surface SLI trends, error budget burn, and the incident context. Design a dashboard per critical dataset that includes:
- SLI time series (p50/p95/p99 freshness), completeness %, accuracy %
- Error budget remaining (percentage and time-based projection)
- Recent pipeline job history (success/failure/latency), connector lag, and consumer errors
- Top correlated signals (schema-change events, deploys, resource saturation)
Include links to supporting artifacts: sample failing rows, raw job logs, and the runbook. Instrument metadata (pipeline version, commit id) in metrics to aid correlation.
Step 7 — Organizational process and SLO governance
SLOs require cross-functional buy-in. Follow this rollout sequence:
- Identify the top 5 consumer-critical datasets and convene consumer interviews to define acceptable values for freshness/completeness.
- Draft SLI definitions and sample SLOs; run them in “reporting-only” mode for one month to collect baseline metrics.
- Refine thresholds based on measured consumer impact and operational cost; codify SLOs and link to SLIs in your observability platform.
- Define error budget policy (who decides, how to spend, how to freeze feature launches when budgets are low).
Step 8 — Cost tradeoffs and lifecycle
Higher SLOs cost more. Examples of cost levers:
- Near-real-time ingestion (lower freshness SLO) increases streaming resource costs and egress charges.
- Auto-replay/backfill strategies may increase compute use and storage for intermediate snapshots.
- More frequent sampling of SLIs increases query load on the warehouse.
Map each SLO to its cost bucket and require business justification for tightening SLOs beyond a baseline. Maintain an SLO lifecycle: experiment, baseline, prioritize engineering work, and retire stale SLOs that no longer represent consumer needs.
Practical checklist to get started (first 30 days)
- Pick one business-critical dataset and define 3 SLIs (freshness, completeness, accuracy).
- Implement measurement queries and export metrics to your monitoring backend (sample cadence: freshness hourly, completeness daily, accuracy daily).
- Run in reporting mode for two weeks and collect baseline metrics.
- Set SLOs with stakeholder agreement and calculate the error budget.
- Configure tiered alerts: info (Slack), warning (ticket), critical (page), and write the first runbook.
- Automate one low-risk remediation (e.g., retry small replay), and track MTTR improvements.
Common pitfalls and how to avoid them
- Too many SLIs — bloated SLI sets are noisy. Start small and prioritize by consumer impact.
- Using raw job success as SLI — a job can succeed while producing bad data. Measure data-level SLIs.
- Overreacting to single-sample spikes — use percentiles and rolling windows, not single-point thresholds.
- No error budget policy — teams will ignore SLOs unless there’s a clear decision process when budgets run low.
Example: mapping a violation to actions
Context: daily_orders p95 freshness breached 40 minutes (SLO 30 minutes) for 6 hours.
- Monitoring shows freshness metric above SLO starting 6 hours ago, error budget burn rate = 4% of monthly budget.
- Alerting tier: Warning. Slack notification with dashboard link and timestamped query included.
- Triage steps: check recent deploys (no), check connector lag (connector lag spiked), check worker metrics (CPU and network normal).
- Action: trigger automated small replay of partitions from last 6 hours; if replay reduces p95 below threshold, close incident and record as auto-remediated. If not, escalate to on-call for deeper investigation and schedule a backfill if needed.
Conclusion
An SLO-driven data quality program turns subjective reliability expectations into objective engineering levers. Start with a narrow set of SLIs tied directly to consumers, measure them reliably, set realistic SLOs with clear error budgets, and bake those signals into tiered alerting and remediation patterns. Over time, the program reduces firefighting, clarifies priorities, and delivers measurable improvements in trust and business outcomes.
Adopt the checklist, instrument your first dataset this month, and iterate: small, measurable wins compound into a robust, predictable data platform.