Skip to content

docs: Add "Data Scrubbing" spec, update docs on parametrization and scrubbing - #19908

Merged
s1gr1d merged 5 commits into
masterfrom
sig/data-scrubbing-parametrization
Nov 17, 2026
Merged

s1gr1d merged 5 commits into
masterfrom
sig/data-scrubbing-parametrization

Conversation

@s1gr1d

@s1gr1d s1gr1d commented Oct 12, 2026 •

Copy link
Copy Markdown
Member

Defines which sensitive data the SDK scrubs and which data Relay scrubs. It also defines the terms and separates scrubbing from parameterization.

This follows our meeting discussion @mydea @Dav1dde

  • New spec "Data Scrubbing":
  • Data Collection: SDKs attach text bodies unchanged. Relay scrubs them.
  • Queries Module: "Query Scrubbing" is now "Query Parameterization". The SDK uses the driver's parameterized query or replaces literals with ?. If it does not do this, it may send db.query.text
  • Structuring Data and Metrics: Use dataCollection instead of sendDefaultPii. Fixed outdated links.

Tested (what do we see in Sentry)

JS app on SDK v11. Raw values set in span attributes with beforeSendSpan: http.request.body.data, http.response.body.data, http.request.header.cookie, http.response.header.set-cookie, http.response.header.x-probe-*.

  • Relay does not parse body attributes. A JSON body that contains password became [Filtered] as a whole.
  • Card numbers are replaced in place (cart=[Filtered]).
  • Known session cookies (session=…) are scrubbed. connect.sid is not: Scrub the connect.sid session cookie relay#6497.
  • Emails, IPs, and JWTs are not scrubbed

@vercel

vercel Bot commented Oct 12, 2026 •

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated
develop-docs Ready Ready Preview Nov 17, 2026 1:19pm UTC
1 Skipped Deployment
Project Deployment Actions Updated
sentry-docs Ignored Ignored Preview Nov 17, 2026 1:19pm UTC

Request Review

@github-actions github-actions Bot added the sdk-develop-docs PRs touching develop-docs/sdk label Oct 12, 2026
@codeowner-assignment
codeowner-assignment Bot requested a review from a team October 12, 2026 10:49
@github-actions github-actions Bot added the Priority: Needs Triage The PR description is missing valid priority information label Oct 12, 2026
@github-actions

Copy link
Copy Markdown
Contributor

Please update the IS YOUR CHANGE URGENT? section of the PR description:

  • Select exactly one option.
  • If you selected an urgent or other deadline, provide the date as YYYY-MM-DD.

This information helps the Docs team prioritize your review.

@cursor

cursor Bot commented Oct 12, 2026 •

Copy link
Copy Markdown
Contributor

Services awaiting deployment · Rollout details

Warning

Rollouts can't watch this change after it deploys: every data source for this team needs to be signed in again, so a check has no telemetry to read. Sign in to your data sources, or ask a team admin to.

Status Service Environment
⚪ Not deployed yet develop-docs

Mention @rollout in a comment to update the plan.

## Overview

</Alert>
This spec defines which sensitive data the SDK removes and which sensitive data Relay removes. It also defines parameterization. Parameterization and scrubbing can use the same operations, but they have different purposes.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

I think I'd prefer a split between client side/SDK scrubbing and server side scrubbing (Relay) and using that terminology instead of mentioning Relay directly.

- [Mark that part of the protocol on Relay](https://github.com/getsentry/relay/pull/1383) as such. This allows [data scrubbing](https://docs.sentry.io/product/relay/) to run on those fields.
- **Not collecting**: The SDK does not read the data. A `dataCollection` option controls this for each data category.
- **Parameterization**: The SDK replaces the variable parts of a value with placeholders, for example `SELECT * FROM users WHERE id = ?` or `/users/:id`. The result has low cardinality, so Sentry can group and search by it.
- **Scrubbing**: The SDK or Relay replaces a sensitive value with `"[Filtered]"`. The structure and the key names stay the same.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Technically on the server side we also allow for different replacements than [Filtered] this is just our default for the default rules.

Comment on lines +95 to +100
As of 2026-10-12, Relay does not parse payloads in span attributes. Relay applies its rules to the whole attribute value:

- If the value contains a sensitive word, such as `password`, `secret`, or `auth`, Relay replaces the whole value with `"[Filtered]"`.
- Relay replaces other matches, such as credit card numbers, in place.
- Relay does not remove literals from `db.query.text`. Relay adds a parameterized copy in `sentry.normalized_db_query` for grouping.
- By default, Relay does not scrub email addresses or IP addresses.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

This largely depends on the users project and organization settings and I'd instead link to our server side scrubbing docs.

@coolguyzone coolguyzone left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Looks good!

Say what the SDK does: send each value in its own attribute or list
entry, and do not join the values into one string. Add a request
header example and name Sentry Conventions as the place that defines
the attributes.
…parametrization

# Conflicts:
#	develop-docs/sdk/foundations/client/data-collection/index.mdx
The changelog already lists 3.2.0 for the dataCollection.userInfo
change, but the spec_version field still said 3.1.0.
@codeowner-assignment
codeowner-assignment Bot requested a review from a team November 17, 2026 13:15
@s1gr1d
s1gr1d merged commit 643f317 into master Nov 17, 2026
27 checks passed
@s1gr1d
s1gr1d deleted the sig/data-scrubbing-parametrization branch November 17, 2026 13:33

This branch was successfully deployed

1 active deployment
Preview – develop-docs — 4cce9f09 Deployed Nov 17, 2026 by vercel[bot]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Priority: Needs Triage The PR description is missing valid priority information sdk-develop-docs PRs touching develop-docs/sdk

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants