Skip to content

Commit b8f2f40

Browse files
committed
docs(js-browser): adding predefined matches for ignoring common spans
1 parent c2f683e commit b8f2f40

File tree

2 files changed

+26
-1
lines changed

2 files changed

+26
-1
lines changed

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

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -449,6 +449,31 @@ If a root span matches any of the specified patterns, the entire local trace wil
449449

450450
By default, no spans are ignored.
451451

452+
Here are some predefined matches for common spans to get you started:
453+
```javascript
454+
Sentry.init({
455+
ignoreSpans: [
456+
// Browser connection events
457+
{op: /^browser\.(cache|connect|DNS)$/},
458+
459+
// Fonts
460+
{op: 'resource.other', name: /\.(woff2|woff|ttf|eot)$/},
461+
462+
// CSS files
463+
{op: 'resource.link', name: /.+\.css.*$/},
464+
465+
// JS files
466+
{op: /resource.(link|script)/, name: /.+\.js.*$/},
467+
468+
// Images
469+
{op: /resource.(other|img)/, name: /.+\.(png|svg|jpe?g|gif|bmp|tiff?|webp|avif|heic?|ico).*$/},
470+
471+
// Measure spans
472+
{op: 'measure'},
473+
]
474+
});
475+
```
476+
452477
</SdkOption>
453478

454479
<SdkOption name="propagateTraceparent" type='boolean' defaultValue='false' availableSince='10.10.0' categorySupported={['browser']}>

docs/platforms/javascript/common/configuration/tree-shaking.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
---
22
title: Tree Shaking
3-
sidebar_order: 11000
3+
sidebar_order: 70
44
description: "Learn how to reduce Sentry bundle size by tree shaking unused code."
55
notSupported:
66
- javascript.aws-lambda

0 commit comments

Comments
 (0)