SIGN IN SIGN UP

feat(nextjs): Migrate `sendDefaultPii` to `dataCollection` (#21137)

Migrate `sendDefaultPii` usage in the Next.js package to the
`dataCollection` API:

- **`withServerActionInstrumentation`**: Use
`getDataCollectionOptions().httpBodies.includes('outgoingResponse')` to
gate server action response recording
- **`addHeadersAsAttributes`**: Use `httpHeaders.request` from
`getDataCollectionOptions()` to control header span attributes and
filtering level
- **`setUrlProcessingMetadata`**: Remove the `sendDefaultPii` gate —
URLs are fundamental request metadata, not PII-gated data (see [spec
update](https://github.com/getsentry/sentry-docs/pull/17911))
- **`pagesRouterRoutingInstrumentation`**: Remove the `sendDefaultPii`
gate for route params — same reasoning as URLs

ref https://github.com/getsentry/sentry-docs/pull/17911



closes https://github.com/getsentry/sentry-javascript/issues/20932
C
Charly Gomez committed
f1b3a7e5b8b055387504ada3391937b173ed5bcb
Parent: 791fb4d
Committed by GitHub <noreply@github.com> on 6/1/2026, 12:11:13 PM