Repository navigation
Add a Merge Queue Timings query - #867
Open
uzairchhapra wants to merge 1 commit into
Open
uzairchhapra wants to merge 1 commit into
uzairchhapra wants to merge 1 commit into
Conversation
Reconstruct queue attempts from pull request timeline events and expose durations for Grafana dashboards. Refs grafana#866
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.
Type of Change
Feature
What is this feature?
Adds Merge Queue Timings to the GitHub data source. It pairs GitHub pull request timeline enqueue and removal events and returns one row per attempt with timestamps, exit reason, and
duration_seconds. A retry is a separate row, and an attempt without a matching removal has no finalized duration. Both PR search and timeline continuation are paginated.Why is this feature needed?
Workflow Runs and Check Runs measure CI execution, not how long a pull request spent in the merge queue. Queue attempts let teams build duration distributions or compare successful merges and other exits without mixing those timings.
Who is this feature for?
Teams using GitHub's native merge queue who want to visualize queue latency in Grafana.
How to test this feature
githuband repositorydocs.08:50:00through08:52:00. Find PR#46973: enqueue at08:45:01Z, exit at08:50:56Z, reasonmerged, duration355seconds.duration_secondsto a Histogram panel; optionally filter toexit_reason = merged.Closes #866.
Please check that:
Verification
go test ./...Special notes for your reviewer
The dashboard range selects PRs by
updated_at; the query then returns their full queue history. This is not an event-time filter, and the docs call out that later PR updates can change a historical selection. The first page of timeline events is fetched with PR search to avoid a separate request per PR for the common case. This change does not aggregate individual PR or merge-group checks.Local Grafana smoke test: Verified through local Grafana 13.1.9 using
/api/ds/queryagainst live GitHub data.github/docs#46973returned a merged attempt of 355 seconds with the expected timestamps and seconds unit. A range with no matching PR returned zero rows with the same frame schema. This exercised the installed plugin through Grafana, not the browser UI.