Skip to content

Commit 889ef7e

Browse files
authored
docs(js): Update beforeSendSpan documentation (#12233)
1 parent acf44db commit 889ef7e

File tree

3 files changed

+6
-14
lines changed

3 files changed

+6
-14
lines changed

docs/platforms/javascript/common/configuration/filtering.mdx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -229,7 +229,7 @@ Learn more about <PlatformLink to="/configuration/sampling/">configuring the sam
229229

230230
Available since JavaScript SDK version `8.2.0`.
231231

232-
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.
233-
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.
232+
Use the <PlatformIdentifier name="before-send-span" /> configuration option which allows you to provide a function to modify a span.
233+
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.
234234

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

includes/platforms/configuration/options/warn-before-send-span.mdx

Lines changed: 0 additions & 5 deletions
This file was deleted.

platform-includes/configuration/before-send-span/javascript.mdx

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,12 @@
1-
<Include name="platforms/configuration/options/warn-before-send-span.mdx" />
2-
31
```javascript
42
Sentry.init({
53
dsn: "___PUBLIC_DSN___",
64

7-
// Called for spans
5+
// Called for all spans
86
beforeSendSpan(span) {
9-
// Modify or drop the span here
10-
if (span.description === 'unimportant span') {
11-
// Don't send the span to Sentry
12-
return null;
7+
// Modify the span here
8+
if (span.description === 'should be renamed') {
9+
span.description = 'renamed span';
1310
}
1411
return span;
1512
},

0 commit comments

Comments
 (0)