Skip to content

Commit a5bd22d

Browse files
docs(js-browser): adding predefined matches for ignoring common spans (#15116)
<!-- Use this checklist to make sure your PR is ready for merge. You may delete any sections you don't need. --> ## DESCRIBE YOUR PR Adding some predefined matches for ignoring common spans. ## IS YOUR CHANGE URGENT? Help us prioritize incoming PRs by letting us know when the change needs to go live. - [ ] Urgent deadline (GA date, etc.): <!-- ENTER DATE HERE --> - [ ] Other deadline: <!-- ENTER DATE HERE --> - [x] None: Not urgent, can wait up to 1 week+ ## SLA - Teamwork makes the dream work, so please add a reviewer to your PRs. - Please give the docs team up to 1 week to review your PR unless you've added an urgent due date to it. Thanks in advance for your help! ## PRE-MERGE CHECKLIST *Make sure you've checked the following before merging your changes:* - [ ] Checked Vercel preview for correctness, including links - [ ] PR was reviewed and approved by any necessary SMEs (subject matter experts) - [ ] PR was reviewed and approved by a member of the [Sentry docs team](https://github.com/orgs/getsentry/teams/docs) ## EXTRA RESOURCES - [Sentry Docs contributor guide](https://docs.sentry.io/contributing/) --------- Co-authored-by: Shannon Anahata <[email protected]>
1 parent 4b5cbc3 commit a5bd22d

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)