From b24e14093dae04440f22a2da128ba29576f5b3c3 Mon Sep 17 00:00:00 2001 From: Aiden Grossman Date: Sat, 15 Feb 2025 06:14:21 +0000 Subject: [PATCH] [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. --- .ci/metrics/metrics.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/.ci/metrics/metrics.py b/.ci/metrics/metrics.py index d219c9e55169..354b5058100e 100644 --- a/.ci/metrics/metrics.py +++ b/.ci/metrics/metrics.py @@ -24,6 +24,7 @@ class JobMetrics: status: int created_at_ns: int workflow_id: int + workflow_name: str @dataclass @@ -199,6 +200,7 @@ def get_per_workflow_metrics( job_result, created_at_ns, workflow_run.id, + workflow_run.name, ) ) @@ -278,7 +280,7 @@ def main(): 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)