Skip to content

fix: Bad function type for beforeSendSpan #16439

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

Closed
wants to merge 2 commits into from

Conversation

zhiyan114
Copy link
Contributor

Fixed a type issue where beforeSendSpan cannot return null despite the docs says it's used to drop spans.

@Lms24
Copy link
Member

Lms24 commented Jun 3, 2025

Hey @zhiyan114 thanks for opening this PR! Unfortunately, beforeSendSpan really can't return null since version 9 of the SDK. Ever since this version, we cannot let spans being dropped retroactively because doing so would risk span metrics extrapolation being off.

I have two questions for you:

I'm going to close this PR because unfortunately, the type change does not apply anymore. Still, thanks a lot for contributing!

@Lms24 Lms24 closed this Jun 3, 2025
Lms24 added a commit to getsentry/sentry-docs that referenced this pull request Jun 4, 2025
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.
antonpirker pushed a commit to getsentry/sentry-docs that referenced this pull request Jun 6, 2025
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.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants