docs(js): Update "Scrubbing Data" guide for span streaming, logs and metrics#18013
docs(js): Update "Scrubbing Data" guide for span streaming, logs and metrics#18013Lms24 wants to merge 2 commits into
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
1 Skipped Deployment
|
| If you're using <PlatformLink to="/tracing/new-spans/">Span Stream Mode</PlatformLink>, `beforeSendTransaction` has no effect. Instead, use `beforeSendSpan` with the `withStreamedSpan` helper to modify streamed spans directly. | ||
|
|
||
| </Alert> | ||
|
|
||
| We recommend using these hooks in the SDKs to **scrub any data before it is sent**, to ensure that sensitive data never leaves the local environment. |
There was a problem hiding this comment.
Bug: The documentation contains a broken link to /tracing/new-spans/ and mentions an undocumented helper API withStreamedSpan.
Severity: LOW
Suggested Fix
Remove the <PlatformLink> to the non-existent page and the mention of the withStreamedSpan helper. Alternatively, create the corresponding documentation page and add the necessary details for the feature.
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:
docs/platforms/javascript/common/data-management/sensitive-data/index.mdx#L51-L55
Potential issue: The documentation file contains a `<PlatformLink>` that points to the
path `/tracing/new-spans/`. This link is broken and will result in a 404 error for
users, as the target page does not exist within the documentation repository. The same
section also refers to a helper API named `withStreamedSpan` and a feature called "Span
Stream Mode" without providing any documentation, examples, or cross-references, making
the guidance incomplete and unactionable for developers trying to use the feature.
Did we get this right? 👍 / 👎 to inform future reviews.
There was a problem hiding this comment.
correct. The link and the API are only introduced in #17834. This PR won't be merged before that.
|
|
||
| <Alert> | ||
|
|
||
| If you're using <PlatformLink to="/tracing/new-spans/">Span Stream Mode</PlatformLink>, `beforeSendTransaction` has no effect. Instead, use `beforeSendSpan` with the `withStreamedSpan` helper to modify streamed spans directly. |
There was a problem hiding this comment.
| If you're using <PlatformLink to="/tracing/new-spans/">Span Stream Mode</PlatformLink>, `beforeSendTransaction` has no effect. Instead, use `beforeSendSpan` with the `withStreamedSpan` helper to modify streamed spans directly. | |
| If you're using <PlatformLink to="/tracing/new-spans/">stream mode</PlatformLink>, `beforeSendTransaction` has no effect. Instead, use `beforeSendSpan` with the `withStreamedSpan` helper to modify streamed spans directly. |
| SDKs provide a <PlatformIdentifier name="before-send" /> hook, which is invoked before an error or message event is sent and can be used to modify event data to remove sensitive information. Some SDKs also provide a <PlatformIdentifier name="before-send-transaction" /> hook which does the same thing for transactions. We recommend using <PlatformIdentifier name="before-send" /> and <PlatformIdentifier name="before-send-transaction" /> in the SDKs to **scrub any data before it is sent**, to ensure that sensitive data never leaves the local environment. | ||
| SDKs provide various `beforeSend*` hooks, which are invoked before an errors, messages, spans, logs or metrics are sent and can be used to modify event data to remove sensitive information. The following hooks are available: | ||
|
|
||
| - `beforeSend` applies to error and message events |
There was a problem hiding this comment.
it would be handy to link these to the respective documentation -- wdyt?
DESCRIBE YOUR PR
This PR updates the "Scrubbing Data" section in two regards:
beforeSendSpanas a hook to scrub span data and adds a note that for stream mode,beforeSendTransactionis no longer invokedbeforeSendMetricandbeforeSendLogAPIs which can be used to scrub metrics and logs respectively.Note: I also decided to remove the
PlatformIdentifiercomponents since this page is already JS-specific. No need to worry about case-ing.h/t @s1gr1d for flagging this page
IS YOUR CHANGE URGENT?
Help us prioritize incoming PRs by letting us know when the change needs to go live.
SLA
Thanks in advance for your help!
PRE-MERGE CHECKLIST
Make sure you've checked the following before merging your changes:
LEGAL BOILERPLATE
Look, I get it. The entity doing business as "Sentry" was incorporated in the State of Delaware in 2015 as Functional Software, Inc. and is gonna need some rights from me in order to utilize my contributions in this here PR. So here's the deal: I retain all rights, title and interest in and to my contributions, and by keeping this boilerplate intact I confirm that Sentry can use, modify, copy, and redistribute my contributions, under Sentry's choice of terms.
EXTRA RESOURCES