# Sentry Destination Config Reference

<p><a href="https://www.rudderstack.com/docs/destinations/streaming-destinations/sentry/" >Sentry</a> is a web device mode error monitoring destination. RudderStack&rsquo;s JavaScript SDK loads Sentry&rsquo;s browser SDK, which reports your site&rsquo;s JavaScript errors to Sentry, and sets the Sentry user from each <code>identify</code> call so errors carry who hit them.</p>
<p>In a Sentry destination spec:</p>
<ul>
<li><code>type: sentry</code></li>
<li><code>definition_version: 1</code></li>
</ul>
<!-- end-chunk -->
<!-- begin-chunk -->
<h2 id="sample-configuration">Sample configuration</h2><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">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: &#34;{{ .SENTRY_DSN }}&#34;
    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</code></pre></div>
</div>
<p>The above example reports the version in <code>window.APP_VERSION</code> as the release, falling back to <code>web-app@2.3.12</code> when the page doesn&rsquo;t define it — see <a href="#error-context" >Error context</a>.</p>
<!-- end-chunk -->
<!-- begin-chunk -->
<h2 id="config-keys">Config keys</h2><p><code>config</code> accepts only the keys listed below. The <a href="https://www.rudderstack.com/docs/dev-tools/rudder-cli/destination-types/#config-key-rules" >shared config key rules</a> cover unknown keys, defaults, and immutability.</p>

<html lang="en">
<blockquote class="info">
  <div class="tip-quote">
    
    <div class="tip-text">Sentry runs only in web device mode, and acts only on <code>identify</code> calls, which set the user attached to subsequent errors. Every key on this page configures Sentry&rsquo;s browser SDK.</div>
  </div>
</blockquote>

</html>
<!-- end-chunk -->
<!-- begin-chunk -->
<h3 id="connection">Connection</h3><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>

<!-- end-chunk -->
<!-- begin-chunk -->
<h3 id="error-context">Error context</h3><p>These keys label the errors Sentry reports. None of them is validated locally.</p>
<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>

<!-- end-chunk -->
<!-- begin-chunk -->
<h3 id="error-filtering">Error filtering</h3><p>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.</p>
<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>

<!-- end-chunk -->
<!-- begin-chunk -->
<h3 id="stack-traces">Stack traces</h3><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>

<!-- end-chunk -->
<!-- begin-chunk -->
<h3 id="debugging">Debugging</h3><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>

<!-- end-chunk -->
<!-- begin-chunk -->
<h3 id="event-filtering">Event filtering</h3>
<blockquote class="warning">
  <div class="tip-quote">
    
    <div class="tip-text"><a href="https://www.rudderstack.com/docs/sources/event-streams/sdks/event-filtering/" >Client-side event filtering</a> applies only to <code>track</code> events, and Sentry acts only on <code>identify</code> calls, so this block has no effect on what Sentry receives. Rudder CLI accepts it all the same.</div>
  </div>
</blockquote>
<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>

<!-- end-chunk -->
<!-- begin-chunk -->
<h3 id="per-source-keys">Per-source keys</h3><p>Both keys are objects keyed by the local source type — the tokens listed under <a href="#source-types" >Source types</a>. A key naming a source type this destination doesn&rsquo;t support fails validation.</p>
<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/dev-tools/rudder-cli/destination-types/#consent-management" >Consent management</a>.
</p>

</div>

</div>

<!-- end-chunk -->
<!-- begin-chunk -->
<h2 id="source-types">Source types</h2><p>Sentry accepts events from these source types in the mentioned connection modes:</p>
<table>
  <thead>
      <tr>
          <th>Source type</th>
          <th>Connection mode</th>
      </tr>
  </thead>
  <tbody>
      <tr>
          <td><code>web</code></td>
          <td><code>device</code></td>
      </tr>
  </tbody>
