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

docs(v9/js): Update beforeSendSpan documentation #12233

Draft
wants to merge 1 commit into
base: master
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions docs/platforms/javascript/common/configuration/filtering.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -229,7 +229,7 @@ Learn more about <PlatformLink to="/configuration/sampling/">configuring the sam

Available since Javascript SDK version `8.2.0`.

To prevent certain spans from being reported to Sentry, use the <PlatformIdentifier name="before-send-span" /> configuration option which allows you to provide a function to modify and drop a child span.
This function is only called for child spans of the root span. If you want to modify or drop the root span, including its child spans, use [`beforeSendTransaction`](#using-beforesendtransaction) instead.
Use the <PlatformIdentifier name="before-send-span" /> configuration option which allows you to provide a function to modify a span.
This function is called for the root span and all child spans. If you want to drop the root span, including its child spans, use [`beforeSendTransaction`](#using-beforesendtransaction) instead.

<PlatformContent includePath="configuration/before-send-span" />

This file was deleted.

11 changes: 4 additions & 7 deletions platform-includes/configuration/before-send-span/javascript.mdx
Original file line number Diff line number Diff line change
@@ -1,15 +1,12 @@
<Include name="platforms/configuration/options/warn-before-send-span.mdx" />

```javascript
Sentry.init({
dsn: "___PUBLIC_DSN___",

// Called for spans
// Called for all spans
beforeSendSpan(span) {
// Modify or drop the span here
if (span.description === 'unimportant span') {
// Don't send the span to Sentry
return null;
// Modify the span here
if (span.description === 'should be renamed') {
span.description = 'renamed span';
}
return span;
},
Expand Down
Loading