Browse Source

fix(spans): Safe urlparse (#60682)

Fixes [SENTRY-193P](https://sentry.sentry.io/issues/4677180173/)
Joris Bayer 1 year ago
parent
commit
92027649b7
1 changed files with 4 additions and 1 deletions
  1. 4 1
      src/sentry/ingest/transaction_clusterer/datasource/redis.py

+ 4 - 1
src/sentry/ingest/transaction_clusterer/datasource/redis.py

@@ -197,7 +197,10 @@ def _get_span_description_to_store(span: Mapping[str, Any]) -> Optional[str]:
         return None
 
     if url := span.get("description"):
-        parsed = urlparse(url)
+        try:
+            parsed = urlparse(url)
+        except ValueError:
+            return None
         return f"{parsed.netloc}{parsed.path}"
 
     return None