Skip to content

Commit b3e9c10

Browse files
authored
fix(span-streaming): Always preserialize attributes (#5407)
We were not preserializing attributes set directly on span creation.
1 parent 33cb268 commit b3e9c10

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

sentry_sdk/traces.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,10 @@ def __init__(
3939
trace_id: "Optional[str]" = None,
4040
):
4141
self.name: str = name
42-
self._attributes: "Attributes" = attributes or {}
42+
self._attributes: "Attributes" = {}
43+
if attributes:
44+
for attribute, value in attributes.items():
45+
self.set_attribute(attribute, value)
4346

4447
self._trace_id = trace_id
4548

0 commit comments

Comments
 (0)