Skip to content

Commit 3f6ecfc

Browse files
authored
ref(javascript): Improve beforeSendSpan documentation (#10907)
1 parent 5242eaa commit 3f6ecfc

File tree

2 files changed

+11
-9
lines changed

2 files changed

+11
-9
lines changed

docs/platforms/javascript/common/configuration/filtering.mdx

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -213,13 +213,15 @@ If the transaction currently being processed has a parent transaction (from an u
213213

214214
Learn more about <PlatformLink to="/configuration/sampling/">configuring the sample rate</PlatformLink>.
215215

216-
### Using <PlatformIdentifier name="before-send-transaction" />
216+
### Using `beforeSendTransaction`
217217

218218
<PlatformContent includePath="configuration/before-send-transaction" />
219219

220220
## Filtering Spans
221221

222-
To prevent certain spans from being reported to Sentry, use the <PlatformIdentifier name="before-send-span" /> configuration option, which allows you to provide a function to evaluate the current span and drop it if it's not one you want.
223-
This API is available from Javascript SDK version 8.2.0 and above.
222+
Available since Javascript SDK version `8.2.0`.
223+
224+
To prevent certain spans from being reported to Sentry, use the <PlatformIdentifier name="before-send-span" /> configuration option which allows you to provide a function to modify and drop a child span.
225+
This function is only called for child spans of the root span. If you want to modify or drop the root span, including its child spans, use [`beforeSendTransaction`](#using-beforesendtransaction) instead.
224226

225227
<PlatformContent includePath="configuration/before-send-span" />

docs/platforms/javascript/common/configuration/options.mdx

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -293,20 +293,20 @@ This function is called with an SDK-specific transaction event object, and can r
293293

294294
</ConfigKey>
295295

296-
<ConfigKey name="before-breadcrumb">
296+
<ConfigKey name="before-send-span">
297297

298-
This function is called with an SDK-specific breadcrumb object before the breadcrumb is added to the scope. When nothing is returned from the function, the breadcrumb is dropped. To pass the breadcrumb through, return the first argument, which contains the breadcrumb object.
299-
The callback typically gets a second argument (called a "hint") which contains the original object from which the breadcrumb was created to further customize what the breadcrumb should look like.
298+
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.
299+
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.
300300

301301
</ConfigKey>
302302

303-
<ConfigKey name="before-send-span">
303+
<ConfigKey name="before-breadcrumb">
304304

305-
This function is called with an SDK-specific span object, and can return a modified span object, or `null` to skip reporting the span. One way this might be used is for manual PII stripping before sending.
305+
This function is called with an SDK-specific breadcrumb object before the breadcrumb is added to the scope. When nothing is returned from the function, the breadcrumb is dropped. To pass the breadcrumb through, return the first argument, which contains the breadcrumb object.
306+
The callback typically gets a second argument (called a "hint") which contains the original object from which the breadcrumb was created to further customize what the breadcrumb should look like.
306307

307308
</ConfigKey>
308309

309-
310310
## Transport Options
311311

312312
Transports are used to send events to Sentry. Transports can be customized to some degree to better support highly specific deployments.

0 commit comments

Comments
 (0)