Skip to content

Support repository-wide workflow metrics and job step durations - #868

Open
uzairchhapra wants to merge 1 commit into
grafana:mainfrom
uzairchhapra:feat/repository-workflow-metrics
Open

uzairchhapra wants to merge 1 commit into
grafana:mainfrom
uzairchhapra:feat/repository-workflow-metrics

Conversation

@uzairchhapra

Copy link
Copy Markdown

Type of Change

  • 🚀 Feature

Feature

What is this feature?

Leave Workflow blank in Workflow Runs to return repository-wide runs using GitHub's repository Actions endpoint. Existing workflow ID and file name filters still work. The new Workflow Job Steps query uses the same optional filters and exposes per-step duration for bottleneck dashboards.

Why is this needed?

Dashboards should be able to count run outcomes across a repository without enumerating workflows. The step query also provides the step-level durations requested in #326.

How to test

  1. In Grafana Explore, use the GitHub data source and set Owner grafana, Repository github-datasource, and the UTC range November 17, 2026, 00:00:00–23:59:59.
  2. Run Workflow Runs with Workflow blank. Group by conclusion and count id for repository-level outcomes. Populate a workflow ID to narrow the results to one definition.
  3. Switch to Workflow Job Steps with Workflow blank, and group by workflow_name, job_name, and step_name to compare step durations.

Verification

  • Built frontend and backend, loaded the plugin into local Grafana 13.1.9, and exercised the real /api/ds/query path against GitHub. The range above returned 16 runs across 8 workflows (12 successful, 4 skipped). The workflow ID filter returned a single workflow. The steps query returned 622 steps across 7 workflows; all 500 measured durations matched the difference between completion and start timestamps.
  • Added Go tests for repository and workflow-specific endpoints, pagination, and completed, in-progress, and skipped steps. Added query documentation and a changeset.

Special notes for your reviewer

The time filter is based on run creation. To limit GitHub requests, step details are scoped to the latest attempt of the 50 most recent matching runs and show a warning on truncation. Workflow Runs is the intended source for repository-level counts. Self-hosted runner assignment latency is not inferred from workflow or step timestamps.

Refs #326, #508, and #173.

Allow workflow runs across all workflows and expose job step durations.

Refs grafana#326
@uzairchhapra
uzairchhapra requested a review from a team as a code owner November 18, 2026 04:11
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.

1 participant