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

doc(core): Improve beforeSendSpan JSDoc #13131

Merged
merged 1 commit into from
Jul 31, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 7 additions & 3 deletions packages/types/src/options.ts
Original file line number Diff line number Diff line change
Expand Up @@ -286,11 +286,15 @@ export interface ClientOptions<TO extends BaseTransportOptions = BaseTransportOp
beforeSend?: (event: ErrorEvent, hint: EventHint) => PromiseLike<ErrorEvent | null> | ErrorEvent | null;

/**
* An event-processing callback for spans. This allows a span to be modified before it's sent.
*
* This function can be defined to modify or entirely drop a child span before it's sent.
* Returning `null` will cause this span to be dropped.
*
* Note that this function is only called for child spans and not for the root span (formerly known as transaction).
* If you want to modify or drop the root span, use {@link Options.beforeSendTransaction} instead.
*
* @param span The span generated by the SDK.
* @returns A new span that will be sent | null.
*
* @returns A new span that will be sent or null if the span should not be sent.
*/
beforeSendSpan?: (span: SpanJSON) => SpanJSON | null;

Expand Down
Loading