Repository navigation
docs(dataCollection): Clarify URL handling in data collection spec - #17911
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
1 Skipped Deployment
|
| URL strings in span descriptions follow the format defined in [Structuring Data](/sdk/telemetry/traces/structuring-data/): `METHOD scheme://host/path` — query strings and fragments are excluded. Authority credentials (`userinfo@`) are always replaced with `[Filtered]@`. | ||
|
|
||
| The `queryParams` option controls query parameter filtering wherever query strings appear — including `url.full`, `url.query`, and [`request.query_string`](/sdk/foundations/envelopes/event-payloads/request/). `url.path` and the span description are unaffected since they never contain query strings. For general data scrubbing rules (variable size limits, structuring for server-side scrubbing), see [Data Scrubbing](/sdk/foundations/data-scrubbing/). | ||
|
|
||
| **Example:** Given a request to `https://user:[email protected]/api/users?token=abc123&page=5`: | ||
|
|
||
| | Attribute | `queryParams` enabled | `queryParams` off | | ||
| |---|---|---| | ||
| | Span description | `GET https://[Filtered]:[Filtered]@example.com/api/users` | same | |
There was a problem hiding this comment.
Bug: The documentation for URL credential filtering is inconsistent. The prose description of replacing userinfo@ with [Filtered]@ contradicts the provided examples.
Severity: LOW
Suggested Fix
Update the prose and examples to be consistent. Decide on a single, clear rule for filtering user credentials in URLs and ensure all descriptions and examples in the documentation reflect this rule. For instance, if the intended behavior is to replace the entire userinfo block, the examples should show https://[Filtered]@example.com/....
Prompt for AI Agent
Review the code at the location below. A potential bug has been identified by an AI
agent. Verify if this is a real issue. If it is, propose a fix; if not, explain why it's
not valid.
Location: develop-docs/sdk/foundations/client/data-collection/index.mdx#L149-L157
Potential issue: The documentation regarding URL credential filtering is inconsistent.
The prose at line 149 states that `userinfo@` is always replaced with `[Filtered]@`.
However, this is contradicted by the examples. One example for `url.full` shows the
credentials being completely removed from the URL, not replaced. Another example for the
span description shows the username and password being filtered individually, resulting
in `[Filtered]:[Filtered]@`. This ambiguity can lead to incorrect or inconsistent
implementations by SDK developers.
Also affects:
develop-docs/sdk/foundations/client/data-collection/index.mdx:157~158
Did we get this right? 👍 / 👎 to inform future reviews.
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](getsentry/sentry-docs#17911))
- **`pagesRouterRoutingInstrumentation`**: Remove the `sendDefaultPii`
gate for route params — same reasoning as URLs
ref getsentry/sentry-docs#17911
closes #20932
Add a URLs section to the data collection spec clarifying how
queryParamsinteracts with URL attributes.