Skip to content
tezvyn:
Menu

How would you instrument CI/CD to measure a DORA metric accurately?

Source: github.comMediumHow cards are made

Tests mapping DORA definitions to pipeline events. A strong answer picks one metric, defines exact boundaries from merge to production, and correlates deployments with incidents.

What's really being asked

This question tests whether you understand that DORA metrics are operational definitions, not dashboard fantasies. The interviewer wants to see if you can decompose an abstract metric like Change Failure Rate into discrete events that a CI/CD system can actually emit, and whether you understand data integrity problems like duplicate events, clock skew, and semantic ambiguity. Senior candidates should demonstrate that they have shipped measurement systems, not just read about them.

The full answer

First, pick a single metric and define it precisely. For Change Failure Rate, define it as the percentage of production deployments that cause an incident requiring remediation. Second, identify the two event streams you need: deployment events and incident events. Third, explain the instrumentation mechanism, such as emitting a structured deployment event from your CD pipeline when a canary reaches 100 percent traffic, and emitting an incident event from your paging system when a Severity-1 is triggered. Fourth, explain correlation logic, such as attributing an incident to the most recent deployment if it starts within one hour and affects the same service. Fifth, mention data quality guards, like deduplicating retries in your event handler and excluding rollbacks from the numerator but including them in the denominator.

The mistakes people make

Treating every Git push or pull request merge as a deployment. Measuring Lead Time for Changes from ticket creation rather than commit merge. Using build failure counts in the Change Failure Rate numerator, which actually measures build reliability, not production stability. Proposing to poll GitHub instead of using event-driven webhooks, which introduces lag and misses events. Suggesting manual spreadsheets or surveys instead of automated pipeline instrumentation.

What usually comes next

How do you handle deployments that are rolled back automatically by a canary analysis tool before they reach full traffic? How do you compare a monorepo with hundreds of services against a polyrepo when calculating deployment frequency? What happens if your incident management tool and deployment tool disagree on timestamps due to timezone or clock skew? How would you validate that your metric is actually predicting business outcomes?

A concrete example

Imagine you choose Lead Time for Changes. You would instrument by capturing the merge commit timestamp from the GitHub push webhook payload when a PR lands in main. You capture the deployment timestamp from a custom event fired by ArgoCD when an Application sync succeeds and the new image tag matches the merge commit SHA. You store both events in a warehouse table keyed by commit SHA and service name. Lead time is calculated as deployment timestamp minus merge commit timestamp, filtered to the first successful deployment of that commit to production. You exclude hotfix branches and filter out commits that only change documentation by checking file paths in the webhook payload.

Interview question

Which event pairing correctly defines the numerator and denominator when instrumenting Change Failure Rate in a CI/CD pipeline?

  • a.Production deployments causing an incident requiring remediation as the numerator and all production deployments reaching full traffic as the denominator, instrumented via CD pipeline events.Correct
  • b.Every Git push or pull request merge as the denominator and any Severity-1 page as the numerator, instrumented via source control webhooks.
  • c.Any production incident as the numerator and every deployment attempt including failed canaries as the denominator, instrumented via incident management timestamps.
  • d.Failed CI builds or test stages as the numerator and successful production deployments as the denominator, instrumented via CI failure events.
Why?

Change Failure Rate is the percentage of production deployments reaching full traffic that cause an incident requiring remediation, so it must use CD pipeline events rather than CI failures or source control merges. The most tempting distractor treats Git pushes as deployments, but a merge to main is not a production deployment and would corrupt the denominator.

Just read this? Test yourself on what you have been reading.

Read the original → github.com

Put your scrolling time to good use

Learn one idea, try a quiz and save useful cards for revision. Tezvyn makes it easy to learn and stay current in your tech field, a few minutes at a time.

The iPhone app is on the way

We are building it. Until it lands, nothing here is held back from you: every interview card, your saved cards, streaks and the job board all work in Safari, plus hundreds of free practice quizzes of thirty questions each. Sign in and it all carries over to the app the day it arrives.

Want it as an icon? Tap Share at the bottom of Safari, then Add to Home Screen. It opens full screen and the cards you have read stay available offline.

Get it on Google PlayiPhone app coming soon

We are hiring for this. Every open role lists the topics its interview covers, so you can prepare for the real thing rather than guessing.

See open roles