From f9955d30060c16f7369d997d139ae68dd01e1b18 Mon Sep 17 00:00:00 2001 From: Martin Haintz Date: Tue, 13 Aug 2024 11:09:20 +0200 Subject: [PATCH 1/8] add `allowUrls` and `denyUrls` for dart --- .../dart/configuration/filtering.mdx | 22 +++++++++++++++++++ .../configuration/allow-urls/dart.mdx | 14 ++++++++++++ .../configuration/deny-urls/dart.mdx | 14 ++++++++++++ 3 files changed, 50 insertions(+) create mode 100644 platform-includes/configuration/allow-urls/dart.mdx create mode 100644 platform-includes/configuration/deny-urls/dart.mdx diff --git a/docs/platforms/dart/configuration/filtering.mdx b/docs/platforms/dart/configuration/filtering.mdx index 90a18e020abf96..d453b4afdc5f57 100644 --- a/docs/platforms/dart/configuration/filtering.mdx +++ b/docs/platforms/dart/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` also accepts regular expression by adding the `^` and the `$` to the string. + +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` also accepts regular expression by adding the `^` and the `$` to the string. + +In combination with `allowUrls` you can block 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 00000000000000..025fc9a22300d7 --- /dev/null +++ b/platform-includes/configuration/allow-urls/dart.mdx @@ -0,0 +1,14 @@ +```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 00000000000000..0581c867b13557 --- /dev/null +++ b/platform-includes/configuration/deny-urls/dart.mdx @@ -0,0 +1,14 @@ +```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. + ); +} +``` From 9f37527422f08644b5a22b534be7ad11adc070de Mon Sep 17 00:00:00 2001 From: Martin Haintz Date: Tue, 13 Aug 2024 13:14:51 +0200 Subject: [PATCH 2/8] moved allowUrls and denyUrls from dart to flutter --- .../dart/configuration/filtering.mdx | 22 ------------------- .../flutter/configuration/filtering.mdx | 22 +++++++++++++++++++ 2 files changed, 22 insertions(+), 22 deletions(-) diff --git a/docs/platforms/dart/configuration/filtering.mdx b/docs/platforms/dart/configuration/filtering.mdx index d453b4afdc5f57..90a18e020abf96 100644 --- a/docs/platforms/dart/configuration/filtering.mdx +++ b/docs/platforms/dart/configuration/filtering.mdx @@ -65,28 +65,6 @@ 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` also accepts regular expression by adding the `^` and the `$` to the string. - -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` also accepts regular expression by adding the `^` and the `$` to the string. - -In combination with `allowUrls` you can block 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/docs/platforms/flutter/configuration/filtering.mdx b/docs/platforms/flutter/configuration/filtering.mdx index 90a18e020abf96..d453b4afdc5f57 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` also accepts regular expression by adding the `^` and the `$` to the string. + +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` also accepts regular expression by adding the `^` and the `$` to the string. + +In combination with `allowUrls` you can block 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. From 4a8ac7ed19d11ac388d5736e1c0c59a2218ba1cb Mon Sep 17 00:00:00 2001 From: Martin Haintz Date: Wed, 14 Aug 2024 13:05:41 +0200 Subject: [PATCH 3/8] fix: use of regular expressions --- docs/platforms/flutter/configuration/filtering.mdx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/docs/platforms/flutter/configuration/filtering.mdx b/docs/platforms/flutter/configuration/filtering.mdx index d453b4afdc5f57..047a8f962cb2f8 100644 --- a/docs/platforms/flutter/configuration/filtering.mdx +++ b/docs/platforms/flutter/configuration/filtering.mdx @@ -69,7 +69,7 @@ When a string or a non-error object is raised, Sentry creates a synthetic except 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` also accepts regular expression by adding the `^` and the `$` to the string. +`allowUrls` uses regular expression to compare. If used on a platform other than Web, this setting will be ignored. @@ -79,7 +79,7 @@ If used on a platform other than Web, this setting will be ignored. 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` also accepts regular expression by adding the `^` and the `$` to the string. +`denyUrls` uses regular expression to compare. In combination with `allowUrls` you can block subdomains of the domains listed in `allowUrls`. From 828aa5ab28b220290575edd1a2f98f7a324a84ab Mon Sep 17 00:00:00 2001 From: Martin Haintz Date: Tue, 27 Aug 2024 14:16:43 +0200 Subject: [PATCH 4/8] Update docs/platforms/flutter/configuration/filtering.mdx Co-authored-by: vivianyentran <20403606+vivianyentran@users.noreply.github.com> --- docs/platforms/flutter/configuration/filtering.mdx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/platforms/flutter/configuration/filtering.mdx b/docs/platforms/flutter/configuration/filtering.mdx index 047a8f962cb2f8..0006f94cacc17b 100644 --- a/docs/platforms/flutter/configuration/filtering.mdx +++ b/docs/platforms/flutter/configuration/filtering.mdx @@ -69,7 +69,7 @@ When a string or a non-error object is raised, Sentry creates a synthetic except 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` uses regular expression to compare. +`allowUrls` accepts regular expressions. If used on a platform other than Web, this setting will be ignored. From bdf871206c05118553a4c97de6a0d615583b1bde Mon Sep 17 00:00:00 2001 From: Martin Haintz Date: Tue, 27 Aug 2024 14:16:49 +0200 Subject: [PATCH 5/8] Update docs/platforms/flutter/configuration/filtering.mdx Co-authored-by: vivianyentran <20403606+vivianyentran@users.noreply.github.com> --- docs/platforms/flutter/configuration/filtering.mdx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/platforms/flutter/configuration/filtering.mdx b/docs/platforms/flutter/configuration/filtering.mdx index 0006f94cacc17b..8a95e3bd488126 100644 --- a/docs/platforms/flutter/configuration/filtering.mdx +++ b/docs/platforms/flutter/configuration/filtering.mdx @@ -79,7 +79,7 @@ If used on a platform other than Web, this setting will be ignored. 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` uses regular expression to compare. +`denyUrls` accepts regular expressions. In combination with `allowUrls` you can block subdomains of the domains listed in `allowUrls`. From 05eeee7172dee83cab264c1cbf52db4c844c7226 Mon Sep 17 00:00:00 2001 From: Martin Haintz Date: Tue, 27 Aug 2024 14:17:09 +0200 Subject: [PATCH 6/8] Update docs/platforms/flutter/configuration/filtering.mdx Co-authored-by: vivianyentran <20403606+vivianyentran@users.noreply.github.com> --- docs/platforms/flutter/configuration/filtering.mdx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/platforms/flutter/configuration/filtering.mdx b/docs/platforms/flutter/configuration/filtering.mdx index 8a95e3bd488126..a1cab21e091b6e 100644 --- a/docs/platforms/flutter/configuration/filtering.mdx +++ b/docs/platforms/flutter/configuration/filtering.mdx @@ -81,7 +81,7 @@ 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. -In combination with `allowUrls` you can block subdomains of the domains listed in `allowUrls`. +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. From 34063210f67e7f347f0f9a8290d461f25050d8cf Mon Sep 17 00:00:00 2001 From: Martin Haintz Date: Tue, 1 Oct 2024 15:15:49 +0200 Subject: [PATCH 7/8] Update platform-includes/configuration/allow-urls/dart.mdx Co-authored-by: Giancarlo Buenaflor --- platform-includes/configuration/allow-urls/dart.mdx | 1 - 1 file changed, 1 deletion(-) diff --git a/platform-includes/configuration/allow-urls/dart.mdx b/platform-includes/configuration/allow-urls/dart.mdx index 025fc9a22300d7..62d3d51c1eb82a 100644 --- a/platform-includes/configuration/allow-urls/dart.mdx +++ b/platform-includes/configuration/allow-urls/dart.mdx @@ -6,7 +6,6 @@ Future main() async { (options) { options.dsn = '___PUBLIC_DSN___'; options.allowUrls = ["^https://sentry.com.*\$", "my-custom-domain"]; - ... }, appRunner: initApp, // Init your App. ); From dee067156ca060a00ad6e8bcaf94995ff8b77514 Mon Sep 17 00:00:00 2001 From: Martin Haintz Date: Tue, 1 Oct 2024 15:16:00 +0200 Subject: [PATCH 8/8] Update platform-includes/configuration/deny-urls/dart.mdx Co-authored-by: Giancarlo Buenaflor --- platform-includes/configuration/deny-urls/dart.mdx | 1 - 1 file changed, 1 deletion(-) diff --git a/platform-includes/configuration/deny-urls/dart.mdx b/platform-includes/configuration/deny-urls/dart.mdx index 0581c867b13557..a8cfae64755b88 100644 --- a/platform-includes/configuration/deny-urls/dart.mdx +++ b/platform-includes/configuration/deny-urls/dart.mdx @@ -6,7 +6,6 @@ Future main() async { (options) { options.dsn = '___PUBLIC_DSN___'; options.denyUrls = ["^.*ends-with-this\$", "denied-url"]; - ... }, appRunner: initApp, // Init your App. );