mirror of
https://github.com/actions/actions-runner-controller.git
synced 2025-12-13 13:06:51 +00:00
Use head_branch metric (#2549)
Co-authored-by: Yusuke Kuoka <ykuoka@gmail.com>
This commit is contained in:
@@ -10,7 +10,7 @@ import (
|
||||
"time"
|
||||
|
||||
"github.com/go-logr/logr"
|
||||
gogithub "github.com/google/go-github/v50/github"
|
||||
gogithub "github.com/google/go-github/v52/github"
|
||||
"github.com/prometheus/client_golang/prometheus"
|
||||
|
||||
"github.com/actions/actions-runner-controller/github"
|
||||
@@ -98,13 +98,19 @@ func (reader *EventReader) ProcessWorkflowJobEvent(ctx context.Context, event in
|
||||
labels["organization"] = org
|
||||
|
||||
var wn string
|
||||
var hb string
|
||||
if e.WorkflowJob != nil {
|
||||
if n := e.WorkflowJob.WorkflowName; n != nil {
|
||||
wn = *n
|
||||
keysAndValues = append(keysAndValues, "workflow_name", *n)
|
||||
}
|
||||
if n := e.WorkflowJob.HeadBranch; n != nil {
|
||||
hb = *n
|
||||
keysAndValues = append(keysAndValues, "head_branch", *n)
|
||||
}
|
||||
}
|
||||
labels["workflow_name"] = wn
|
||||
labels["head_branch"] = hb
|
||||
|
||||
log := reader.Log.WithValues(keysAndValues...)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user