Add workflow and scaleset job ID to metrics and fixes

This change adds workflow job ID, scaleset job ID and workflow run ID
to the metrics.

This change also attempts to fix how jobs are recorded when a workflow
is posted by a webhook, but the job is handled by a scale set.

Signed-off-by: Gabriel Adrian Samfira <gsamfira@cloudbasesolutions.com>
This commit is contained in:
Gabriel Adrian Samfira 2026-02-14 18:15:11 +02:00 committed by Gabriel
parent c8844e543c
commit 3ceb2f7ebb
4 changed files with 53 additions and 13 deletions

View file

@ -63,7 +63,7 @@ func formatJobs(jobs []params.Job) {
return
}
t := table.NewWriter()
header := table.Row{"ID", "Name", "Status", "Conclusion", "Runner Name", "Repository", "Requested Labels", "Locked by"}
header := table.Row{"Workflow Job ID", "Scale Set Job ID", "Name", "Status", "Conclusion", "Runner Name", "Repository", "Requested Labels", "Locked by"}
t.AppendHeader(header)
for _, job := range jobs {
@ -72,7 +72,7 @@ func formatJobs(jobs []params.Job) {
if job.LockedBy != uuid.Nil {
lockedBy = job.LockedBy.String()
}
t.AppendRow(table.Row{job.ID, job.Name, job.Status, job.Conclusion, job.RunnerName, repo, strings.Join(job.Labels, " "), lockedBy})
t.AppendRow(table.Row{job.WorkflowJobID, job.ScaleSetJobID, job.Name, job.Status, job.Conclusion, job.RunnerName, repo, strings.Join(job.Labels, " "), lockedBy})
t.AppendSeparator()
}
fmt.Println(t.Render())