Skip to content

Commit 41a721a

Browse files
mydeashanamatthews
andauthored
feat: Add docs for ignoreErrors & ignoreTransactions (#6642)
--------- Co-authored-by: Shana Matthews <shana.l.matthews@gmail.com>
1 parent 8ddcb2d commit 41a721a

File tree

7 files changed

+45
-2
lines changed

7 files changed

+45
-2
lines changed

src/docs/product/accounts/quotas/manage-event-stream-guide.mdx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -355,6 +355,7 @@ The integration is enabled by default and adds the following configuration optio
355355
- `allowUrls`: Domains that might raise acceptable exceptions represented in a regex pattern format.
356356
- `denyUrls`: A list of strings or regex patterns which match error URLs that should be blocked from sending events. Configuring both `allowUrls` and `denyUrls` on the SDK can be used to block subdomains of the domains listed in `allowUrls`.
357357
- `ignoreErrors`: Instructs the SDK to never send an error to Sentry if it matches any of the listed error messages or regular expressions. The SDK will try to match against the message or, if there is no message, a string containing the exception type and value formatted like so: `ExceptionType: value`.
358+
- `ignoreTransactions`: Instructs the SDK to never send a transaction to Sentry if it matches any of the listed transaction names or regular expressions.
358359

359360
To learn more and see code samples, check out:
360361

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
```javascript
2+
Sentry.init({
3+
dsn: "___PUBLIC_DSN___",
4+
ignoreErrors: ["fb_xd_fragment", /^Exact Match Message$/],
5+
});
6+
```
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
```javascript
2+
Sentry.init({
3+
dsn: "___PUBLIC_DSN___",
4+
ignoreTransactions: ["partial/match", /^Exact Transaction Name$/],
5+
});
6+
```

src/platforms/common/configuration/filtering.mdx

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -76,6 +76,15 @@ In this example, the fingerprint is forced to a common value if an exception of
7676

7777
</PlatformSection>
7878

79+
<PlatformSection supported={["javascript", "node"]} >
80+
81+
### Using <PlatformIdentifier name="ignore-errors" />
82+
83+
You can use the <PlatformIdentifier name="ignore-errors" /> 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.
84+
85+
<PlatformContent includePath="configuration/ignore-errors" />
86+
</PlatformSection>
87+
7988
<PlatformSection supported={["android", "javascript", "java", "python"]} >
8089

8190
### Decluttering Sentry
@@ -110,4 +119,13 @@ Learn more about <PlatformLink to="/configuration/sampling/">configuring the sam
110119

111120
</PlatformSection>
112121

122+
<PlatformSection supported={["javascript", "node"]} >
123+
124+
### Using <PlatformIdentifier name="ignore-transactions" />
125+
126+
You can use the <PlatformIdentifier name="ignore-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.
127+
128+
<PlatformContent includePath="configuration/ignore-transactions" />
129+
</PlatformSection>
130+
113131
</PlatformSection>

src/platforms/common/configuration/options.mdx

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -266,6 +266,18 @@ For ASP.NET and ASP.NET Core applications, the value will default to the server'
266266

267267
</ConfigKey>
268268

269+
<ConfigKey name="ignore-errors" supported={["javascript", "node"]} notSupported={[]}>
270+
271+
A list of strings or regex patterns that match error messages that shouldn't be sent to Sentry. Messages that match these strings or regular expressions will be filtered out before they're sent to Sentry. When using strings, partial matches will be filtered out, so if you need to filter by exact match, use regex patterns instead. By default, all errors are sent.
272+
273+
</ConfigKey>
274+
275+
<ConfigKey name="ignore-transactions" supported={["javascript", "node"]} notSupported={[]}>
276+
277+
A list of strings or regex patterns that match transaction names that shouldn't be sent to Sentry. Transactions that match these strings or regular expressions will be filtered out before they're sent to Sentry. When using strings, partial matches will be filtered out, so if you need to filter by exact match, use regex patterns instead. By default, all transactions are sent.
278+
279+
</ConfigKey>
280+
269281
<ConfigKey name="deny-urls" supported={["javascript"]} notSupported={["node"]}>
270282

271283
A list of strings or regex patterns that match error URLs that should not be sent to Sentry. Errors whose entire file URL contains (string) or matches (regex) at least one entry in the list will not be sent. As a result, if you add `'foo.com'` to the list, it will also match on `https://bar.com/myfile/foo.com`. By default, all errors are sent.

src/platforms/javascript/common/configuration/integrations/default.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ message, or URLs in a given exception.
2020

2121
It ignores errors that start with `Script error` or `Javascript error: Script error` by default.
2222

23-
To configure this integration, use the `ignoreErrors`, `denyUrls`,
23+
To configure this integration, use the `ignoreErrors`, `ignoreTransactions`, `denyUrls`,
2424
and `allowUrls` SDK options directly. Keep in mind that `denyURLs` and `allowURLs`
2525
only work for captured exceptions, not raw message events.
2626

src/platforms/node/common/configuration/integrations/default-integrations.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ _Import name: `Sentry.Integrations.InboundFilters`_
1717

1818
This integration allows you to ignore specific errors based on the error message or the URL from which the exception originated.
1919

20-
To configure it, use the `ignoreErrors`, `denyUrls`, and `allowUrls` SDK options directly.
20+
To configure it, use the `ignoreErrors`, `ignoreTransactions`, `denyUrls`, and `allowUrls` SDK options directly.
2121
Keep in mind that `denyUrls` and `allowUrls` only work for captured exceptions, not raw message events.
2222

2323
### FunctionToString

0 commit comments

Comments
 (0)