Skip to content

Commit

Permalink
check for existence of runner name
Browse files Browse the repository at this point in the history
  • Loading branch information
sindunuragarp committed Nov 14, 2023
1 parent 2540551 commit 70e3260
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion pkg/actionsmetrics/event_reader.go
Original file line number Diff line number Diff line change
Expand Up @@ -137,7 +137,11 @@ func (reader *EventReader) ProcessWorkflowJobEvent(ctx context.Context, event in
githubWorkflowJobQueueDurationSeconds.With(labels).Observe(parseResult.QueueTime.Seconds())

case "completed":
githubWorkflowJobsCompletedTotal.With(extraLabel("runner_name", *e.WorkflowJob.RunnerName, labels)).Inc()
workflowCompletedLabels := labels
if n := e.WorkflowJob.RunnerName; n != nil {
workflowCompletedLabels = extraLabel("runner_name", *n, labels)
}
githubWorkflowJobsCompletedTotal.With(workflowCompletedLabels).Inc()

// job_conclusion -> (neutral, success, skipped, cancelled, timed_out, action_required, failure)
githubWorkflowJobConclusionsTotal.With(extraLabel("job_conclusion", *e.WorkflowJob.Conclusion, labels)).Inc()
Expand Down

0 comments on commit 70e3260

Please sign in to comment.