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

Sentry SDK Crash Detection POC #49928

Closed
wants to merge 51 commits into from
Closed

Conversation

philipphofmann
Copy link
Member

@philipphofmann philipphofmann commented May 30, 2023

This PR adds the Sentry SDK Crash Detection (#44342) only for the sentry-sdk organization for a proof of concept. The feature is disabled by default.

Most of the code was already reviewed in previous PRs (#46494, #46578, #49170, #49528, #49593, #49746, #50284) but giving it a final pass still makes sense.

Fixes GH-49749

philipphofmann and others added 30 commits February 7, 2023 09:55
Running test_discover.py with the test explorer in VSCode failed with an
import file mismatch. This is fixed now by adding a missing __init__.py
file to tests/sentry/data_export/processors.
Remove the debug images not referenced in the stack trace so the debug
images don't contain customer data.

Fixes GH-46174

Co-authored-by: Joris Bayer <joris.bayer@sentry.io>
Detect when an event has the context `sdk_crash_detection`, and skip
crash monitoring in that case.

Fixes GH-46173
Specify an allowlist for the event data to ensure only keeping essential
data doesn't contain PII.

Fixes GH-49935

This PR is based on #49928.

Co-authored-by: Joris Bayer <joris.bayer@sentry.io>
Co-authored-by: getsantry[bot] <66042841+getsantry[bot]@users.noreply.github.com>
Copy link
Member

@jjbayer jjbayer left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pressing "Request changes" because I am still worried about user-specific data slipping through the cracks because of the Allow.ALL variant. I should have made that concern more clear when reviewing #50400 (review).

Even if the feature is disabled by default, I am afraid that if we merge it now we might overlook this risk when opting in more orgs.

@philipphofmann
Copy link
Member Author

Pressing "Request changes" because I am still worried about user-specific data slipping through the cracks because of the Allow.ALL variant. I should have made that concern more clear when reviewing #50400 (review).

Even if the feature is disabled by default, I am afraid that if we merge it now we might overlook this risk when opting in more orgs.

@jjbayer, I get your point. I added #50710 and #50712 to #49749. I will open PRs to this PR soon.

@asottile-sentry
Copy link
Member

please instead of making this patch bigger utilize some sort of feature flagging to merge smaller changes into mainline

just because something was "already reviewed" doesn't mean things shouldn't be ignored in a review

@philipphofmann
Copy link
Member Author

philipphofmann commented Jun 12, 2023

I agree, @asottile-sentry. I should have started with a feature flag and then merge all the small batches into mainline. Smaller batches are better for tons of reasons. FYI, I already have a feature flag in place

if not features.has("organizations:sdk-crash-detection", event.project.organization):
return

@jjbayer, can we maybe agree on merging this PR and not enabling the feature until we address #50710 and #50712. This PR is already huge.

@asottile-sentry
Copy link
Member

I agree, @asottile-sentry. I should have started with a feature flag and then merge all the small batches into mainline. Smaller batches are better for tons of reasons.

@jjbayer, can we maybe agree on merging this PR and not enabling the feature until we address #50710 and #50712. This PR is already huge.

I think you should still try and split this up -- merging large unreviewable changes is inherently risky

@philipphofmann
Copy link
Member Author

I think you should still try and split this up -- merging large unreviewable changes is inherently risky

Okay, I will split this PR up into multiple ones. It shouldn't be a big problem. I just wanted to be sure to align on the approach. @asottile-sentry, I plan on adding a feature flag first without any actual logic. The feature will be disabled by default. Then I open subsequent PRs until all of the changes from this PR are merged to master. Only when we are happy will all the changes, we enable the feature. How does that sound @asottile-sentry?

@philipphofmann
Copy link
Member Author

As this PR is too big, I will split it into multiple ones to make it easier to review.

philipphofmann added a commit that referenced this pull request Jun 14, 2023
This PR adds a feature flag disabled by default, the project id for the
feature in the settings, and calls the placeholder class for the SDK
crash detection (#44342) in
post processing.

This is the first PR of splitting up the POC for SDK crash detection
(#49928) into multiple PRs.

---------

Co-authored-by: Iker Barriocanal <32816711+iker-barriocanal@users.noreply.github.com>
Co-authored-by: getsantry[bot] <66042841+getsantry[bot]@users.noreply.github.com>
philipphofmann added a commit that referenced this pull request Jun 14, 2023
Store all unhandled Cocoa SDK events to a dedicated project configurable
via the settings. Before enabling this feature in production we must
check if the unhandled event stems from the Cocoa SDK and we need to
strip most of the event data to prevent collecting PII.

This is the second PR of splitting up the POC for SDK crash detection
(#49928) into multiple PRs and
it is based on #50794.

---------

Co-authored-by: Joris Bayer <joris.bayer@sentry.io>
@github-actions github-actions bot locked and limited conversation to collaborators Jun 28, 2023
@asottile-sentry asottile-sentry deleted the feat/sdk-crash-monitoring branch December 27, 2023 16:07
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Scope: Backend Automatically applied to PRs that change backend components
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Sentry SDK Crash Detection POC
4 participants