Skip to content

Commit 034b14a

Browse files
authored
Add docs for ignoredErrors and ignoredTransactions for Java and Spring Boot (#12504)
1 parent 3ba8854 commit 034b14a

File tree

7 files changed

+38
-2
lines changed

7 files changed

+38
-2
lines changed

docs/platforms/java/common/configuration/filtering.mdx

Lines changed: 20 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,15 @@ We also offer [Inbound Filters](/concepts/data-management/filtering/) to filter
1212

1313
## Filtering Error Events
1414

15-
Configure your SDK to filter error events by using the <PlatformIdentifier name="before-send" /> callback method and configuring, enabling, or disabling integrations.
15+
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.
16+
17+
### Using <PlatformIdentifier name="ignored-errors" />
18+
19+
You can use the `ignoredErrors` option to filter out errors that match a certain pattern.
20+
This option receives a list of strings and regular expressions to match against the error message.
21+
When using strings, full matches will be filtered out.
22+
23+
<PlatformContent includePath="configuration/ignore-errors" />
1624

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

@@ -71,12 +79,21 @@ When a string or a non-error object is raised, Sentry creates a synthetic except
7179

7280
## Filtering Transaction Events
7381

74-
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.
82+
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.
83+
84+
### Using <PlatformIdentifier name="ignored-transactions" />
85+
86+
You can use the <PlatformIdentifier name="ignored-transactions" /> option to filter out transactions that match a certain pattern.
87+
This option receives a list of strings and regular expressions to match against the transaction name.
88+
When using strings, full matches will be filtered out.
89+
90+
<PlatformContent includePath="configuration/ignore-transactions" />
7591

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

7894
**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.
7995

96+
You can use the <PlatformIdentifier name="traces-sampler" /> option to customize the traces sampling behavior.
8097
In its simplest form, used just for filtering the transaction, it looks like this:
8198

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

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

109+
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.
92110
<PlatformContent includePath="configuration/before-send-transaction" />
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
```properties {tabTitle: sentry.properties}
2+
ignored-errors=Some error,Another .*
3+
```
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
```properties {tabTitle: application.properties}
2+
ignored-errors=Some error,Another .*
3+
```
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
```properties {tabTitle: sentry.properties}
2+
ignored-exceptions-for-type=java.lang.RuntimeException
3+
```
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
```properties {tabTitle: application.properties}
2+
ignored-exceptions-for-type=java.lang.RuntimeException
3+
```
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
```properties {tabTitle: sentry.properties}
2+
ignored-transactions=GET /api/person,POST .*
3+
```
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
```properties {tabTitle: application.properties}
2+
ignored-transactions=GET /api/person,POST .*
3+
```

0 commit comments

Comments
 (0)