Skip to content

Commit cea7d21

Browse files
committed
i am very smart
1 parent 5ba6bcb commit cea7d21

File tree

2 files changed

+4
-6
lines changed

2 files changed

+4
-6
lines changed

sentry_sdk/scope.py

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1498,11 +1498,9 @@ def _apply_global_attributes_to_telemetry(
14981498
def _apply_scope_attributes_to_telemetry(
14991499
self, telemetry: "Union[Log, Metric]"
15001500
) -> None:
1501-
attributes = telemetry["attributes"]
1502-
15031501
for attribute, value in self._attributes.items():
1504-
if attribute not in self._attributes:
1505-
attributes[attribute] = value
1502+
if attribute not in telemetry["attributes"]:
1503+
telemetry["attributes"][attribute] = value
15061504

15071505
def _apply_user_attributes_to_telemetry(
15081506
self, telemetry: "Union[Log, Metric]"

tests/test_attributes.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -57,8 +57,8 @@ def test_telemetry_precedence(sentry_init, capture_envelopes):
5757
isolation_scope.set_attribute("overwritten.attribute", "isolation")
5858

5959
current_scope = sentry_sdk.get_current_scope()
60-
current_scope.set_attribute("current_scope.attribute", "current_scope")
61-
current_scope.set_attribute("overwritten.attribute", "current_scope")
60+
current_scope.set_attribute("current.attribute", "current")
61+
current_scope.set_attribute("overwritten.attribute", "current")
6262

6363
sentry_sdk.metrics.count(
6464
"test",

0 commit comments

Comments
 (0)