-
Notifications
You must be signed in to change notification settings - Fork 0
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Added workflow elapsed time metric #32
Conversation
fheinecke
commented
Mar 19, 2024
- Added workflow elapsed time metric
- Updated docs
collector.go
Outdated
// This brings a multitude of issues that are near-impossible to | ||
// account for due to GH's API design. | ||
if run.GetRunAttempt() > 1 { | ||
return |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think we should still count the step and job times since they all complete and can provide meaningful data. But we should not count them towards the workflow counters.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The problem is that that this really screws up any query that depends on both a "time" metric and a "count" metric. For example, I'm writing a query that gets the average runner time of a workflow. This is basically increase(gha_workflow_runner_seconds / gha_workflow_run_count{conclusion = "success")
over an interval. If we count successful runs without counting the run time (in the case of more than one run attempt where a later run was successful) then the average runner time metric is reported as lower than it actually is.
However I'm not sure if dropping metrics for workflow runs with more than one attempts is the right approach. Doing so may screw up some other metric and/or query.
What do you think?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm not suggesting we increase the workflow run count and not the runner time. I'm suggesting we do neither when the attempt > 1 (or is not successful). Just that in this case there the run attempt is > 1, we still tally up the job and step time and counts. If you are comparing across job/step and workflow there may be a mismatch but I could not think of anything you'd want to compare that way.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ahh I see. I'll make that change.