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

Add beforeSendSpan option #11886

Closed
mydea opened this issue May 3, 2024 · 0 comments
Closed

Add beforeSendSpan option #11886

mydea opened this issue May 3, 2024 · 0 comments
Assignees

Comments

@mydea
Copy link
Member

mydea commented May 3, 2024

To be ready for an only-spans world, and also handle e.g. INP spans that even today are not sent in a transaction, we want to add a new option to the client: beforeSendSpan.

This should receive a SpanJSON span, allowing to mutate (but not drop) this before it is sent.

This should apply both for transaction events being sent (applying to all event.spans on the event), as well as to standalone spans sent via createSpanEnvelope().

It should look something like this:

interface ClientOptions {
  beforeSendSpan: (span: SpanJSON): SpanJSON;
}

The return value will replace the original span. We will not allow to return null here now. The callback should run before the full event is passed to beforeSendTransaction.

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

No branches or pull requests

2 participants