Skip to content

Commit 0518f56

Browse files
committed
fix is_ignored_span
1 parent 2ea18ef commit 0518f56

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

sentry_sdk/tracing_utils.py

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1481,29 +1481,29 @@ def is_ignored_span(name: str, attributes: "Optional[Attributes]") -> bool:
14811481
if not ignore_spans:
14821482
return False
14831483

1484-
def _match_string(rule: "Union[str, Pattern[str]]", string: str) -> bool:
1484+
def _matches(rule: "Any", value: "Any") -> bool:
14851485
if isinstance(rule, Pattern):
1486-
return bool(rule.match(string))
1487-
return rule == string
1486+
return bool(rule.match(value))
1487+
return rule == value
14881488

14891489
for rule in ignore_spans:
14901490
if isinstance(rule, (str, Pattern)):
1491-
if _match_string(rule, name):
1491+
if _matches(rule, name):
14921492
return True
14931493

14941494
elif isinstance(rule, dict):
14951495
name_matches = True
14961496
attributes_match = True
14971497

14981498
if "name" in rule:
1499-
name_matches = _match_string(rule["name"], name)
1499+
name_matches = _matches(rule["name"], name)
15001500

15011501
if "attributes" in rule:
15021502
if not attributes:
15031503
attributes_match = False
15041504
else:
15051505
for attribute, value in rule["attributes"].items():
1506-
if attribute not in attributes or not _match_string(
1506+
if attribute not in attributes or not _matches(
15071507
value, attributes[attribute]
15081508
):
15091509
attributes_match = False

0 commit comments

Comments
 (0)