Skip to content

Commit 3910fa9

Browse files
committed
feat: Send transactions in envelopes
This matches what the JS SDK does and what the Tracing dev docs indicates.
1 parent 8aecc71 commit 3910fa9

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

sentry_sdk/client.py

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -330,7 +330,12 @@ def capture_event(
330330
if session:
331331
self._update_session_from_event(session, event)
332332

333-
self.transport.capture_event(event_opt)
333+
if event.get("type") == "transaction":
334+
# Transactions should go to the /envelope/ endpoint.
335+
self.transport.capture_envelope(Envelope(items=[event]))
336+
else:
337+
# All other events go to the /store/ endpoint.
338+
self.transport.capture_event(event_opt)
334339
return event_id
335340

336341
def capture_session(

0 commit comments

Comments
 (0)