Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Strip data from Check-In payload. #2536

Merged
merged 4 commits into from
Nov 29, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
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 @@

self._apply_contexts_to_event(event, hint, options)

if is_check_in:
# Check-ins only support the trace context, strip all others
event["contexts"] = {

Check warning on line 657 in sentry_sdk/scope.py

View check run for this annotation

Codecov / codecov/patch

sentry_sdk/scope.py#L657

Added line #L657 was not covered by tests
"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 @@
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