Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
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
2 changes: 1 addition & 1 deletion sentry_sdk/tracing.py
Original file line number Diff line number Diff line change
Expand Up @@ -408,7 +408,7 @@ def get_trace_context(self):
}

if "status" in self._tags:
rv["status"] = self._tags["status"]
rv["status"] = self._tags.pop("status")

return rv

Expand Down
5 changes: 4 additions & 1 deletion tests/test_tracing.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,8 @@ def test_basic(sentry_init, capture_events, sample_rate):
sentry_init(traces_sample_rate=sample_rate)
events = capture_events()

with Hub.current.start_span(transaction="hi"):
with Hub.current.start_span(transaction="hi") as span:
span.set_status('ok')
with pytest.raises(ZeroDivisionError):
with Hub.current.start_span(op="foo", description="foodesc"):
1 / 0
Expand All @@ -32,6 +33,8 @@ def test_basic(sentry_init, capture_events, sample_rate):
assert span2["op"] == "bar"
assert span2["description"] == "bardesc"
assert parent_span["transaction"] == "hi"
assert "status" not in event["tags"]
assert event["contexts"]["trace"]["status"] == "ok"
else:
assert not events

Expand Down