Skip to content

Commit 2651342

Browse files
committed
adapt to spanstatus change, add ignorespans signature
1 parent 3e62e97 commit 2651342

File tree

2 files changed

+10
-2
lines changed

2 files changed

+10
-2
lines changed

sentry_sdk/_span_batcher.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -135,8 +135,8 @@ def _span_to_transport_format(span):
135135
"span_id": span.span_id,
136136
"name": span.name if is_segment else span.description,
137137
"status": SPANSTATUS.OK
138-
if span.status in (SPANSTATUS.OK, SPANSTATUS.UNSET)
139-
else SPANSTATUS.ERROR,
138+
if span.status == SPANSTATUS.OK
139+
else SPANSTATUS.INTERNAL_ERROR,
140140
"is_segment": is_segment,
141141
"start_timestamp": span.start_timestamp.timestamp(), # TODO[span-first]
142142
"end_timestamp": span.timestamp.timestamp(),

sentry_sdk/consts.py

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,10 +42,12 @@ class CompressionAlgo(Enum):
4242
from typing import Sequence
4343
from typing import Tuple
4444
from typing import AbstractSet
45+
from typing import Pattern
4546
from typing_extensions import Literal
4647
from typing_extensions import TypedDict
4748

4849
from sentry_sdk._types import (
50+
Attributes,
4951
BreadcrumbProcessor,
5052
ContinuousProfilerMode,
5153
Event,
@@ -83,6 +85,12 @@ class CompressionAlgo(Enum):
8385
"enable_metrics": Optional[bool],
8486
"before_send_metric": Optional[Callable[[Metric, Hint], Optional[Metric]]],
8587
"trace_lifecycle": Optional[TraceLifecycleMode],
88+
"ignore_spans": Optional[
89+
list[
90+
Union[str, Pattern],
91+
dict[Union[Literal["name", "attributes"], Union[str, Attributes]],],
92+
]
93+
],
8694
},
8795
total=False,
8896
)

0 commit comments

Comments
 (0)