Data Architecture & Reliability
Monitoring Data Pipelines - Metrics That Actually Matter
Most Pipeline Monitoring Tells You the Pipeline Ran. Here Is How to Monitor Whether It Ran Correctly.

TL;DR
- DAG success/failure status, row counts with no context, and task duration alone are vanity metrics — they describe activity, not correctness
- Freshness — time since the last known-good row — catches the specific failure where a pipeline is green but the data underneath it has stopped moving
- SLAs should be set based on when a consumer actually needs the data, not on whatever the pipeline currently achieves — an SLA copied from current performance protects nothing
- Alert fatigue is not a tooling problem, it’s a design problem — every alert that fires without requiring action trains the recipient to ignore the next one, including the one that matters
- A stakeholder dashboard and an engineering dashboard are different products serving different questions — conflating them produces something useless to both audiences
A dashboard full of green checkmarks and a business making decisions on stale data are not mutually exclusive. They happen together more often than anyone wants to admit.
The on-call rotation had 40 alerts fire in one week. Task duration warnings. Retry notifications. Row count deviations of 2%. A DAG that took six minutes instead of five.
By Thursday, the on-call engineer had muted the Slack channel entirely.
On Friday, the real one came through: a pipeline had been silently writing zero new rows for six hours because a Kafka consumer group had lost its offset and reset to the earliest position, reprocessing old data as if it were current while genuinely new events piled up unread.
The DAG showed green the entire time. Task duration was normal. Row counts looked fine — because the pipeline was faithfully reprocessing six-hour-old data and calling it done.
Nobody saw the alert. The channel was muted. The 40 noise alerts had trained everyone to stop looking at the one that mattered.
Most Pipeline Monitoring Tells You the Pipeline Ran
The default monitoring most teams build tracks whether a job executed and whether it threw an error. This is necessary and completely insufficient. A pipeline can run, complete without error, write a plausible number of rows, and still be operating on stale, wrong, or duplicated data — invisible to any check that only asks “did it run.”
What to Measure vs What Looks Good to Measure
Vanity Metrics That Feel Like Monitoring
These appear on dashboards constantly because they are easy to compute and satisfying to look at. They rarely indicate the failure that actually costs time.
DAG success rate: 99.8%
→ tells you almost nothing about data correctness.
A pipeline that silently reprocesses stale data
"succeeds" every time.
Rows written today: 48,204
→ meaningless without a comparison point.
Is 48,204 normal? Half of normal? Nobody knows
from this number alone.
Average task duration: 4m 12s
→ an average hides the one execution that took 40 minutes
and the three that silently produced empty output in 90 seconds.
The Metrics That Actually Signal Trouble
Freshness: minutes since the last row with a valid, advancing timestamp
→ catches a pipeline that is technically running but not moving forward
Row count vs rolling baseline (not an absolute number)
→ catches silent volume collapse or unexpected spikes
Consumer lag (for streaming sources)
→ catches the exact failure in the opening story: offset reset,
silent reprocessing of stale data
Distinct entity count vs baseline (unique customers, merchants, etc.)
→ catches a pipeline processing fewer distinct sources than usual,
even if total row count looks normal
SLA compliance rate over time, not just today's status
→ a pipeline hitting its SLA 60% of the time this month
is a different problem than one that missed once
The distinction is not sophistication — it’s whether the metric can move independently of whether the code path executed. A metric that only reflects “did the job run” cannot catch a job that ran and did the wrong thing.
Freshness as a First-Class Metric
Why “Job Succeeded” Isn’t Freshness
A job can succeed on a schedule while the underlying data it’s supposed to be moving has stopped advancing — exactly what happened in the opening story. The DAG’s own success signal only confirms the code executed without throwing an exception. It says nothing about whether the data inside the pipeline reflects reality.
Implementation
from pyspark.sql import functions as F
from datetime import datetime, timezone
def check_freshness(spark, table_name: str, timestamp_col: str, max_age_minutes: int):
"""
Freshness is the gap between now and the most recent valid
timestamp actually present in the data — not the time the job last ran.
"""
latest_ts = spark.sql(f"""
SELECT MAX({timestamp_col}) as latest
FROM {table_name}
""").collect()[0]["latest"]
if latest_ts is None:
raise FreshnessError(f"{table_name}: no rows found at all")
age_minutes = (datetime.now(timezone.utc) - latest_ts).total_seconds() / 60
result = {
"table": table_name,
"latest_timestamp": str(latest_ts),
"age_minutes": round(age_minutes, 1),
"passed": age_minutes <= max_age_minutes
}
if not result["passed"]:
raise FreshnessError(
f"{table_name}: freshness violation — most recent row is "
f"{age_minutes:.0f} minutes old, exceeds {max_age_minutes} minute SLA"
)
return result
# This would have caught the opening story's incident directly —
# consumer lag hides in a Kafka metric, but freshness on the final
# table catches the downstream consequence regardless of root cause
check_freshness(spark, "warehouse.transactions", "transaction_timestamp", max_age_minutes=30)Freshness checked against the actual data — not the job’s own completion status — is the single highest-leverage metric for catching the “green but stale” failure class. It doesn’t matter whether the root cause is a Kafka offset reset, a stuck upstream job, or a silently failing API call — if the newest row in the table is older than expected, freshness catches it regardless of cause.
Setting SLAs That Mean Something
SLAs Tied to Consumption, Not Convenience
The most common mistake in SLA-setting: measuring how long the pipeline currently takes, adding a buffer, and calling that the SLA. This produces an SLA that tracks the pipeline’s current behavior rather than what anyone downstream actually needs.
Wrong approach:
"The pipeline currently finishes by 7:15 AM most days.
Let's set the SLA at 8 AM to be safe."
→ This SLA protects nothing. It's just documenting
current performance with padding.
Right approach:
"The executive dashboard is checked at 9 AM daily.
The data needs to be ready and validated by 8:30 AM
to leave room for a stakeholder to notice and escalate
before the number is presented in a meeting."
→ This SLA is derived from an actual consumption deadline.
The SLA Conversation Nobody Has
Setting a meaningful SLA requires asking the consumer a question most data teams skip: when do you actually look at this, and what happens if it’s late? The answer determines the real deadline — not the pipeline’s historical average runtime.
# SLA definition tied to actual consumption need, documented explicitly
PIPELINE_SLAS = {
"revenue_dashboard": {
"consumer": "Finance team, daily 9 AM standup",
"data_needed_by": "08:30",
"rationale": "30 min buffer for anomaly investigation before standup",
},
"fraud_features": {
"consumer": "Real-time fraud scoring model",
"data_needed_by": "continuous, max 5 min staleness",
"rationale": "Feature staleness directly increases fraud exposure window",
},
"weekly_exec_report": {
"consumer": "Leadership team, Monday 10 AM review",
"data_needed_by": "Sunday 18:00",
"rationale": "Allows weekend batch reprocessing if an issue is found",
},
}Documenting the rationale alongside the SLA is what lets a future engineer evaluate whether the SLA still makes sense, rather than treating a number in a config file as an immutable constraint nobody remembers the reason for.
Alert Fatigue and How to Avoid It
Why More Alerts Make Everything Less Safe
Every alert that fires without requiring the recipient to take action erodes trust in the next alert. This is not a discipline problem on the recipient’s part — it is a predictable, well-documented human response to noisy signal, and the fix is entirely on the alert design side, not the person receiving them.
The opening story is the direct consequence: 40 low-value alerts in a week trained the on-call engineer to mute the channel, and the one alert that represented a genuine six-hour data outage went unseen as a result.
Severity Tiers That Actually Route Correctly
def classify_alert_severity(metric_name: str, value: float, baseline: dict) -> str:
"""
Route based on how far outside normal the value is,
not just whether it crossed a binary threshold.
"""
deviation = abs(value - baseline["mean"]) / baseline["std"] if baseline["std"] > 0 else 0
if deviation > 5:
return "critical" # page immediately
elif deviation > 3:
return "warning" # Slack alert, review within business hours
elif deviation > 2:
return "info" # logged, visible on dashboard, no active notification
else:
return "none" # within normal variance, no alert at all
def route_alert(metric_name: str, severity: str, details: dict):
if severity == "critical":
trigger_pagerduty(summary=f"{metric_name}: critical deviation", details=details)
elif severity == "warning":
post_to_slack("#data-pipeline-alerts", format_alert(metric_name, details))
elif severity == "info":
log_to_dashboard(metric_name, details) # no notification, just recorded
# "none" produces no output at all — this is the majority case, by designThe goal is for most metric checks to produce no alert at all, most of the time — because they are within expected variance. A monitoring system where every check fires an alert on every run has confused “measuring something” with “something worth interrupting a human for.”
Dashboard Design for Data Pipelines
What a Stakeholder Actually Needs to See
A business stakeholder checking a pipeline health dashboard is asking one question: can I trust the number I’m about to look at right now? Everything on their dashboard should serve that single question.
Stakeholder dashboard — minimal, decision-oriented:
✅ Data freshness: last updated 12 minutes ago (within SLA)
✅ Reconciliation status: passed (last check: 2 hours ago)
⚠️ Row count: 8% below 30-day average (within tolerance, flagged for awareness)
[Link to detailed engineering dashboard if something looks off]Three lines. A stakeholder can answer their actual question — can I trust this — in five seconds, without needing to understand Spark stages, executor memory, or DAG structure.
What Belongs in an Engineering Dashboard Instead
Engineering dashboard — diagnostic, detail-oriented:
Task-level duration trends over 30 days
Shuffle read/write volume per stage
Executor GC time and memory utilization
Consumer lag per Kafka partition
Historical reconciliation delta trend
Alert history and resolution notesConflating these two into a single dashboard produces something that overwhelms the stakeholder with irrelevant detail and underserves the engineer who needs the depth. Build both, and be explicit about which audience each one serves — a dashboard trying to serve both usually serves neither well.
The Pipeline Monitoring Checklist
Metric selection
□ Freshness is tracked against actual data timestamps, not job completion
□ Row counts are compared to a rolling baseline, not reported as a raw number
□ Consumer lag (for streaming) is monitored independently of job success status
SLA design
□ Each SLA is tied to an actual consumption deadline, with the rationale documented
□ SLAs are revisited when consumption patterns change, not left static indefinitely
□ SLA compliance is tracked over time, not just checked as pass/fail today
Alerting
□ Alert severity is tiered — not every deviation pages someone
□ The majority of metric checks produce no alert at all, by design
□ Alert channels are reviewed periodically for volume — muted channels are a signal
Dashboards
□ A stakeholder-facing dashboard exists, separate from the engineering dashboard
□ The stakeholder dashboard answers "can I trust this data right now" in seconds
□ The engineering dashboard has the depth needed for actual debugging
Final Takeaway
Monitoring that only reflects whether a pipeline executed is monitoring the wrong layer. The failures worth catching are the ones where the pipeline runs, completes, and produces output that looks plausible while being stale, incomplete, or silently wrong — and no amount of “DAG status: success” will ever reveal that.
Freshness, baseline-relative volume checks, and SLAs tied to real consumption needs catch what execution-status monitoring cannot. And none of it matters if alert fatigue has already trained everyone to stop looking.
📌 Core Principle
A green dashboard tells you the pipeline executed. It does not tell you the data is right. Build monitoring for the second claim. The first one is already free.
Next in Series
Schema Evolution Without Breaking Downstream Systems
Your monitoring now catches the failures that matter.
Next: how to evolve schemas without triggering the incidents this whole phase has been building defenses against — forward and backward compatibility patterns, choosing between Avro, Parquet, and JSON for evolution-heavy pipelines, testing schema changes before they ship, and migration strategies for the breaking changes that are genuinely unavoidable.