Skip to content

Commit

Permalink
Only add trace context to checkins and do not run event_processors fo…
Browse files Browse the repository at this point in the history
…r checkins (#2536)
  • Loading branch information
antonpirker committed Nov 29, 2023
1 parent b250a89 commit a7f5a66
Showing 1 changed file with 16 additions and 7 deletions.
23 changes: 16 additions & 7 deletions sentry_sdk/scope.py
Original file line number Diff line number Diff line change
Expand Up @@ -652,6 +652,12 @@ def apply_to_event(

self._apply_contexts_to_event(event, hint, options)

if is_check_in:
# Check-ins only support the trace context, strip all others
event["contexts"] = {
"trace": event.setdefault("contexts", {}).get("trace", {})
}

if not is_check_in:
self._apply_level_to_event(event, hint, options)
self._apply_fingerprint_to_event(event, hint, options)
Expand Down Expand Up @@ -680,13 +686,16 @@ def _drop(cause, ty):
event = new_event

# run event processors
for event_processor in chain(global_event_processors, self._event_processors):
new_event = event
with capture_internal_exceptions():
new_event = event_processor(event, hint)
if new_event is None:
return _drop(event_processor, "event processor")
event = new_event
if not is_check_in:
for event_processor in chain(
global_event_processors, self._event_processors
):
new_event = event
with capture_internal_exceptions():
new_event = event_processor(event, hint)
if new_event is None:
return _drop(event_processor, "event processor")
event = new_event

return event

Expand Down

0 comments on commit a7f5a66

Please sign in to comment.