# Sentry Destination Config Reference


> Complete Rudder CLI reference for the Sentry destination config keys, error context, error filtering, and stack trace settings.



[Sentry](https://www.rudderstack.com/docs/destinations/streaming-destinations/sentry/) is a web device mode error monitoring destination. RudderStack's JavaScript SDK loads Sentry's browser SDK, which reports your site's JavaScript errors to Sentry, and sets the Sentry user from each `identify` call so errors carry who hit them.

In a Sentry destination spec:

- `type: sentry`
- `definition_version: 1`

## Sample configuration

```yaml
version: rudder/v1
kind: destination
metadata:
  name: sentry-prod
spec:
  id: sentry-prod
  display_name: Sentry Production
  type: sentry
  definition_version: 1
  enabled: true
  config:
    dsn: "{{ .SENTRY_DSN }}"
    environment: production
    custom_version_property: APP_VERSION
    release: web-app@2.3.12
    server_name: web-frontend
    logger: rudderstack
    debug_mode: false

    ignore_errors:
      - ResizeObserver loop limit exceeded
    allow_urls:
      - https://www.example.com
    deny_urls:
      - chrome-extension://
    include_paths:
      - example\.com/assets/

    connection_mode:
      web: device
    consent_management:
      web:
        - provider: oneTrust
          consents:
            - analytics
```

The above example reports the version in `window.APP_VERSION` as the release, falling back to `web-app@2.3.12` when the page doesn't define it — see [Error context](#error-context).

## Config keys

`config` accepts only the keys listed below. The [shared config key rules](https://www.rudderstack.com/docs/rudder-cli/destination-types/#config-key-rules) cover unknown keys, defaults, and immutability.

**Info:** Sentry runs only in web device mode, and acts only on `identify` calls, which set the user attached to subsequent errors. Every key on this page configures Sentry&#39;s browser SDK.

### Connection

<div class="rs-ckeys">
<div class="rs-ckey" id="dsn">
  <div class="rs-ckey__title">
    <p class="rs-ckey__name">dsn</p>RequiredSecret</div>
  <p class="rs-ckey__field">
    Type:
    <code>string</code>
  </p>
<p class="rs-ckey__field">
  Description:
  Public DSN of your Sentry project — the URL Sentry&rsquo;s browser SDK reports errors to, from the project&rsquo;s <strong>Client Keys (DSN)</strong> settings. The dashboard calls it <strong>Public DSN</strong>.
</p>

<div class="rs-ckey__notes">
  <p class="rs-ckey__field">Notes:</p>
  <ul>
<li>At most 300 characters, and must not contain line breaks.</li>
<li>A <code>{{ path || fallback }}</code> template is accepted in place of a literal.</li>
</ul>

</div>

<div class="rs-ckey__extra">
  <p>Supply it as a <code>{{ .VAR }}</code> reference rather than a literal — see <a href="#secrets" >Secrets</a>.</p>
<p>See <a href="https://www.rudderstack.com/docs/destinations/streaming-destinations/sentry/#how-do-i-get-the-public-dsn-of-my-sentry-project" >How do I get the public DSN of my Sentry Project?</a>.</p>

</div>

</div>

</div>

### Error context

These keys label the errors Sentry reports. None of them is validated locally.

<div class="rs-ckeys">
<div class="rs-ckey" id="environment">
  <div class="rs-ckey__title">
    <p class="rs-ckey__name">environment</p></div>
  <p class="rs-ckey__field">
    Type:
    <code>string</code>
  </p>
<p class="rs-ckey__field">
  Description:
  Environment Sentry files errors under, such as <code>production</code> or <code>staging</code>.
</p>

<div class="rs-ckey__notes">
  <p class="rs-ckey__field">Notes:</p>
  <ul>
<li>Sentry silently drops an environment that contains a forward slash, a space, or a line break, or that is <code>None</code>.</li>
</ul>

</div>

</div>

<div class="rs-ckey" id="custom_version_property">
  <div class="rs-ckey__title">
    <p class="rs-ckey__name">custom_version_property</p></div>
  <p class="rs-ckey__field">
    Type:
    <code>string</code>
  </p>
<p class="rs-ckey__field">
  Description:
  Name of a global <code>window</code> variable holding your app&rsquo;s version. When the page defines it, its value is sent as the release, taking precedence over <code>release</code>. The dashboard calls it <strong>Set Release By Property</strong>.
</p>

<div class="rs-ckey__notes">
  <p class="rs-ckey__field">Notes:</p>
  <ul>
<li>A top-level variable name, not a dotted path: <code>APP_VERSION</code> reads <code>window.APP_VERSION</code>.</li>
</ul>

</div>

<div class="rs-ckey__extra">
  <div class="rs-code">
  <div class="rs-code__head">yaml<button class="rs-code__copy" type="button">
      
      Copy
    </button>
  </div>
  <div class="highlight"><pre class="chroma"><code class="language-yaml" data-lang="yaml">custom_version_property: APP_VERSION
release: web-app@2.3.12</code></pre></div>
</div>
</div>

</div>

<div class="rs-ckey" id="release">
  <div class="rs-ckey__title">
    <p class="rs-ckey__name">release</p></div>
  <p class="rs-ckey__field">
    Type:
    <code>string</code>
  </p>
<p class="rs-ckey__field">
  Description:
  Release, or app version, Sentry attaches to each error, such as <code>web-app@2.3.12</code>.
</p>

<div class="rs-ckey__notes">
  <p class="rs-ckey__field">Notes:</p>
  <ul>
<li>Used when <code>custom_version_property</code> is unset, or names a variable the page doesn&rsquo;t define.</li>
<li>Sentry discards session data that has no release, so set <code>release</code>, <code>custom_version_property</code>, or both.</li>
</ul>

</div>

</div>

<div class="rs-ckey" id="server_name">
  <div class="rs-ckey__title">
    <p class="rs-ckey__name">server_name</p></div>
  <p class="rs-ckey__field">
    Type:
    <code>string</code>
  </p>
<p class="rs-ckey__field">
  Description:
  Server name Sentry attaches to each error, identifying the host the client runs on.
</p>

</div>

<div class="rs-ckey" id="logger">
  <div class="rs-ckey__title">
    <p class="rs-ckey__name">logger</p></div>
  <p class="rs-ckey__field">
    Type:
    <code>string</code>
  </p>
<p class="rs-ckey__field">
  Description:
  Value of the <code>logger</code> tag set on every error Sentry reports.
</p>

</div>

</div>

### Error filtering

These keys decide which errors Sentry reports. Each entry is matched as plain text, not as a regular expression: an entry matches any message or URL that contains it.

<div class="rs-ckeys">
<div class="rs-ckey" id="ignore_errors">
  <div class="rs-ckey__title">
    <p class="rs-ckey__name">ignore_errors</p></div>
  <p class="rs-ckey__field">
    Type:
    <code>array of strings</code>
  </p>
<p class="rs-ckey__field">
  Description:
  Error messages Sentry doesn&rsquo;t report. An error whose message contains an entry is dropped.
</p>

<div class="rs-ckey__notes">
  <p class="rs-ckey__field">Notes:</p>
  <ul>
<li>Each entry is at most 100 characters, or a <code>{{ path || fallback }}</code> template.</li>
</ul>

</div>

</div>

<div class="rs-ckey" id="allow_urls">
  <div class="rs-ckey__title">
    <p class="rs-ckey__name">allow_urls</p></div>
  <p class="rs-ckey__field">
    Type:
    <code>array of strings</code>
  </p>
<p class="rs-ckey__field">
  Description:
  Script URLs Sentry reports errors from. When the list is set, only errors raised by a script whose URL contains an entry are reported.
</p>

<div class="rs-ckey__notes">
  <p class="rs-ckey__field">Notes:</p>
  <ul>
<li>Each entry must not contain line breaks. Any entry containing <code>.ngrok.io</code> is rejected.</li>
<li>A <code>{{ path || fallback }}</code> template is accepted in place of a literal.</li>
</ul>

</div>

</div>

<div class="rs-ckey" id="deny_urls">
  <div class="rs-ckey__title">
    <p class="rs-ckey__name">deny_urls</p></div>
  <p class="rs-ckey__field">
    Type:
    <code>array of strings</code>
  </p>
<p class="rs-ckey__field">
  Description:
  Script URLs whose errors Sentry doesn&rsquo;t report — for example, browser extensions or third-party scripts. An error raised by a script whose URL contains an entry is dropped.
</p>

<div class="rs-ckey__notes">
  <p class="rs-ckey__field">Notes:</p>
  <ul>
<li>Each entry must not contain line breaks. Any entry containing <code>.ngrok.io</code> is rejected.</li>
<li>A <code>{{ path || fallback }}</code> template is accepted in place of a literal.</li>
</ul>

</div>

<div class="rs-ckey__extra">
  <div class="rs-code">
  <div class="rs-code__head">yaml<button class="rs-code__copy" type="button">
      
      Copy
    </button>
  </div>
  <div class="highlight"><pre class="chroma"><code class="language-yaml" data-lang="yaml">deny_urls:
  - chrome-extension://
  - cdn.thirdparty.example</code></pre></div>
</div>
</div>

</div>

</div>

### Stack traces

<div class="rs-ckeys">
<div class="rs-ckey" id="include_paths">
  <div class="rs-ckey__title">
    <p class="rs-ckey__name">include_paths</p></div>
  <p class="rs-ckey__field">
    Type:
    <code>array of strings</code>
  </p>
<p class="rs-ckey__field">
  Description:
  Regular expressions matching the URLs of your app&rsquo;s own scripts. A stack frame whose file URL matches an entry is marked as your app&rsquo;s code, and every other frame as third-party, which Sentry collapses in the stack trace.
</p>

<div class="rs-ckey__notes">
  <p class="rs-ckey__field">Notes:</p>
  <ul>
<li>An entry that isn&rsquo;t a valid regular expression is skipped.</li>
<li>Each entry is at most 100 characters, or a <code>{{ path || fallback }}</code> template.</li>
</ul>

</div>

<div class="rs-ckey__extra">
  <div class="rs-code">
  <div class="rs-code__head">yaml<button class="rs-code__copy" type="button">
      
      Copy
    </button>
  </div>
  <div class="highlight"><pre class="chroma"><code class="language-yaml" data-lang="yaml">include_paths:
  - example\.com/assets/</code></pre></div>
</div>
</div>

</div>

</div>

### Debugging

<div class="rs-ckeys">
<div class="rs-ckey" id="debug_mode">
  <div class="rs-ckey__title">
    <p class="rs-ckey__name">debug_mode</p></div>
  <p class="rs-ckey__field">
    Type:
    <code>boolean</code>
  </p><p class="rs-ckey__field">
    Default value:
    <code>false</code>
  </p>
<p class="rs-ckey__field">
  Description:
  Turn on the Sentry SDK&rsquo;s debug mode, which logs the SDK&rsquo;s diagnostic messages to the browser console. It doesn&rsquo;t stop errors from being sent to Sentry.
</p>

</div>

</div>

### Event filtering

**Warning:** [Client-side event filtering](https://www.rudderstack.com/docs/sources/event-streams/sdks/event-filtering/) applies only to `track` events, and Sentry acts only on `identify` calls, so this block has no effect on what Sentry receives. Rudder CLI accepts it all the same.

<div class="rs-ckeys">
<div class="rs-ckey" id="event_filtering">
  <div class="rs-ckey__title">
    <p class="rs-ckey__name">event_filtering</p></div>
  <p class="rs-ckey__field">
    Type:
    <code>object</code>
  </p>
<p class="rs-ckey__field">
  Description:
  Restricts which <code>track</code> events the SDK passes to Sentry, by event name.
</p>

<div class="rs-ckey__notes">
  <p class="rs-ckey__field">Notes:</p>
  <ul>
<li><code>whitelist</code> — array of event names to allow; every other <code>track</code> event is dropped.</li>
<li><code>blacklist</code> — array of event names to drop; every other <code>track</code> event is allowed.</li>
<li>The two are mutually exclusive, and Rudder CLI enforces it — setting both fails validation.</li>
<li>Each name is at most 100 characters, or a <code>{{ path || fallback }}</code> template.</li>
</ul>

</div>

</div>

</div>

### Per-source keys

Both keys are objects keyed by the local source type — the tokens listed under [Source types](#source-types). A key naming a source type this destination doesn't support fails validation.

<div class="rs-ckeys">
<div class="rs-ckey" id="connection_mode">
  <div class="rs-ckey__title">
    <p class="rs-ckey__name">connection_mode</p></div>
  <p class="rs-ckey__field">
    Type:
    <code>object</code>
  </p>
<p class="rs-ckey__field">
  Description:
  Maps each source type you connect to the mode its events reach Sentry in. Sentry accepts only <code>web: device</code>.
</p>

<div class="rs-ckey__notes">
  <p class="rs-ckey__field">Notes:</p>
  <ul>
<li>An entry is required for each source type you connect — see <a href="#connect-a-source" >Connect a source</a>.</li>
</ul>

</div>

<div class="rs-ckey__extra">
  <div class="rs-code">
  <div class="rs-code__head">yaml<button class="rs-code__copy" type="button">
      
      Copy
    </button>
  </div>
  <div class="highlight"><pre class="chroma"><code class="language-yaml" data-lang="yaml">connection_mode:
  web: device</code></pre></div>
</div>
</div>

</div>

<div class="rs-ckey" id="consent_management">
  <div class="rs-ckey__title">
    <p class="rs-ckey__name">consent_management</p></div>
  <p class="rs-ckey__field">
    Type:
    <code>object</code>
  </p>
<p class="rs-ckey__field">
  Description:
  Consent provider configuration per source type. The entry shape, accepted providers, and the rules on <code>resolution_strategy</code> and <code>consents</code> are shared across all destination types — see <a href="https://www.rudderstack.com/docs/rudder-cli/destination-types/#consent-management" >Consent management</a>.
</p>

</div>

</div>

## Source types

Sentry accepts events from these source types in the mentioned connection modes:

| Source type | Connection mode |
| :-----| :-----|
| `web` | `device` |

Sentry accepts only web sources, and only in `device` mode — the SDK loads Sentry's browser SDK, and no events pass through RudderStack's servers.

## Connect a source

An event stream connection to this destination is checked against two rules at `validate` time.

**The source's type must be supported.** Sentry accepts only `web`, the type a JavaScript source resolves to. Every other source resolves to a type it doesn't accept — an iOS source to `ios`, an Android source to `android`, and webhook and server-side SDK sources to `cloud` — and reports, for example:

```text
destination 'sentry-prod' (type 'sentry') does not support source 'my-ios-app':
source type 'ios' is not among supported source types: web
```

**The destination config must carry a `connection_mode` entry for that source type.** This lives on the destination spec, not on the [connection spec](https://www.rudderstack.com/docs/rudder-cli/yaml-connections/). Without it:

```text
destination 'sentry-prod' config has no 'connection_mode' entry for source type 'web'
```

Sentry needs no additional config keys to connect a web source.

## Secrets

`dsn` is the only secret key. Write it as a `{{ .VAR }}` reference and supply the value at apply time:

```yaml
config:
  dsn: "{{ .SENTRY_DSN }}"
```

```bash
export RUDDER_SENTRY_DSN="..."
rudder-cli apply

# or
rudder-cli apply --var-file secrets.vars.yaml
```

Note that:

- `rudder-cli import` writes only the secrets the API returns, as `{{ .VAR }}` references, and leaves the others out. Add any secret key it leaves out, then supply the variables before you apply — see [Secrets](https://www.rudderstack.com/docs/rudder-cli/destination-types/#secrets).
- The DSN is embedded in the page's JavaScript, so masking it protects your YAML, not the value itself.

See [How to Use Variable Substitution in Rudder CLI](https://www.rudderstack.com/docs/rudder-cli/variable-substitution/).

## Changes by release

<p>No changes since this type became available.</p>

For changes across every destination type, see [Destination Type Changes by Release](https://www.rudderstack.com/docs/rudder-cli/destination-types/changes/).

## See more

- [Sentry Destination](https://www.rudderstack.com/docs/destinations/streaming-destinations/sentry/) for the public DSN, release tracking, and how `identify` sets the Sentry user
- [Destination Type Reference for Rudder CLI](https://www.rudderstack.com/docs/rudder-cli/destination-types/) for the rules shared across destination types
- [Destination YAML Reference](https://www.rudderstack.com/docs/rudder-cli/yaml-destinations/) for the spec envelope

