feat: restore `runner_name` label to listener metrics

This commit is contained in:
air-hand 2025-07-23 20:57:39 +09:00
parent 9c42f9f2e1
commit f93b6dcb8c
No known key found for this signature in database
GPG Key ID: 80933B351C137961
1 changed files with 5 additions and 1 deletions

View File

@ -24,6 +24,7 @@ const (
labelKeyJobWorkflowRef = "job_workflow_ref"
labelKeyEventName = "event_name"
labelKeyJobResult = "job_result"
labelKeyRunnerName = "runner_name"
)
const (
@ -88,11 +89,14 @@ func (e *exporter) jobLabels(jobBase *actions.JobMessageBase) prometheus.Labels
func (e *exporter) completedJobLabels(msg *actions.JobCompleted) prometheus.Labels {
l := e.jobLabels(&msg.JobMessageBase)
l[labelKeyJobResult] = msg.Result
l[labelKeyRunnerName] = msg.RunnerName
return l
}
func (e *exporter) startedJobLabels(msg *actions.JobStarted) prometheus.Labels {
return e.jobLabels(&msg.JobMessageBase)
l := e.jobLabels(&msg.JobMessageBase)
l[labelKeyRunnerName] = msg.RunnerName
return l
}
//go:generate mockery --name Publisher --output ./mocks --outpkg mocks --case underscore