diff --git a/docs/platforms/flutter/configuration/filtering.mdx b/docs/platforms/flutter/configuration/filtering.mdx index 90a18e020abf9..a1cab21e091b6 100644 --- a/docs/platforms/flutter/configuration/filtering.mdx +++ b/docs/platforms/flutter/configuration/filtering.mdx @@ -65,6 +65,28 @@ When a string or a non-error object is raised, Sentry creates a synthetic except +#### Using `allowUrls` (Web only) + +Based on the URL, you can narrow down whether events should be sent to Sentry. +Using `allowUrls`, events are only sent if the URL matches the pattern specified in `allowUrls`. +`allowUrls` accepts regular expressions. + +If used on a platform other than Web, this setting will be ignored. + + + +#### Using `denyUrls` (Web only) + +You can exclude events sent to Sentry based on the URL. +Using `denyUrls`, events are ignored if the URL matches the pattern specified in `denyUrls`. +`denyUrls` accepts regular expressions. + +When used in combination with `allowUrls`, you can block specific subdomains of the domains listed in `allowUrls`. + +If used on a platform other than Web, this setting will be ignored. + + + ## Filtering Transaction Events To prevent certain transactions from being reported to Sentry, use the or configuration option, which allows you to provide a function to evaluate the current transaction and drop it if it's not one you want. diff --git a/platform-includes/configuration/allow-urls/dart.mdx b/platform-includes/configuration/allow-urls/dart.mdx new file mode 100644 index 0000000000000..62d3d51c1eb82 --- /dev/null +++ b/platform-includes/configuration/allow-urls/dart.mdx @@ -0,0 +1,13 @@ +```dart +import 'package:sentry/sentry.dart'; + +Future main() async { + await Sentry.init( + (options) { + options.dsn = '___PUBLIC_DSN___'; + options.allowUrls = ["^https://sentry.com.*\$", "my-custom-domain"]; + }, + appRunner: initApp, // Init your App. + ); +} +``` diff --git a/platform-includes/configuration/deny-urls/dart.mdx b/platform-includes/configuration/deny-urls/dart.mdx new file mode 100644 index 0000000000000..a8cfae64755b8 --- /dev/null +++ b/platform-includes/configuration/deny-urls/dart.mdx @@ -0,0 +1,13 @@ +```dart +import 'package:sentry/sentry.dart'; + +Future main() async { + await Sentry.init( + (options) { + options.dsn = '___PUBLIC_DSN___'; + options.denyUrls = ["^.*ends-with-this\$", "denied-url"]; + }, + appRunner: initApp, // Init your App. + ); +} +```