feat(asgi): Migrate away from event processor in span first #5920
1 issue
code-review: Found 1 issue (1 medium)
Medium
http.query attribute set to string "None" when no query string present - `sentry_sdk/integrations/_asgi_common.py:126`
When there's no query string in the request, _get_query(asgi_scope) returns None, which is unconditionally assigned to attributes["http.query"]. When this None value is later passed through format_attribute() in set_attribute(), it becomes the string "None" via safe_repr(). This causes requests without query strings to have http.query set to the literal string "None" instead of omitting the attribute entirely.
Duration: 3m 39s · Tokens: 1.8M in / 24.3k out · Cost: $2.76 (+extraction: $0.00, +fix_gate: $0.00)
Annotations
Check warning on line 126 in sentry_sdk/integrations/_asgi_common.py
sentry-warden / warden: code-review
http.query attribute set to string "None" when no query string present
When there's no query string in the request, `_get_query(asgi_scope)` returns `None`, which is unconditionally assigned to `attributes["http.query"]`. When this `None` value is later passed through `format_attribute()` in `set_attribute()`, it becomes the string `"None"` via `safe_repr()`. This causes requests without query strings to have `http.query` set to the literal string `"None"` instead of omitting the attribute entirely.