From 30dc4cbda40558200bbd93e30278fdffa8665fb7 Mon Sep 17 00:00:00 2001 From: Martin Haintz Date: Tue, 13 Aug 2024 10:32:38 +0200 Subject: [PATCH] add ignoreErrors and ignoreTransactions for Dart (#10989) * add ignoreErrors and ignoreTransactions for Dart * improved misleading code samples for ignoreErrors and ignoreTransactions * removed unnecessary backslash from codesamples --- docs/platforms/dart/configuration/filtering.mdx | 12 ++++++++++++ .../configuration/ignore-errors/dart.mdx | 10 ++++++++++ .../configuration/ignore-transactions/dart.mdx | 10 ++++++++++ 3 files changed, 32 insertions(+) create mode 100644 platform-includes/configuration/ignore-errors/dart.mdx create mode 100644 platform-includes/configuration/ignore-transactions/dart.mdx diff --git a/docs/platforms/dart/configuration/filtering.mdx b/docs/platforms/dart/configuration/filtering.mdx index 90a18e020abf9..09d6639c0db06 100644 --- a/docs/platforms/dart/configuration/filtering.mdx +++ b/docs/platforms/dart/configuration/filtering.mdx @@ -14,6 +14,12 @@ We also offer [Inbound Filters](/concepts/data-management/filtering/) to filter Configure your SDK to filter error events by using the callback method and configuring, enabling, or disabling integrations. +### Using + +You can use the option to filter out errors that match a certain pattern. This option receives a list of strings and regular expressions to match against the error message. When using strings, partial matches will be filtered out. If you need to filter by exact match, use regex patterns instead. + + + ### Using All Sentry SDKs support the callback method. Because it's called immediately before the event is sent to the server, this is your last chance to decide not to send data or to edit it. receives the event object as a parameter, which you can use to either modify the event’s data or drop it completely by returning `null`, based on custom logic and the data available on the event. @@ -69,6 +75,12 @@ When a string or a non-error object is raised, Sentry creates a synthetic except 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. +### Using + +You can use the option to filter out transactions that match a certain pattern. This option receives a list of strings and regular expressions to match against the transaction name. When using strings, partial matches will be filtered out. If you need to filter by exact match, use regex patterns instead. + + + ### Using **Note:** The and config options are mutually exclusive. If you define a to filter out certain transactions, you must also handle the case of non-filtered transactions by returning the rate at which you'd like them sampled. diff --git a/platform-includes/configuration/ignore-errors/dart.mdx b/platform-includes/configuration/ignore-errors/dart.mdx new file mode 100644 index 0000000000000..1196b49e59d78 --- /dev/null +++ b/platform-includes/configuration/ignore-errors/dart.mdx @@ -0,0 +1,10 @@ +```dart + await SentryFlutter.init( + (options) { + options.dsn = '___PUBLIC_DSN___'; + options.ignoreErrors = ["my-error", "^error-.*\$"]; + ... + }, + appRunner: () => runApp(MyApp()), + ); +``` diff --git a/platform-includes/configuration/ignore-transactions/dart.mdx b/platform-includes/configuration/ignore-transactions/dart.mdx new file mode 100644 index 0000000000000..607847272da60 --- /dev/null +++ b/platform-includes/configuration/ignore-transactions/dart.mdx @@ -0,0 +1,10 @@ +```dart + await SentryFlutter.init( + (options) { + options.dsn = '___PUBLIC_DSN___'; + options.ignoreTransactions = ["my-transaction", "^transaction-.*\$" ]; + ... + }, + appRunner: () => runApp(MyApp()), + ); +```