File tree Expand file tree Collapse file tree 2 files changed +12
-1
lines changed Expand file tree Collapse file tree 2 files changed +12
-1
lines changed Original file line number Diff line number Diff line change @@ -199,7 +199,7 @@ def _prepare_event(
199
199
event = serialize (event )
200
200
201
201
before_send = self .options ["before_send" ]
202
- if before_send is not None :
202
+ if before_send is not None and event . get ( "type" ) != "transaction" :
203
203
new_event = None
204
204
with capture_internal_exceptions ():
205
205
new_event = before_send (event , hint or {})
Original file line number Diff line number Diff line change @@ -155,3 +155,14 @@ def test_nested_span_sampling_override():
155
155
assert span .sampled is True
156
156
with Hub .current .start_span (transaction = "inner" , sampled = False ) as span :
157
157
assert span .sampled is False
158
+
159
+ def test_transactions_do_not_go_through_before_send (sentry_init , capture_events ):
160
+ def before_send (event , hint ):
161
+ raise RuntimeError ("should not be called" )
162
+ sentry_init (traces_sample_rate = 1.0 , before_send = before_send )
163
+ events = capture_events ()
164
+
165
+ with Hub .current .start_span (transaction = "/" ):
166
+ pass
167
+
168
+ assert len (events ) == 1
You can’t perform that action at this time.
0 commit comments