Skip to content

Add attempted merge and hotfix metrics#312

Open
tijmendj wants to merge 4 commits intomasterfrom
add-merge-attempt-metrics
Open

Add attempted merge and hotfix metrics#312
tijmendj wants to merge 4 commits intomasterfrom
add-merge-attempt-metrics

Conversation

@tijmendj
Copy link
Copy Markdown

Used for finding change failure rates. Can also be used to find if merges failed.

@tijmendj tijmendj requested a review from Riscky April 20, 2026 13:26
Copy link
Copy Markdown

@Riscky Riscky left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We never explicitly register failures, just (successful) attempts. Do we also want to register failures?

Also I'd recommend registering the priority as a label, so you'd get:

hoff_project_merge_attempted_pull_requests{priority="high"}
hoff_project_merge_attempted_pull_requests{priority="normal"}

instead of two separate metrics

@tijmendj
Copy link
Copy Markdown
Author

We never explicitly register failures, just (successful) attempts. Do we also want to register failures?

I assumed that your failures can be derived from subtracting the successful attempts from your total attempts. If that's unwise we could look into tracking failures separately instead

@Riscky
Copy link
Copy Markdown

Riscky commented Apr 24, 2026

I assumed that your failures can be derived from subtracting the successful attempts from your total attempts. If that's unwise we could look into tracking failures separately instead

Not really, while the attempt it ongoing it will be added to one of the two metrics, but not the other (because we don't know if it will succeed yet)

@tijmendj tijmendj requested a review from maartenberg April 28, 2026 13:59
Copy link
Copy Markdown
Member

@maartenberg maartenberg left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I agree with Rick's suggestion for the metrics design: I think it's better to alter the existing hoff_project_merged_pull_requests to add a priority label, rather than introducing a new metric to track specifically the PRs merged with priority.

I also agree with Rick that only tracking attempted and completed merges can be used to detect failures: if we want to track failures we should probably add a new metric to track merge failures, grouped by repository, priority and failure reason (the options in

hoff/src/Git.hs

Lines 200 to 206 in adb1b34

data GitIntegrationFailure
= MergeFailed
| RebaseFailed
| WrongFixups
| EmptyRebase
| FailedForcePush Text
deriving (Show, Eq, Generic)
).

We could also consider keeping a gauge with the number of PRs in the merge queue for every repository, but this is probably more cumbersome to implement.

tijmendj added 2 commits May 8, 2026 11:37
Instead of a separate hoff_project_priority_merged_pull_requests counter,
add a priority label to the existing hoff_project_merged_pull_requests
counter. This lets us track merged PRs by priority (normal/high) in a
single metric.
Add hoff_project_merge_failed_pull_requests counter that tracks
integration failures grouped by project, priority (normal/high), and
failure reason (merge_failed, rebase_failed, wrong_fixups, empty_rebase,
failed_force_push). The metric is recorded in tryIntegratePullRequest
when integration fails with a GitIntegrationFailure.
@tijmendj tijmendj requested a review from maartenberg May 8, 2026 10:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants