From c09a53cc47723b38d03d4aabd37efa40bc0595f5 Mon Sep 17 00:00:00 2001 From: Charly Gomez Date: Fri, 22 Nov 2024 12:46:07 +0100 Subject: [PATCH 1/2] docs(js): Add warning for usage of beforeSendSpan --- docs/platforms/javascript/common/configuration/options.mdx | 2 ++ .../configuration/options/warn-before-send-span.mdx | 5 +++++ .../configuration/before-send-span/javascript.mdx | 2 ++ 3 files changed, 9 insertions(+) create mode 100644 includes/platforms/configuration/options/warn-before-send-span.mdx diff --git a/docs/platforms/javascript/common/configuration/options.mdx b/docs/platforms/javascript/common/configuration/options.mdx index a9dc026df4c34..0d999a9aad1a6 100644 --- a/docs/platforms/javascript/common/configuration/options.mdx +++ b/docs/platforms/javascript/common/configuration/options.mdx @@ -288,6 +288,8 @@ This function is called with an SDK-specific transaction event object, and can r + + This function is called with a serialized span object, and can return a modified span object, or `null` to skip sending the span. This might be useful for manually stripping PII from spans or to remove individual spans from the span tree. This function is only called for child spans of the root span. If you want to modify or drop the root span, including all of its child spans, use [`beforeSendTransaction`](#before-send-transaction) instead. diff --git a/includes/platforms/configuration/options/warn-before-send-span.mdx b/includes/platforms/configuration/options/warn-before-send-span.mdx new file mode 100644 index 0000000000000..8052fcbf0d6e8 --- /dev/null +++ b/includes/platforms/configuration/options/warn-before-send-span.mdx @@ -0,0 +1,5 @@ +{/* TODO(v9): Remove this alert in js sdk v9 */} + + + In the Sentry JavaScript SDK v9.0.0, the ability to drop spans via `beforeSendSpan` will be removed. The callback will only allow modifying span attributes. + \ No newline at end of file diff --git a/platform-includes/configuration/before-send-span/javascript.mdx b/platform-includes/configuration/before-send-span/javascript.mdx index bcbba89531bec..7f7ee5f933608 100644 --- a/platform-includes/configuration/before-send-span/javascript.mdx +++ b/platform-includes/configuration/before-send-span/javascript.mdx @@ -1,3 +1,5 @@ + + ```javascript Sentry.init({ dsn: "___PUBLIC_DSN___", From ef16ea17f5ebab8ef51e068c8e7874c864b44a3b Mon Sep 17 00:00:00 2001 From: Charly Gomez Date: Fri, 22 Nov 2024 14:12:09 +0100 Subject: [PATCH 2/2] Update includes/platforms/configuration/options/warn-before-send-span.mdx Co-authored-by: Luca Forstner --- .../platforms/configuration/options/warn-before-send-span.mdx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/includes/platforms/configuration/options/warn-before-send-span.mdx b/includes/platforms/configuration/options/warn-before-send-span.mdx index 8052fcbf0d6e8..9963c48bb6226 100644 --- a/includes/platforms/configuration/options/warn-before-send-span.mdx +++ b/includes/platforms/configuration/options/warn-before-send-span.mdx @@ -1,5 +1,5 @@ {/* TODO(v9): Remove this alert in js sdk v9 */} - In the Sentry JavaScript SDK v9.0.0, the ability to drop spans via `beforeSendSpan` will be removed. The callback will only allow modifying span attributes. + In the Sentry JavaScript SDK v9.0.0, the ability to drop spans via `beforeSendSpan` by returning `null` will be removed. The callback will only allow modifying span attributes. \ No newline at end of file