diff --git a/sentry_sdk/traces.py b/sentry_sdk/traces.py index 1c58e4a1cb..a63a9bebb0 100644 --- a/sentry_sdk/traces.py +++ b/sentry_sdk/traces.py @@ -39,7 +39,10 @@ def __init__( trace_id: "Optional[str]" = None, ): self.name: str = name - self._attributes: "Attributes" = attributes or {} + self._attributes: "Attributes" = {} + if attributes: + for attribute, value in attributes.items(): + self.set_attribute(attribute, value) self._trace_id = trace_id