Skip to content

Commit

Permalink
remove unused labels
Browse files Browse the repository at this point in the history
  • Loading branch information
sindunuragarp committed Nov 14, 2023
1 parent be1bfcb commit 4b8dfeb
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 11 deletions.
10 changes: 0 additions & 10 deletions pkg/actionsmetrics/event_reader.go
Original file line number Diff line number Diff line change
Expand Up @@ -75,10 +75,6 @@ func (reader *EventReader) ProcessWorkflowJobEvent(ctx context.Context, event in
labels["repository"] = *n
keysAndValues = append(keysAndValues, "repository", *n)
}
if n := e.Repo.FullName; n != nil {
labels["repository_full_name"] = *n
keysAndValues = append(keysAndValues, "repository_full_name", *n)
}

if e.Repo.Owner != nil {
if l := e.Repo.Owner.Login; l != nil {
Expand All @@ -98,19 +94,13 @@ 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...)

Expand Down
2 changes: 1 addition & 1 deletion pkg/actionsmetrics/metrics.go
Original file line number Diff line number Diff line change
Expand Up @@ -146,7 +146,7 @@ func initGithubWorkflowJobRunDurationSeconds(buckets []float64) *prometheus.Hist
}

var (
commonLabels = []string{"runs_on", "job_name", "organization", "repository", "repository_full_name", "owner", "workflow_name", "head_branch"}
commonLabels = []string{"runs_on", "job_name", "organization", "repository", "owner", "workflow_name"}
githubWorkflowJobQueueDurationSeconds *prometheus.HistogramVec
githubWorkflowJobRunDurationSeconds *prometheus.HistogramVec
githubWorkflowJobConclusionsTotal = prometheus.NewCounterVec(
Expand Down

0 comments on commit 4b8dfeb

Please sign in to comment.