Skip to content

Commit ee72941

Browse files
committed
PR fixes
1 parent 5daee33 commit ee72941

2 files changed

Lines changed: 4 additions & 5 deletions

File tree

sentry_sdk/integrations/sanic.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -230,7 +230,7 @@ async def _context_exit(
230230
span.set_attribute(SPANDATA.HTTP_STATUS_CODE, response_status)
231231
span.status = "error" if response_status >= 400 else "ok"
232232

233-
span._end()
233+
span.end()
234234
else:
235235
span.set_http_status(response_status)
236236
span.sampled &= (

tests/integrations/sanic/test_sanic.py

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -451,8 +451,8 @@ def test_transactions(
451451
segments = [
452452
i.payload
453453
for i in items
454-
if i.type == "span"
455-
and i.payload["attributes"].get("sentry.origin") == "auto.http.sanic"
454+
if i.payload["attributes"].get("sentry.origin") == "auto.http.sanic"
455+
and i.payload["is_segment"]
456456
]
457457
assert len(segments) <= 1
458458
(segment, *_) = [*segments, None]
@@ -535,8 +535,7 @@ def test_span_origin(sentry_init, app, capture_events, capture_items, span_strea
535535
(segment,) = [
536536
i.payload
537537
for i in items
538-
if i.type == "span"
539-
and i.payload["attributes"].get("sentry.origin") == "auto.http.sanic"
538+
if i.payload["attributes"].get("sentry.origin") == "auto.http.sanic"
540539
]
541540
assert segment["attributes"]["sentry.origin"] == "auto.http.sanic"
542541
else:

0 commit comments

Comments
 (0)