Skip to content

Commit

Permalink
only store duration for specific statuses
Browse files Browse the repository at this point in the history
  • Loading branch information
sindunuragarp committed Nov 14, 2023
1 parent 4b8dfeb commit 13e360f
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions pkg/actionsmetrics/event_reader.go
Original file line number Diff line number Diff line change
Expand Up @@ -193,8 +193,10 @@ func (reader *EventReader) ProcessWorkflowJobEvent(ctx context.Context, event in
).Inc()
}

if runTimeSeconds != nil {
githubWorkflowJobRunDurationSeconds.With(extraLabel("job_conclusion", *e.WorkflowJob.Conclusion, labels)).Observe(*runTimeSeconds)
if *e.WorkflowJob.Conclusion != "cancelled" && *e.WorkflowJob.Conclusion != "skipped" && *e.WorkflowJob.Conclusion != "timed_out" {
if runTimeSeconds != nil {
githubWorkflowJobRunDurationSeconds.With(extraLabel("job_conclusion", *e.WorkflowJob.Conclusion, labels)).Observe(*runTimeSeconds)
}
}
}
}
Expand Down

0 comments on commit 13e360f

Please sign in to comment.