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(core)!: Add normalizedRequest to samplingContext #14902

Merged
merged 4 commits into from
Jan 3, 2025

Conversation

s1gr1d
Copy link
Member

@s1gr1d s1gr1d commented Jan 3, 2025

The sampling context didn't include the request object anymore. By adding the normalizedRequest, this data is added again.

Copy link
Contributor

github-actions bot commented Jan 3, 2025

size-limit report 📦

Path Size % Change Change
@sentry/browser 22.77 KB - -
@sentry/browser - with treeshaking flags 21.52 KB - -
@sentry/browser (incl. Tracing) 35.38 KB +0.09% +29 B 🔺
@sentry/browser (incl. Tracing, Replay) 72.58 KB +0.04% +29 B 🔺
@sentry/browser (incl. Tracing, Replay) - with treeshaking flags 62.97 KB +0.04% +23 B 🔺
@sentry/browser (incl. Tracing, Replay with Canvas) 76.98 KB +0.04% +31 B 🔺
@sentry/browser (incl. Tracing, Replay, Feedback) 89.35 KB +0.04% +30 B 🔺
@sentry/browser (incl. Feedback) 39.53 KB - -
@sentry/browser (incl. sendFeedback) 27.41 KB - -
@sentry/browser (incl. FeedbackAsync) 32.17 KB - -
@sentry/react 25.54 KB - -
@sentry/react (incl. Tracing) 38.19 KB +0.07% +27 B 🔺
@sentry/vue 27.1 KB +0.13% +35 B 🔺
@sentry/vue (incl. Tracing) 37.25 KB +0.07% +26 B 🔺
@sentry/svelte 22.94 KB - -
CDN Bundle 24.14 KB - -
CDN Bundle (incl. Tracing) 35.71 KB +0.11% +39 B 🔺
CDN Bundle (incl. Tracing, Replay) 70.74 KB +0.06% +38 B 🔺
CDN Bundle (incl. Tracing, Replay, Feedback) 75.95 KB +0.05% +35 B 🔺
CDN Bundle - uncompressed 70.59 KB - -
CDN Bundle (incl. Tracing) - uncompressed 106.17 KB +0.11% +118 B 🔺
CDN Bundle (incl. Tracing, Replay) - uncompressed 220.11 KB +0.06% +118 B 🔺
CDN Bundle (incl. Tracing, Replay, Feedback) - uncompressed 232.98 KB +0.05% +118 B 🔺
@sentry/nextjs (client) 38.5 KB +0.07% +27 B 🔺
@sentry/sveltekit (client) 35.91 KB +0.09% +31 B 🔺
@sentry/node 162.49 KB +0.01% +16 B 🔺
@sentry/node - without tracing 98.24 KB - -
@sentry/aws-serverless 128.11 KB +0.02% +19 B 🔺

View base workflow run

Copy link
Member

@Lms24 Lms24 left a comment

Choose a reason for hiding this comment

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

Nice!

!!samplingContext.normalizedRequest.headers
);
},
debug: true,
Copy link
Member

Choose a reason for hiding this comment

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

l: we probably don't need this

Suggested change
debug: true,

@@ -217,6 +217,7 @@ Since v9, the types have been merged into `@sentry/core`, which removed some of
- The `TransactionNamingScheme` type has been removed. There is no replacement.
- The `Request` type has been removed. Use `RequestEventData` type instead.
- The `IntegrationClass` type is no longer exported - it was not used anymore. Instead, use `Integration` or `IntegrationFn`.
- - The `samplingContext.request` attribute in the `tracesSampler` has been removed. Use `samplingContext.normalizedRequest` instead.
Copy link
Member

Choose a reason for hiding this comment

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

l: Maybe we call out the type change a bit more?

Suggested change
- - The `samplingContext.request` attribute in the `tracesSampler` has been removed. Use `samplingContext.normalizedRequest` instead.
- The `samplingContext.request` attribute in the `tracesSampler` has been removed. Use `samplingContext.normalizedRequest` instead. Note that the type of `normalizedRequest` differs from `request`.

@s1gr1d s1gr1d changed the title feat(core): Add normalizedRequest to samplingContext feat(core)!: Add normalizedRequest to samplingContext Jan 3, 2025
@s1gr1d s1gr1d merged commit 8dd8ac5 into develop Jan 3, 2025
152 checks passed
@s1gr1d s1gr1d deleted the sig/sampling-context-normalize-request branch January 3, 2025 15:32
s1gr1d added a commit that referenced this pull request Jan 7, 2025
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.

2 participants