Skip to content

fix: label job histograms with job_name and the workflow's own name - #30

Merged
JustMaris merged 1 commit into
mainfrom
fix/job-label-and-workflow-names
Oct 5, 2026
Merged

JustMaris merged 1 commit into
mainfrom
fix/job-label-and-workflow-names

Conversation

@JustMaris

Copy link
Copy Markdown
Member

Two labelling bugs in the 1.2.0 job metrics, found from the live dashboard:

  1. job collides with Prometheus's own job label (the scrape job). Prometheus stores ours as exported_job, so every "job" on the dashboard read github-actions-exporter, and the per-job table and legends grouped by the scrape job. The label is now job_name.
  2. Dependabot runs got a new workflow value each run. A run's name field carries Dependabot's per-run title (github_actions in /. - Update #1608293638), which creates new series every run; there were already 8 such values. The label now comes from the workflow list by ID, giving Dependabot Updates, the same name the CI Health table uses. The run's own name is only used for a workflow that is no longer active.

Dashboard:

  • groups by job_name;
  • the table and the run/queue panels filter with >= 0, which drops NaN rows and empty legend entries for jobs with no runs in the selected window but keeps real 0s;
  • the job-count column filters > 0.

README: the label table, the example PromQL and a note on both labels are updated.

Migration: any hand-written query using exported_job on these metrics needs job_name. The old series age out of Prometheus.

go test -race ./... passes, including a new test for the Dependabot naming. All 29 dashboard queries pass promtool check.

Prometheus owns the job label (the scrape job), so the histograms' job label
arrived as exported_job and every dashboard row read github-actions-exporter.
Rename it to job_name.

Dependabot titles each run ("npm_and_yarn in / - Update #123") and the run's
name field carries that title, so every Dependabot run made new series. Take
the workflow label from the workflow list by ID instead, falling back to the
run's name only for a workflow no longer active.

The dashboard groups by job_name and drops NaN rows and empty legend entries
for jobs with no runs in the selected window.
@JustMaris
JustMaris enabled auto-merge (squash) October 5, 2026 18:36
@JustMaris
JustMaris merged commit fd8330f into main Oct 5, 2026
8 checks passed
@JustMaris
JustMaris deleted the fix/job-label-and-workflow-names branch October 5, 2026 18:37
@dnb-robot dnb-robot Bot mentioned this pull request Oct 5, 2026
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