We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent a3714b0 commit 5ad9df4Copy full SHA for 5ad9df4
sentry_sdk/scope.py
@@ -1732,9 +1732,16 @@ def flags(self) -> "FlagBuffer":
1732
return self._flags
1733
1734
def set_attribute(self, attribute: str, value: "AttributeValue") -> None:
1735
+ """
1736
+ Set an attribute on the scope.
1737
+
1738
+ Any attributes-based telemetry (logs, metrics) captured while this scope
1739
+ is active will inherit attributes set on the scope.
1740
1741
self._attributes[attribute] = format_attribute(value)
1742
1743
def remove_attribute(self, attribute: str) -> None:
1744
+ """Remove an attribute if set on the scope."""
1745
try:
1746
del self._attributes[attribute]
1747
except KeyError:
0 commit comments