From 0833ee9f1265ec12f3f96c12a9f3ab3ffb85da7f Mon Sep 17 00:00:00 2001 From: Lukas Stracke Date: Wed, 31 Jul 2024 12:03:47 +0200 Subject: [PATCH] doc(core): Improve `beforeSendSpan` JSDoc --- packages/types/src/options.ts | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/packages/types/src/options.ts b/packages/types/src/options.ts index 82123c01a380..5179c1fdb70e 100644 --- a/packages/types/src/options.ts +++ b/packages/types/src/options.ts @@ -286,11 +286,15 @@ export interface ClientOptions PromiseLike | 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;