diff --git a/docs/platforms/javascript/common/configuration/options.mdx b/docs/platforms/javascript/common/configuration/options.mdx index 39d18858533a4..bdc37e8143f41 100644 --- a/docs/platforms/javascript/common/configuration/options.mdx +++ b/docs/platforms/javascript/common/configuration/options.mdx @@ -449,6 +449,31 @@ If a root span matches any of the specified patterns, the entire local trace wil By default, no spans are ignored. +Here are some predefined matches for common spans to get you started: +```javascript +Sentry.init({ + ignoreSpans: [ + // Browser connection events + {op: /^browser\.(cache|connect|DNS)$/}, + + // Fonts + {op: 'resource.other', name: /.+\.(woff2|woff|ttf|eot)$/}, + + // CSS files + {op: 'resource.link', name: /.+\.css.*$/}, + + // JS files + {op: /resource\.(link|script)/, name: /.+\.js.*$/}, + + // Images + {op: /resource\.(other|img)/, name: /.+\.(png|svg|jpe?g|gif|bmp|tiff?|webp|avif|heic?|ico).*$/}, + + // Measure spans + {op: 'measure'}, + ] +}); +``` + diff --git a/docs/platforms/javascript/common/configuration/tree-shaking.mdx b/docs/platforms/javascript/common/configuration/tree-shaking.mdx index 29fe10525d155..aae211e95447f 100644 --- a/docs/platforms/javascript/common/configuration/tree-shaking.mdx +++ b/docs/platforms/javascript/common/configuration/tree-shaking.mdx @@ -1,6 +1,6 @@ --- title: Tree Shaking -sidebar_order: 11000 +sidebar_order: 70 description: "Learn how to reduce Sentry bundle size by tree shaking unused code." notSupported: - javascript.aws-lambda