</table>
<p>Sentry accepts only web sources, and only in <code>device</code> mode — the SDK loads Sentry&rsquo;s browser SDK, and no events pass through RudderStack&rsquo;s servers.</p>
<!-- end-chunk -->
<!-- begin-chunk -->
<h2 id="connect-a-source">Connect a source</h2><p>An event stream connection to this destination is checked against two rules at <code>validate</code> time.</p>
<p><strong>The source&rsquo;s type must be supported.</strong> Sentry accepts only <code>web</code>, the type a JavaScript source resolves to. Every other source resolves to a type it doesn&rsquo;t accept — an iOS source to <code>ios</code>, an Android source to <code>android</code>, and webhook and server-side SDK sources to <code>cloud</code> — and reports, for example:</p>
<div class="rs-code">
  <div class="rs-code__head"><button class="rs-code__copy" type="button">
      
      Copy
    </button>
  </div>
  <div class="highlight"><pre class="chroma"><code class="language-text" data-lang="text">destination &#39;sentry-prod&#39; (type &#39;sentry&#39;) does not support source &#39;my-ios-app&#39;:
source type &#39;ios&#39; is not among supported source types: web</code></pre></div>
</div>
<p><strong>The destination config must carry a <code>connection_mode</code> entry for that source type.</strong> This lives on the destination spec, not on the <a href="https://www.rudderstack.com/docs/dev-tools/rudder-cli/yaml-connections/" >connection spec</a>. Without it:</p>
<div class="rs-code">
  <div class="rs-code__head"><button class="rs-code__copy" type="button">
      
      Copy
    </button>
  </div>
  <div class="highlight"><pre class="chroma"><code class="language-text" data-lang="text">destination &#39;sentry-prod&#39; config has no &#39;connection_mode&#39; entry for source type &#39;web&#39;</code></pre></div>
</div>
<p>Sentry needs no additional config keys to connect a web source.</p>
<!-- end-chunk -->
<!-- begin-chunk -->
<h2 id="secrets">Secrets</h2><p><code>dsn</code> is the only secret key. Write it as a <code>{{ .VAR }}</code> reference and supply the value at apply time:</p>
<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">config:
  dsn: &#34;{{ .SENTRY_DSN }}&#34;</code></pre></div>
</div>
<div class="rs-code">
  <div class="rs-code__head">bash<button class="rs-code__copy" type="button">
      
      Copy
    </button>
  </div>
  <div class="highlight"><pre class="chroma"><code class="language-bash" data-lang="bash">export RUDDER_SENTRY_DSN=&#34;...&#34;
rudder-cli apply

# or
rudder-cli apply --var-file secrets.vars.yaml</code></pre></div>
</div>
<p>Note that:</p>
<ul>
<li><code>rudder-cli import</code> writes only the secrets the API returns, as <code>{{ .VAR }}</code> references, and leaves the others out. Add any secret key it leaves out, then supply the variables before you apply — see <a href="https://www.rudderstack.com/docs/dev-tools/rudder-cli/destination-types/#secrets" >Secrets</a>.</li>
<li>The DSN is embedded in the page&rsquo;s JavaScript, so masking it protects your YAML, not the value itself.</li>
</ul>
<p>See <a href="https://www.rudderstack.com/docs/dev-tools/rudder-cli/variable-substitution/" >How to Use Variable Substitution in Rudder CLI</a>.</p>
<!-- end-chunk -->
<!-- begin-chunk -->
<h2 id="changes-by-release">Changes by release</h2>
<p>No changes since this type became available.</p>
<p>For changes across every destination type, see <a href="https://www.rudderstack.com/docs/dev-tools/rudder-cli/destination-types/changes/" >Destination Type Changes by Release</a>.</p>
<!-- end-chunk -->
<!-- begin-chunk -->
<h2 id="see-more">See more</h2><ul>
<li><a href="https://www.rudderstack.com/docs/destinations/streaming-destinations/sentry/" >Sentry Destination</a> for the public DSN, release tracking, and how <code>identify</code> sets the Sentry user</li>
<li><a href="https://www.rudderstack.com/docs/dev-tools/rudder-cli/destination-types/" >Destination Type Reference for Rudder CLI</a> for the rules shared across destination types</li>
<li><a href="https://www.rudderstack.com/docs/dev-tools/rudder-cli/yaml-destinations/" >Destination YAML Reference</a> for the spec envelope</li>
</ul>

