Skip to content

Commit a7f5a66

Browse files
authored
Only add trace context to checkins and do not run event_processors for checkins (#2536)
1 parent b250a89 commit a7f5a66

File tree

1 file changed

+16
-7
lines changed

1 file changed

+16
-7
lines changed

sentry_sdk/scope.py

Lines changed: 16 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -652,6 +652,12 @@ def apply_to_event(
652652

653653
self._apply_contexts_to_event(event, hint, options)
654654

655+
if is_check_in:
656+
# Check-ins only support the trace context, strip all others
657+
event["contexts"] = {
658+
"trace": event.setdefault("contexts", {}).get("trace", {})
659+
}
660+
655661
if not is_check_in:
656662
self._apply_level_to_event(event, hint, options)
657663
self._apply_fingerprint_to_event(event, hint, options)
@@ -680,13 +686,16 @@ def _drop(cause, ty):
680686
event = new_event
681687

682688
# run event processors
683-
for event_processor in chain(global_event_processors, self._event_processors):
684-
new_event = event
685-
with capture_internal_exceptions():
686-
new_event = event_processor(event, hint)
687-
if new_event is None:
688-
return _drop(event_processor, "event processor")
689-
event = new_event
689+
if not is_check_in:
690+
for event_processor in chain(
691+
global_event_processors, self._event_processors
692+
):
693+
new_event = event
694+
with capture_internal_exceptions():
695+
new_event = event_processor(event, hint)
696+
if new_event is None:
697+
return _drop(event_processor, "event processor")
698+
event = new_event
690699

691700
return event
692701

0 commit comments

Comments
 (0)