Explore the complete learning track from Linux fundamentals to advanced GitOps and Terraform. Packed with practical terminal sessions and real-world architectures.
Lesson 5 of 6β’25 min
Pipeline Metrics, MTTR & DORA Metrics
If your CI/CD pipeline goes down, 100 developers are blocked from shipping code. Yet most teams monitor their application carefully and ignore their pipeline entirely β until it breaks at 2 AM before a critical release.
Elite DevOps teams treat the pipeline as a mission-critical production system: it gets dashboards, alerts, SLOs, and continuous optimization.
DORA Metrics: The Industry Standard
The DevOps Research and Assessment (DORA) team at Google studied thousands of engineering teams over several years. They identified 4 metrics that statistically distinguish elite from low performers β and proved that improving these metrics directly improves business outcomes.
100%
Rendering interactive visual diagram...
The Four DORA Metrics
Metric
Measures
Elite
Low
Deployment Frequency
How often code ships to production
Multiple/day
Monthly or less
Lead Time for Changes
Commit β production
< 1 hour
1β6 months
Mean Time to Recovery (MTTR)
Incident detected β service restored
< 1 hour
1 weekβ1 month
Change Failure Rate
% of deploys causing incidents
0β15%
46β60%
The key insight: Velocity and stability are NOT in conflict. Elite teams deploy more frequently AND have fewer failures. Rigorous testing, automation, and small batch sizes enable both simultaneously.
Collecting DORA Metrics
bash
# Deployment Frequency β from GitHub API
gh api \
/repos/OWNER/REPO/deployments \
--jq '[.[] | select(.environment == "production")] | length' \
-H "Accept: application/vnd.github+json"
# Lead Time β from PR merged to deployment
# (commit timestamp β production deployment timestamp)
gh api /repos/OWNER/REPO/pulls \
--jq '.[] | {number: .number, merged_at: .merged_at, head_sha: .merge_commit_sha}' | \
head -20
# Change Failure Rate β incidents vs deployments
INCIDENTS=$(gh api /repos/OWNER/REPO/issues \
--jq '[.[] | select(.labels[].name == "incident" and (.created_at > "2026-01-01"))] | length')
DEPLOYS=$(gh api /repos/OWNER/REPO/deployments \
--jq '[.[] | select(.created_at > "2026-01-01")] | length')
echo "CFR: $((INCIDENTS * 100 / DEPLOYS))%"
Automated DORA with Four Keys (Google)
bash
# Google's open-source DORA metrics tool
git clone https://github.com/GoogleCloudPlatform/fourkeys.git
cd fourkeys
# Deploy with Cloud Run + BigQuery (measures from GitHub/GitLab/Tekton events)
# Dashboard auto-generates all four DORA metrics
gcloud run deploy --source . --region us-central1
Key Pipeline Metrics to Monitor
Beyond DORA, track these pipeline-specific metrics:
GitHub Actions charges by runner-minute. An unoptimized pipeline wastes money and time:
yaml
# Cancel in-progress runs on new push (don't wait for old jobs)
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
# Only run expensive jobs on push to main, not on every PR
scan-container:
if: github.ref == 'refs/heads/main'
...
# Use caching aggressively
- uses: actions/cache@v4
with:
path: ~/.npm
key: ${{ runner.os }}-node-${{ hashFiles('**/package-lock.json') }}
restore-keys: |
${{ runner.os }}-node-
# Run independent jobs in parallel (not sequential)
jobs:
unit-test: { ... }
lint: { ... } # Runs in parallel with unit-test
type-check: { ... } # Runs in parallel with unit-test and lint
integration:
needs: [unit-test, lint, type-check] # Only after all three pass
DORA metrics create a feedback loop for engineering improvement:
100%
Rendering interactive visual diagram...
Practical cadence:
Weekly: review build duration trend and flaky test count
Monthly: review DORA metrics against team targets
Quarterly: set improvement goals (e.g., "reduce Lead Time from 45min to 20min")
Teams that display pipeline metrics on office dashboards (or in weekly standup) gamify the improvement cycle β when the team sees Lead Time drop from 45 minutes to 20 minutes because of a Dockerfile cache optimization, it creates momentum for more improvements.
Summary
Observable CI/CD pipelines are measured, alertable, and continuously improved:
DORA metrics (Deployment Frequency, Lead Time, MTTR, Change Failure Rate) are the industry-standard KPIs for DevOps health β elite teams deploy frequently AND have low failure rates
Monitor build duration trend (cache degradation), queue time (runner saturation), and flaky test rate (pipeline reliability)
Export metrics to InfluxDB + Grafana or use Google Four Keys for automatic DORA dashboards
Cancel in-progress runs on new push; run independent jobs in parallel; use conditional job execution to skip expensive scans on PRs
Alert on failures via Slack with full context (repo, commit, actor, run URL)
Use DORA metrics to drive a quarterly improvement cycle β measure β analyse β improve β re-measure
In the next lesson, you will learn rollback strategies and incident automation β how to recover from production failures in seconds rather than hours.