Skip to content

Commit c033e0c

Browse files
Lms24bitsandfoxes
authored andcommitted
fix(js): Fix incorrect beforeSendSpan callback type (#13906)
Implicitly reported via getsentry/sentry-javascript#16439 that according to the type in the options page, the `beforeSendSpan` callback can return `null`. This is no longer the case since v9 of the SDK.
1 parent ea764fe commit c033e0c

File tree

1 file changed

+2
-2
lines changed
  • docs/platforms/javascript/common/configuration

1 file changed

+2
-2
lines changed

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -385,10 +385,10 @@ This function is called with a transaction event object, and can return a modifi
385385

386386
</SdkOption>
387387

388-
<SdkOption name="beforeSendSpan" type='(span: SpanJSON) => SpanJSON | null'>
388+
<SdkOption name="beforeSendSpan" type='(span: SpanJSON) => SpanJSON'>
389389

390390
This function is called with a serialized span object, and can return a modified span object. This might be useful for manually stripping PII from spans.
391-
This function is only called for root spans and all children.
391+
This function is called for root spans as well as for all child spans.
392392
If you want to drop the root span, including all of its child spans, use [`beforeSendTransaction`](#beforeSendTransaction) instead.
393393

394394
Please note that the `span` you receive as an argument is a serialized object, not a `Span` class instance.

0 commit comments

Comments
 (0)