Skip to content

[Feature Request] Add a Merge Queue Timings query #866

Open

Description

@uzairchhapra

Problem

The GitHub data source can show workflow runs and individual Check Runs for a git ref (see #802), but neither measures how long a pull request spends in GitHub's merge queue. A workflow start or end timestamp cannot substitute for queue entry or exit, especially when a pull request is removed and re-queued.

How to reproduce

  1. In Grafana Explore, select the GitHub data source and a repository using GitHub's native merge queue (for example, github/docs).
  2. Look for a way to chart time spent in the queue by pull request or calculate a percentile across attempts. Workflow Runs and Check Runs expose run/check timing, but not queue entry and exit.
  3. Compare with github/docs#46973: its GitHub GraphQL timeline reports entry at 2026-11-17T08:45:01Z and removal with reason merged at 2026-11-17T08:50:56Z (355 seconds).

Environment: GitHub.com and the GitHub data source at upstream main (7e74934). The API example was verified against GitHub.com.

Proposal

Add a Merge Queue Timings query backed by GitHub's pull request timeline (AddedToMergeQueueEvent and RemovedFromMergeQueueEvent). Return one row per attempt, with repository, pull request number and link, enqueue and exit timestamps, exit reason, and duration in seconds. Grafana can then calculate percentiles or group by exit reason without conflating queue time with check runtime.

Acceptance criteria

  • A re-queued PR produces separate rows, including for merge and non-merge exits.
  • Active attempts have no exit time or finalized duration; no queue history returns no rows.
  • Paginate both PR discovery and queue history. Document how the Grafana time range selects PRs and show how to aggregate duration in a panel.
  • Existing Pull Requests, Check Runs, and Workflow Runs queries remain unchanged. Per-PR check aggregation and merge-group check breakdowns are out of scope for this first query.

Reference: GitHub GraphQL pull request timeline types.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions