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

feat: Update requestDataIntegration handling #14806

Draft
wants to merge 2 commits into
base: develop
Choose a base branch
from

Conversation

mydea
Copy link
Member

@mydea mydea commented Dec 19, 2024

This PR cleans up the behavior of requestDataIntegration. For this, there are a bunch of parts that come together:

  1. We used to take request.user and infer a user to put on the event from it. This is a non-standard property, that is sometimes set by some express middleware. It is not documented anywhere. Additionally, this is thus also not available at request-start-time, only later (as middleware may set this later on the request), meaning we'd need to somehow pick this off later. We decided to instead remove this behavior - requestDataIntegration will no longer set a user on the event. The respective include config is also gone from it. Instead, if you want this, you'll need to call Sentry.setUser() yourself in some middleware. Also note that this actually aligns more closely with what we'd expect, which is that by default no user is set on Sentry events (privacy by default).
  2. We used to export a whole bunch of utils around this, because this used to be spread across @sentry/utils and @sentry/core. Now, this is all in core, so we can remove all the related imports. We'll need to backport these missing deprecations to the v8 branch, this includes e.g. DEFAULT_USER_INCLUDES or addNormalizedRequestDataToEvent.
  3. The types for scope.setSDKProcessingMetadata() are now better shaped, so that for specific things it enforces a concrete shape.
  4. The IP, I added to the sdkProcessingMetadata, making a more consistent handling for it.
  5. All of this allowed to drastically simplify the requestDataIntegration code. I also colocated the specific stuff into the integration.

TODO: Migration docs

Closes #14297

@mydea mydea self-assigned this Dec 19, 2024
Copy link
Contributor

size-limit report 📦

Path Size % Change Change
@sentry/browser 23.16 KB - -
@sentry/browser - with treeshaking flags 21.83 KB - -
@sentry/browser (incl. Tracing) 35.66 KB - -
@sentry/browser (incl. Tracing, Replay) 72.91 KB - -
@sentry/browser (incl. Tracing, Replay) - with treeshaking flags 63.31 KB - -
@sentry/browser (incl. Tracing, Replay with Canvas) 77.32 KB - -
@sentry/browser (incl. Tracing, Replay, Feedback) 89.71 KB - -
@sentry/browser (incl. Feedback) 39.91 KB - -
@sentry/browser (incl. sendFeedback) 27.77 KB - -
@sentry/browser (incl. FeedbackAsync) 32.53 KB - -
@sentry/react 25.88 KB - -
@sentry/react (incl. Tracing) 38.51 KB - -
@sentry/vue 27.38 KB - -
@sentry/vue (incl. Tracing) 37.51 KB - -
@sentry/svelte 23.31 KB - -
CDN Bundle 24.24 KB +0.02% +4 B 🔺
CDN Bundle (incl. Tracing) 35.79 KB -0.01% -1 B 🔽
CDN Bundle (incl. Tracing, Replay) 70.9 KB -0.01% -2 B 🔽
CDN Bundle (incl. Tracing, Replay, Feedback) 76.2 KB -0.01% -2 B 🔽
CDN Bundle - uncompressed 71.24 KB - -
CDN Bundle (incl. Tracing) - uncompressed 106.7 KB - -
CDN Bundle (incl. Tracing, Replay) - uncompressed 220.77 KB - -
CDN Bundle (incl. Tracing, Replay, Feedback) - uncompressed 233.97 KB - -
@sentry/nextjs (client) 38.79 KB - -
@sentry/sveltekit (client) 36.18 KB - -
@sentry/node 157.12 KB -0.53% -854 B 🔽
@sentry/node - without tracing 98 KB -0.85% -860 B 🔽
@sentry/aws-serverless 125.79 KB -0.62% -801 B 🔽

View base workflow run

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[v9] Remove non-normalized request handling in requestDataIntegration
1 participant