Skip to content

Commit 4da02d8

Browse files
authored
docs(js): Add warning for usage of beforeSendSpan (#11915)
1 parent 6026a9f commit 4da02d8

File tree

3 files changed

+9
-0
lines changed

3 files changed

+9
-0
lines changed

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

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -288,6 +288,8 @@ This function is called with an SDK-specific transaction event object, and can r
288288

289289
<ConfigKey name="before-send-span">
290290

291+
<Include name="platforms/configuration/options/warn-before-send-span.mdx" />
292+
291293
This function is called with a serialized span object, and can return a modified span object, or `null` to skip sending the span. This might be useful for manually stripping PII from spans or to remove individual spans from the span tree.
292294
This function is only called for child spans of the root span. If you want to modify or drop the root span, including all of its child spans, use [`beforeSendTransaction`](#before-send-transaction) instead.
293295

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
{/* TODO(v9): Remove this alert in js sdk v9 */}
2+
3+
<Alert level="warning">
4+
In the Sentry JavaScript SDK v9.0.0, the ability to drop spans via `beforeSendSpan` by returning `null` will be removed. The callback will only allow modifying span attributes.
5+
</Alert>

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

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
<Include name="platforms/configuration/options/warn-before-send-span.mdx" />
2+
13
```javascript
24
Sentry.init({
35
dsn: "___PUBLIC_DSN___",

0 commit comments

Comments
 (0)