Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 9 additions & 1 deletion sentry_sdk/traces.py
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,7 @@ class StreamedSpan:
__slots__ = (
"_name",
"_attributes",
"_active",
"_span_id",
"_trace_id",
"_status",
Expand All @@ -80,9 +81,11 @@ def __init__(
*,
name: str,
attributes: "Optional[Attributes]" = None,
active: bool = True,
trace_id: "Optional[str]" = None,
):
self._name: str = name
self._active: bool = active
self._attributes: "Attributes" = {}
if attributes:
for attribute, value in attributes.items():
Expand All @@ -99,7 +102,8 @@ def __repr__(self) -> str:
f"<{self.__class__.__name__}("
f"name={self._name}, "
f"trace_id={self.trace_id}, "
f"span_id={self.span_id})>"
f"span_id={self.span_id}, "
f"active={self._active})>"
)

def get_attributes(self) -> "Attributes":
Expand Down Expand Up @@ -143,6 +147,10 @@ def name(self) -> str:
def name(self, name: str) -> None:
self._name = name

@property
def active(self) -> bool:
return self._active

@property
def span_id(self) -> str:
if not self._span_id:
Expand Down
Loading