Q&A-2Define a trustworthy DORA measurement pipeline.
Answer
A trustworthy DORA pipeline is one where every metric has a single versioned definition, a stable join key across systems, and a known error budget for missing or late data. Start with one service, one deploy pipeline, and one incident source. Don't try to cover the whole org on day one.
Assume you have: a CD system that emits deployment events (Argo CD, Spinnaker, GitHub Actions), a VCS (GitHub/GitLab), an incident tool (PagerDuty), and a service catalog (Backstage). You're measuring at team level, not individual. DORA 2023 elite performers: deploy on demand, lead time <1 day, change fail rate 5%, recovery <1 hour. Those are your targets, not your baseline.
The join key is the service ID from the catalog. Map repo → service, pipeline → service, incident → service. Bots: filter by author email domain or [bot] suffix. Retries: dedupe by deployment ID + commit SHA + environment. Rollbacks: count as deployments but tag is_rollback=true. Hotfixes: count as deployments, tag is_hotfix=true.
All timestamps must be UTC, from NTP-synced sources. If a source only gives local time, record the offset. A 2-hour skew can turn a 1h30m lead time into 30m or negative.
Definitions:
- Change lead time: median time from first commit in the change to deploy to production.
- Deployment frequency: count of deployments to production per day.
- Change fail rate: failed deployments / total deployments.
- Failed deployment recovery time: median time from failure detection (incident open or alert) to recovery (incident resolved or rollback complete).
- Deployment rework rate: deployments that are rework / total deployments.
Version every definition. When you change a denominator, bump the version and backfill or annotate the change. Expose freshness: last event timestamp per source. If a source is >15 min stale, flag it.
Trade-offs: event-based (CD webhooks) vs deployment-record (manual logs). Event-based is fresher but noisy; deployment-record is cleaner but stale. Sampling vs full instrumentation: full instrumentation for deploys, sampling for lead time if commit volume is huge. Deciding criteria: if you have <100 deploys/day, full instrumentation is cheap. If you have >1000, sample commits.
Failure modes:
- Missing joins: a deploy with no commit → lead time undefined. Detect by coverage ratio: % of deploys with a commit. If <95%, investigate.
- Clock skew: negative lead times. Detect by min(lead_time) < 0.
- Bot commits: inflate lead time. Detect by author email.
- Retries: duplicate deploys. Detect by duplicate deployment ID.
- Ownership changes: service renamed → broken join. Detect by orphaned service IDs.
Artefacts:
Table: metric definitions.
| Metric | Numerator | Denominator | Window | Source |
|---|---|---|---|---|
| Deployment frequency | deployments to prod | 1 day | 1 day | CD |
| Change lead time | first commit to deploy | 1 change | 1 change | VCS + CD |
| Change fail rate | failed deployments | total deployments | 1 week | CD + incidents |
| Failed deployment recovery time | detection to recovery | 1 failure | 1 failure | incidents + CD |
| Deployment rework rate | rework deployments | total deployments | 1 week | CD |
Arithmetic: clock skew. Commit at 13:30 UTC. Deploy at 14:00 UTC+2 (which is 12:00 UTC). Lead time = -90 min. If you ignore the offset, you get +30 min. That's a 2-hour error.
Code snippet:
from datetime import datetime, timezone
def lead_time_minutes(commit_ts, deploy_ts):
c = datetime.fromisoformat(commit_ts)
d = datetime.fromisoformat(deploy_ts)
if c.tzinfo is None:
c = c.replace(tzinfo=timezone.utc)
if d.tzinfo is None:
d = d.replace(tzinfo=timezone.utc)
return (d - c).total_seconds() / 60Trace: commit_ts = "2024-06-01T13:30:00", deploy_ts = "2024-06-01T14:00:00+02:00". c = 13:30 UTC. d = 12:00 UTC. lead_time = -90.0 minutes. That's the bug. Fix: require tz-aware timestamps or record offset.
What would change the decision? If coverage <95% or negative lead times >1%, stop and fix the pipeline before trusting any trend. Use team trends and improvement conversations, not individual or cross-context rankings.
Curated: · Written: · Reviewed:
Log in free to save your progress and keep bookmarks and notes for a quick revision before your interview.