From 64b877b8d019a5650e920848b33b35e0d9a18500 Mon Sep 17 00:00:00 2001 From: matt-codecov <137832199+matt-codecov@users.noreply.github.com> Date: Wed, 7 Aug 2024 11:28:42 -0700 Subject: [PATCH] log when raw upload contains no uploaded files looking at the nearby counter metrics in Grafana, the median upload supposedly has no raw report files inside of it. we can search this log in GCS to see specific cases of this to see what's up. --- services/report/__init__.py | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/services/report/__init__.py b/services/report/__init__.py index bd503373c..8d28bf426 100644 --- a/services/report/__init__.py +++ b/services/report/__init__.py @@ -926,8 +926,20 @@ def parse_raw_report_from_storage( raw_uploaded_report = parser.parse_raw_report_from_bytes(archive_file) + raw_report_count = len(raw_uploaded_report.get_uploaded_files()) + if raw_report_count < 1: + log.warning( + "Raw upload contains no uploaded files", + extra=dict( + commit=upload.report.commit_id, + repoid=repo.repoid, + raw_report_count=raw_report_count, + upload_version=upload_version, + archive_url=archive_url, + ), + ) RAW_UPLOAD_RAW_REPORT_COUNT.labels(version=upload_version).observe( - len(raw_uploaded_report.get_uploaded_files()) + raw_report_count ) return raw_uploaded_report