diff --git a/src/sentry/utils/performance_issues/detectors/http_overhead_detector.py b/src/sentry/utils/performance_issues/detectors/http_overhead_detector.py index 7e4eb0f7f3b626..697a1e1a38d3f4 100644 --- a/src/sentry/utils/performance_issues/detectors/http_overhead_detector.py +++ b/src/sentry/utils/performance_issues/detectors/http_overhead_detector.py @@ -65,11 +65,13 @@ def visit_span(self, span: Span) -> None: url = span_data.get("url", "") span_start = span.get("start_timestamp", 0) * 1000 - request_start = span_data.get("http.request.request_start", 0) * 1000 + request_start = span_data.get("http.request.request_start", 0) if not url or not span_start or not request_start: return + request_start *= 1000 + if url.startswith("/"): location = "/" else: diff --git a/tests/sentry/utils/performance_issues/test_http_overhead_detector.py b/tests/sentry/utils/performance_issues/test_http_overhead_detector.py index 23fe84eecc0877..17175c8ecd3fe6 100644 --- a/tests/sentry/utils/performance_issues/test_http_overhead_detector.py +++ b/tests/sentry/utils/performance_issues/test_http_overhead_detector.py @@ -260,3 +260,23 @@ def test_detect_other_location(self): evidence_display=[], ) ] + + def test_none_request_start(self): + url = "https://example.com/api/endpoint/123" + event = _valid_http_overhead_event("/api/endpoint/123") + + # Include an invalid span to ensure it's not processed + span = create_span( + "http.client", + desc=url, + duration=1000, + data={ + "url": url, + "network.protocol.version": "1.1", + "http.request.request_start": None, + }, + ) + + event["spans"] = [span] + + assert self.find_problems(event) == []