fix(dora): count failed deployments, not incidents, in Change Failure Rate#8890
Open
spiffaz wants to merge 1 commit into
Open
fix(dora): count failed deployments, not incidents, in Change Failure Rate#8890spiffaz wants to merge 1 commit into
spiffaz wants to merge 1 commit into
Conversation
… Rate The Change Failure Rate panels summed `has_incident`, which was the count of distinct incidents per deployment. A deployment that caused multiple incidents was counted multiple times, inflating CFR above the DORA definition (deployments that caused a failure / total deployments). Make `has_incident` a 0/1 flag so each deployment counts once regardless of how many incidents it caused, and relabel the companion stat from "incident count" to "failed deployment count" so the displayed counts match the rate. Validated against a production dataset: a 30-day window with 6 incidents across 4 deployments out of 23 total dropped from 26.1% to the correct 17.4%. Signed-off-by: Spiff Azeta <spiffazeta@yahoo.com>
Contributor
|
@Startrekzky Please take a look when you find time, thx. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What does this PR do?
The Change Failure Rate dashboard (
grafana/dashboards/DORADetails-ChangeFailureRate.json) computes the rate assum(has_incident) / count(deployment_id), wherehas_incidentiscount(distinct i.id)per deployment, i.e. the number of incidents a deployment caused.When one deployment causes more than one incident, it is counted multiple times in the numerator, so the rate exceeds the DORA definition of Change Failure Rate (the share of deployments that caused a failure, not the number of incidents).
This makes
has_incidenta 0/1 flag (CASE WHEN count(distinct i.id) > 0 THEN 1 ELSE 0 END) so each failed deployment counts once, and relabels the companion stat panel field from "incident count" to "failed deployment count" so the displayed counts stay consistent with the rate.Validation
Against a production dataset, a 30-day window had 6 incidents spread across 4 distinct deployments out of 23 total:
Only the SQL in the two CFR panels changed; no datasource, layout, or variable changes.