Add job_workflow_ref label to listener metrics (#4054)

Signed-off-by: rskmm0chang <rskmm0chang@hatena.ne.jp>
This commit is contained in:
Ryo Sakamoto 2025-06-05 15:33:30 +09:00 committed by GitHub
parent 27b292bdd3
commit 97697e80b4
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 11 additions and 7 deletions

View File

@ -131,7 +131,7 @@ githubConfigSecret:
# counters: # counters:
# gha_started_jobs_total: # gha_started_jobs_total:
# labels: # labels:
# ["repository", "organization", "enterprise", "job_name", "event_name"] # ["repository", "organization", "enterprise", "job_name", "event_name", "job_workflow_ref"]
# gha_completed_jobs_total: # gha_completed_jobs_total:
# labels: # labels:
# [ # [
@ -141,6 +141,7 @@ githubConfigSecret:
# "job_name", # "job_name",
# "event_name", # "event_name",
# "job_result", # "job_result",
# "job_workflow_ref",
# ] # ]
# gauges: # gauges:
# gha_assigned_jobs: # gha_assigned_jobs:
@ -162,7 +163,7 @@ githubConfigSecret:
# histograms: # histograms:
# gha_job_startup_duration_seconds: # gha_job_startup_duration_seconds:
# labels: # labels:
# ["repository", "organization", "enterprise", "job_name", "event_name"] # ["repository", "organization", "enterprise", "job_name", "event_name","job_workflow_ref"]
# buckets: # buckets:
# [ # [
# 0.01, # 0.01,
@ -220,6 +221,7 @@ githubConfigSecret:
# "job_name", # "job_name",
# "event_name", # "event_name",
# "job_result", # "job_result",
# "job_workflow_ref"
# ] # ]
# buckets: # buckets:
# [ # [

View File

@ -21,6 +21,7 @@ const (
labelKeyOrganization = "organization" labelKeyOrganization = "organization"
labelKeyRepository = "repository" labelKeyRepository = "repository"
labelKeyJobName = "job_name" labelKeyJobName = "job_name"
labelKeyJobWorkflowRef = "job_workflow_ref"
labelKeyEventName = "event_name" labelKeyEventName = "event_name"
labelKeyJobResult = "job_result" labelKeyJobResult = "job_result"
) )
@ -79,6 +80,7 @@ func (e *exporter) jobLabels(jobBase *actions.JobMessageBase) prometheus.Labels
labelKeyOrganization: jobBase.OwnerName, labelKeyOrganization: jobBase.OwnerName,
labelKeyRepository: jobBase.RepositoryName, labelKeyRepository: jobBase.RepositoryName,
labelKeyJobName: jobBase.JobDisplayName, labelKeyJobName: jobBase.JobDisplayName,
labelKeyJobWorkflowRef: jobBase.JobWorkflowRef,
labelKeyEventName: jobBase.EventName, labelKeyEventName: jobBase.EventName,
} }
} }