Skip to content

Commit b24e140

Browse files
[CI] Keep Track of Workflow Name Instead of Job Name
The metrics script includes some logic to only read look at workflows up to the most recent workflow it has seen previously. This was broken in a previous patch when workflow metrics began to be emitted per job. The logic ending the metrics gathering would never trigger, so we would continually fetch more and more workflows until OOM.
1 parent ed32d85 commit b24e140

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

.ci/metrics/metrics.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@ class JobMetrics:
2424
status: int
2525
created_at_ns: int
2626
workflow_id: int
27+
workflow_name: str
2728

2829

2930
@dataclass
@@ -199,6 +200,7 @@ def get_per_workflow_metrics(
199200
job_result,
200201
created_at_ns,
201202
workflow_run.id,
203+
workflow_run.name,
202204
)
203205
)
204206

@@ -278,7 +280,7 @@ def main():
278280
for workflow_metric in reversed(current_metrics):
279281
if isinstance(workflow_metric, JobMetrics):
280282
workflows_to_track[
281-
workflow_metric.job_name
283+
workflow_metric.workflow_name
282284
] = workflow_metric.workflow_id
283285

284286
time.sleep(SCRAPE_INTERVAL_SECONDS)

0 commit comments

Comments
 (0)