Pipeline Operations: Beginner
What you will be able to do
Script vs Operable Pipeline
Recognize the operational gap between a working script and a pipeline that can be run as a service.
Five Things a Script Does Not Have
| Operational Property | What a Script Lacks | What an Operable Pipeline Provides |
|---|---|---|
| Run identity | No record of which run produced which output | A run_id stamped on every artifact and every log line |
| Visibility | Standard out scrolls past and disappears | Structured logs and metrics flow to a durable store |
| Failure signal | A nonzero exit code that nobody is watching | Alerts routed to a channel where someone is paged |
| Recovery | A human reads the source code and guesses | A runbook names the symptom and the response |
| Idempotent retries | Re-running corrupts state or duplicates rows | Re-running produces the same result as the first run |
The Operability Gap, Made Concrete
- ▸Every log line carries the run_id, which threads logs back to a single execution
- ▸Two metrics turn 'did anything happen' into a number on a dashboard
- ▸The start and done lines bound the run; their absence is itself a signal
- ▸The output write carries the run_id so a downstream reader can audit which run produced what
The Three Audiences for an Operable Pipeline
- Success is defined as 'it ran without an exception'
- Output is the only artifact that matters
- Logs are stdout, examined when something goes wrong
- Re-running is dangerous because state is unpredictable
- Success is defined as 'it ran, succeeded, and produced output of the right shape'
- Output and metadata are both first-class artifacts
- Structured logs and metrics flow continuously to a durable store
- Re-running is safe by construction; idempotency is built in
Logs, Metrics, and Traces
Distinguish logs, metrics, and traces and pick the right signal for a given operational question.
Logs in One Paragraph
Metrics in One Paragraph
Traces in One Paragraph
| Signal | Best Question to Answer | Worst Question to Force It to Answer |
|---|---|---|
| Logs | What happened on this specific run, in detail | What is the average duration over the last quarter |
| Metrics | Is the system healthy right now; how does it trend | What was the exact error message the pipeline emitted at 03:14 |
| Traces | Where is the latency in this multi-step run | What is the row count of the third table written yesterday |
A Tiny Worked Example
- ▸Need to debug a single failure after the fact: add a log line
- ▸Need a dashboard or threshold alert: add a metric
- ▸Need to understand where time was spent across multiple steps: add a span (trace)
- ▸Never use a log search to compute aggregate trends; metrics are cheaper and faster
Logs answer 'what.' Metrics answer 'how much.' Traces answer 'where.' A pipeline missing any one of the three has a blind spot.
- Log structured JSON with a stable set of fields, not free text
- Keep metric cardinality small: pipeline_name and table_name are fine, user_id is not
- Wrap multi-step pipelines in trace spans to make latency attributable
- Use log search to compute trend metrics; the cost grows linearly with retention
- Tag metrics with high-cardinality fields like email or order_id
- Skip structured logging because 'print is fine for now'
Day-One Monitoring
Choose the smallest set of monitors that makes a new pipeline operable on day one.
The Three Day-One Monitors
| Monitor | Question Answered | Failure Mode It Catches |
|---|---|---|
| Did it run | Did the scheduled job actually fire today | Scheduler outage, deployment removed the job, cron expression broken |
| Did it succeed | Did the run exit with a success status | Code error, source unavailable, downstream write rejected |
| Was the output the right size | Is the row count within the expected range | Source schema change, silent filter, partial extract, empty join |
Did It Run
Did It Succeed
Was the Output the Right Size
- ▸A scheduler-level alert when no run record exists by the expected start time plus tolerance
- ▸An orchestrator-level alert on the most recent run's failure status
- ▸A data-level alert on the latest partition's row count being outside the expected band
- ▸A heartbeat for long-running tasks so a hung process is distinguishable from a finished one
Why These Three and Not Others
- Three checks: ran, succeeded, right size
- Each check has a clear owner and a clear response
- Alerts route to a channel where someone is on call
- False positive rate is tolerable; alarm fatigue is low
- Twenty checks copied from a vendor template
- Half of them fire weekly with no clear owner
- Alerts route to email; nobody reads the channel
- Alarm fatigue is high; real alerts get missed
An operable pipeline emits logs, metrics, and traces; monitoring compares them to SLAs and pages on-call when one breaks. Without this, you find out a pipeline failed when a VP asks why the numbers are wrong.
Alerting That Stays Useful
Route alerts by severity so on-call engineers can respond without burning out on noise.
Three Tiers of Severity
| Tier | Routing | Example Trigger |
|---|---|---|
| Page | PagerDuty, phone wake-up, on-call rotation | Pipeline feeds a customer-facing system and has missed its SLA |
| Slack channel | Notification channel watched during business hours | Daily DAG failed; will retry at next scheduled run |
| Email digest | Daily roll-up that nobody opens until something is wrong | Row count drifted by 5% over the past week |
The Test for Page-Worthy
- ▸Every alert names the action expected of the on-call engineer; if there is nothing to do, do not page
- ▸Every recurring false positive is investigated and the threshold is tuned, not silenced
- ▸An alert that fires more than once a week without a real cause is moved to a lower tier or removed
Page on Real Problems
Email on Weird-but-OK
What an Alert Should Contain
- Generic stack traces with no symptom summary
- No link to a runbook; on-call has to read source code
- Fire on weak signals like minor row-count drift
- Route everything to one channel regardless of urgency
- One-line symptom: 'fct_revenue is 65 minutes stale, SLA 60 minutes'
- Link to a runbook with the standard response steps
- Fire only on conditions that demand action within the alert tier's window
- Route by severity: page for now, Slack for soon, email for FYI
Alarm fatigue is not the on-call engineer's failure of attention. It is the alert author's failure of restraint. Every alert that fires for nothing trains the team to ignore alerts.
A First Runbook
Draft a runbook with symptom, impact, diagnosis, response, and escalation sections that an unfamiliar engineer can follow.
What a Runbook Contains
| Section | Contents | Purpose |
|---|---|---|
| Symptom | The alert text and what it means in plain language | Confirms that the responder is reading the right runbook |
| Impact | Who is affected and how badly, in business terms | Sets the urgency: customer-facing or internal-only |
| Diagnosis steps | An ordered list of checks to identify the cause | Threads the responder through the most likely failure modes |
| Response actions | The fix for each likely cause, with commands or links | Lets the responder act, not just diagnose |
| Escalation | Who to contact if the runbook does not resolve the issue | Bounds the responder's solo problem-solving time |
A Runbook for the Daily Orders DAG
Why Runbooks Get Written and Then Stop Working
- ▸Every postmortem produces a runbook update or a new runbook entry
- ▸Every alert links to its runbook; broken links are a CI check
- ▸Quarterly runbook review: an engineer who has not read the runbook follows it on a recent incident and edits as needed
- ▸Runbooks live in version control next to the pipeline code, not in a separate wiki
The First Runbook Is the One That Saves the Most Time
- Write the runbook the first time the alert fires, not the third
- Link every alert directly to its runbook URL
- Update the runbook during the resolution, while the context is fresh
- Treat runbooks as architecture documentation; they are response checklists
- Let runbooks live in a separate wiki that drifts from the code
- Write 'contact Eric' as the response; Eric will leave the company
> A new data engineer inherits the orders_daily pipeline. There are no monitors, no runbook, and the previous owner left two months ago. The pipeline runs every night at 2am and feeds three downstream consumers. The first task is to make the pipeline operable before the next failure happens. Where does the engineer start, and what do they build first?
A pipeline that runs once is a script; one that survives Monday morning is operated
- Category
- Pipeline Architecture
- Difficulty
- beginner
- Duration
- 25 minutes
- Challenges
- 0 hands-on challenges
Topics covered: Script vs Operable Pipeline, Logs, Metrics, and Traces, Day-One Monitoring, Alerting That Stays Useful, A First Runbook
Lesson Sections
- Script vs Operable Pipeline (concepts: paMonitoring)
A working script is a piece of code that produces the right answer when nothing goes wrong. An operable pipeline is a piece of code that someone can run, watch, debug, and recover from at three in the morning, six months after it was written, by a person who has never read its source. The two are not on the same axis. A script can be technically excellent and operationally useless. A pipeline can have ugly code and survive years of production because it tells operators what is happening. The bar
- Logs, Metrics, and Traces (concepts: paMonitoring)
Three classes of signal show up in every observability discussion: logs, metrics, and traces. The vocabulary matters because each one answers a different question and has different storage and cost characteristics. Mixing them up produces dashboards that cost too much, alerts that fire on the wrong condition, and debugging sessions that bog down because the right signal is missing. The three are sometimes called the three pillars of observability. The framing comes out of the SRE community at Go
- Day-One Monitoring (concepts: paMonitoring)
A new pipeline does not need fifty monitors. It needs three. Did it run, did it succeed, and was the output the right size. Those three monitors catch most of the failure modes that show up in the first month. Adding more monitors before those three exist is premature optimization; adding fewer leaves blind spots that consumers will discover before the pipeline does. The Three Day-One Monitors Did It Run The simplest monitor is also the most embarrassing one to forget. A pipeline scheduled for 2
- Alerting That Stays Useful (concepts: paMonitoring)
An alert is a request for human attention. Every alert that fires is a withdrawal from the on-call engineer's attention budget. A pipeline that pages on every minor anomaly bankrupts its on-call within weeks; the engineers stop reading the channel and the next real outage is missed. The discipline is to ration alerts so that the ones that fire are the ones that need a human to act now. The economics are stark: an engineer who responds to twenty pages a week treats the twenty-first as another rou
- A First Runbook (concepts: paMonitoring)
A runbook is a document that tells an on-call engineer what to do when a specific alert fires. It is not architecture documentation. It is not design rationale. It is a checklist tuned for the moment when something is wrong, the on-call has been paged, and the question is what to check first. A good runbook can be followed by an engineer who has never seen the pipeline before. A bad runbook is a wiki page that says 'contact Eric.' The shape of a useful runbook is closer to an emergency-room inta