Skip to content

Commit

Permalink
Add docs for ignoredErrors and ignoredTransactions for Java and S…
Browse files Browse the repository at this point in the history
…pring Boot
  • Loading branch information
lcian committed Jan 29, 2025
1 parent f940420 commit 4d0f548
Show file tree
Hide file tree
Showing 7 changed files with 38 additions and 2 deletions.
22 changes: 20 additions & 2 deletions docs/platforms/java/common/configuration/filtering.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -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 <PlatformIdentifier name="before-send" /> callback method and configuring, enabling, or disabling integrations.
Configure your SDK to filter error events by using the <PlatformIdentifier name="ignored-errors" /> option or the <PlatformIdentifier name="before-send" /> callback method and configuring, enabling, or disabling integrations.

### Using <PlatformIdentifier name="ignored-errors" />

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.

<PlatformContent includePath="configuration/ignore-errors" />

### Using <PlatformIdentifier name="before-send" />

Expand Down Expand Up @@ -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 <PlatformIdentifier name="traces-sampler" /> or <PlatformIdentifier name="before-send-transaction" /> 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 <PlatformIdentifier name="ignored-transactions" /> option, the <PlatformIdentifier name="traces-sampler" /> option, or the <PlatformIdentifier name="before-send-transaction" /> callback.

### Using <PlatformIdentifier name="ignored-transactions" />

You can use the <PlatformIdentifier name="ignored-transactions" /> 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.

<PlatformContent includePath="configuration/ignore-transactions" />

### Using <PlatformIdentifier name="traces-sampler" />

**Note:** The <PlatformIdentifier name="traces-sampler" /> and <PlatformIdentifier name="traces-sample-rate" /> config options are mutually exclusive. If you define a <PlatformIdentifier name="traces-sampler" /> 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 <PlatformIdentifier name="traces-sampler" /> option to customize the traces sampling behavior.
In its simplest form, used just for filtering the transaction, it looks like this:

<PlatformContent includePath="performance/traces-sampler-as-filter" />
Expand All @@ -89,4 +106,5 @@ Learn more about <PlatformLink to="/configuration/sampling/">configuring the sam

### Using <PlatformIdentifier name="before-send-transaction" />

The <PlatformIdentifier name="before-send-transaction" /> allows you to provide a function to evaluate the current transaction and drop it if it's not one you want to capture.
<PlatformContent includePath="configuration/before-send-transaction" />
3 changes: 3 additions & 0 deletions platform-includes/configuration/ignore-errors/java.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
```properties {tabTitle: sentry.properties}
ignored-errors=Some error,Another .*
```
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
```properties {tabTitle: application.properties}
ignored-errors=Some error,Another .*
```
3 changes: 3 additions & 0 deletions platform-includes/configuration/ignore-exceptions/java.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
```properties {tabTitle: sentry.properties}
ignored-exceptions-for-type=java.lang.RuntimeException
```
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
```properties {tabTitle: application.properties}
ignored-exceptions-for-type=java.lang.RuntimeException
```
3 changes: 3 additions & 0 deletions platform-includes/configuration/ignore-transactions/java.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
```properties {tabTitle: sentry.properties}
ignored-transactions=GET /api/person,POST .*
```
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
```properties {tabTitle: application.properties}
ignored-transactions=GET /api/person,POST .*
```

0 comments on commit 4d0f548

Please sign in to comment.