From 4d0f5489a046d137d938b292796270506e36e461 Mon Sep 17 00:00:00 2001 From: lcian Date: Wed, 29 Jan 2025 14:41:08 +0100 Subject: [PATCH] Add docs for `ignoredErrors` and `ignoredTransactions` for Java and Spring Boot --- .../java/common/configuration/filtering.mdx | 22 +++++++++++++++++-- .../configuration/ignore-errors/java.mdx | 3 +++ .../ignore-errors/java.spring-boot.mdx | 3 +++ .../configuration/ignore-exceptions/java.mdx | 3 +++ .../ignore-exceptions/java.spring-boot.mdx | 3 +++ .../ignore-transactions/java.mdx | 3 +++ .../ignore-transactions/java.spring-boot.mdx | 3 +++ 7 files changed, 38 insertions(+), 2 deletions(-) create mode 100644 platform-includes/configuration/ignore-errors/java.mdx create mode 100644 platform-includes/configuration/ignore-errors/java.spring-boot.mdx create mode 100644 platform-includes/configuration/ignore-exceptions/java.mdx create mode 100644 platform-includes/configuration/ignore-exceptions/java.spring-boot.mdx create mode 100644 platform-includes/configuration/ignore-transactions/java.mdx create mode 100644 platform-includes/configuration/ignore-transactions/java.spring-boot.mdx diff --git a/docs/platforms/java/common/configuration/filtering.mdx b/docs/platforms/java/common/configuration/filtering.mdx index 5b1245e5c7d0a..ded517541d60b 100644 --- a/docs/platforms/java/common/configuration/filtering.mdx +++ b/docs/platforms/java/common/configuration/filtering.mdx @@ -12,7 +12,15 @@ We also offer [Inbound Filters](/concepts/data-management/filtering/) to filter ## Filtering Error Events -Configure your SDK to filter error events by using the callback method and configuring, enabling, or disabling integrations. +Configure your SDK to filter error events by using the option or the callback method and configuring, enabling, or disabling integrations. + +### Using + +You can use the `ignoredErrors` 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, full matches will be filtered out. + + ### Using @@ -71,12 +79,21 @@ When a string or a non-error object is raised, Sentry creates a synthetic except ## 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. +To prevent certain transactions from being reported to Sentry, use the option, the option, or the callback. + +### 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, full matches will be filtered out. + + ### 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. +You can use the option to customize the traces sampling behavior. In its simplest form, used just for filtering the transaction, it looks like this: @@ -89,4 +106,5 @@ Learn more about configuring the sam ### Using +The allows you to provide a function to evaluate the current transaction and drop it if it's not one you want to capture. diff --git a/platform-includes/configuration/ignore-errors/java.mdx b/platform-includes/configuration/ignore-errors/java.mdx new file mode 100644 index 0000000000000..8e1a9392d569c --- /dev/null +++ b/platform-includes/configuration/ignore-errors/java.mdx @@ -0,0 +1,3 @@ +```properties {tabTitle: sentry.properties} +ignored-errors=Some error,Another .* +``` diff --git a/platform-includes/configuration/ignore-errors/java.spring-boot.mdx b/platform-includes/configuration/ignore-errors/java.spring-boot.mdx new file mode 100644 index 0000000000000..d9238978df290 --- /dev/null +++ b/platform-includes/configuration/ignore-errors/java.spring-boot.mdx @@ -0,0 +1,3 @@ +```properties {tabTitle: application.properties} +ignored-errors=Some error,Another .* +``` diff --git a/platform-includes/configuration/ignore-exceptions/java.mdx b/platform-includes/configuration/ignore-exceptions/java.mdx new file mode 100644 index 0000000000000..db61ec0f3a5fd --- /dev/null +++ b/platform-includes/configuration/ignore-exceptions/java.mdx @@ -0,0 +1,3 @@ +```properties {tabTitle: sentry.properties} +ignored-exceptions-for-type=java.lang.RuntimeException +``` diff --git a/platform-includes/configuration/ignore-exceptions/java.spring-boot.mdx b/platform-includes/configuration/ignore-exceptions/java.spring-boot.mdx new file mode 100644 index 0000000000000..17d609b13dd14 --- /dev/null +++ b/platform-includes/configuration/ignore-exceptions/java.spring-boot.mdx @@ -0,0 +1,3 @@ +```properties {tabTitle: application.properties} +ignored-exceptions-for-type=java.lang.RuntimeException +``` diff --git a/platform-includes/configuration/ignore-transactions/java.mdx b/platform-includes/configuration/ignore-transactions/java.mdx new file mode 100644 index 0000000000000..ab9e457ec11cc --- /dev/null +++ b/platform-includes/configuration/ignore-transactions/java.mdx @@ -0,0 +1,3 @@ +```properties {tabTitle: sentry.properties} +ignored-transactions=GET /api/person,POST .* +``` diff --git a/platform-includes/configuration/ignore-transactions/java.spring-boot.mdx b/platform-includes/configuration/ignore-transactions/java.spring-boot.mdx new file mode 100644 index 0000000000000..9a9429a8b5209 --- /dev/null +++ b/platform-includes/configuration/ignore-transactions/java.spring-boot.mdx @@ -0,0 +1,3 @@ +```properties {tabTitle: application.properties} +ignored-transactions=GET /api/person,POST .* +```