From e8e4f33324d2baa956a3666881cfafeb7f27cec0 Mon Sep 17 00:00:00 2001 From: sindunuragarp Date: Mon, 13 Nov 2023 10:32:28 +0100 Subject: [PATCH] add runner_name label to jobs_completed_total --- pkg/actionsmetrics/event_reader.go | 2 +- pkg/actionsmetrics/metrics.go | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/pkg/actionsmetrics/event_reader.go b/pkg/actionsmetrics/event_reader.go index 606891fe5e2..201268b0467 100644 --- a/pkg/actionsmetrics/event_reader.go +++ b/pkg/actionsmetrics/event_reader.go @@ -137,7 +137,7 @@ func (reader *EventReader) ProcessWorkflowJobEvent(ctx context.Context, event in githubWorkflowJobQueueDurationSeconds.With(labels).Observe(parseResult.QueueTime.Seconds()) case "completed": - githubWorkflowJobsCompletedTotal.With(labels).Inc() + githubWorkflowJobsCompletedTotal.With(extraLabel("runner_name", *e.WorkflowJob.RunnerName, labels)).Inc() // job_conclusion -> (neutral, success, skipped, cancelled, timed_out, action_required, failure) githubWorkflowJobConclusionsTotal.With(extraLabel("job_conclusion", *e.WorkflowJob.Conclusion, labels)).Inc() diff --git a/pkg/actionsmetrics/metrics.go b/pkg/actionsmetrics/metrics.go index 972a6f9f5eb..877b905b814 100644 --- a/pkg/actionsmetrics/metrics.go +++ b/pkg/actionsmetrics/metrics.go @@ -175,7 +175,7 @@ var ( Name: "github_workflow_jobs_completed_total", Help: "Total count of workflow jobs completed (events where job_status=completed)", }, - metricLabels(), + metricLabels("runner_name"), ) githubWorkflowJobFailuresTotal = prometheus.NewCounterVec( prometheus.CounterOpts{