ref: Add span filtering to span first (15) #5633
Merged
@sentry/warden / warden: find-bugs
completed
Mar 12, 2026 in 2m 38s
1 issue
find-bugs: Found 1 issue (1 medium)
Medium
Rule with empty attributes dict matches all spans unintentionally - `sentry_sdk/tracing_utils.py:1518-1524`
A span filtering rule like {"attributes": {}} will match ALL spans because the default attributes_match = True is never set to False when iterating over an empty dict. This could cause unintended span dropping if a user accidentally provides an empty attributes dict in their configuration.
Duration: 2m 37s · Tokens: 3.5M in / 20.7k out · Cost: $5.35 (+extraction: $0.00)
Annotations
Check warning on line 1524 in sentry_sdk/tracing_utils.py
sentry-warden / warden: find-bugs
Rule with empty attributes dict matches all spans unintentionally
A span filtering rule like `{"attributes": {}}` will match ALL spans because the default `attributes_match = True` is never set to `False` when iterating over an empty dict. This could cause unintended span dropping if a user accidentally provides an empty attributes dict in their configuration.
Loading