[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.
diff --git a/.ci/metrics/metrics.py b/.ci/metrics/metrics.py
index d219c9e..354b505 100644
--- a/.ci/metrics/metrics.py
+++ b/.ci/metrics/metrics.py
@@ -24,6 +24,7 @@
status: int
created_at_ns: int
workflow_id: int
+ workflow_name: str
@dataclass
@@ -199,6 +200,7 @@
job_result,
created_at_ns,
workflow_run.id,
+ workflow_run.name,
)
)
@@ -278,7 +280,7 @@
for workflow_metric in reversed(current_metrics):
if isinstance(workflow_metric, JobMetrics):
workflows_to_track[
- workflow_metric.job_name
+ workflow_metric.workflow_name
] = workflow_metric.workflow_id
time.sleep(SCRAPE_INTERVAL_SECONDS)