> ## Documentation Index
> Fetch the complete documentation index at: https://docs.warrn.io/llms.txt
> Use this file to discover all available pages before exploring further.

# Sentry

> Receive error and issue alerts from Sentry via webhook.

| Property         | Value    |
| ---------------- | -------- |
| **Type**         | Incoming |
| **Level**        | Service  |
| **Auto-resolve** | Yes      |

Sentry sends error events and issue lifecycle events to Warrn via an Internal Integration webhook. When an alert rule fires or an issue is created, Warrn creates an alert. When an issue is resolved in Sentry, Warrn auto-resolves the matching alert. Optionally, Warrn can resolve issues back in Sentry when you resolve alerts in Warrn (bi-directional sync).

## Setup

<Steps>
  <Step title="Add the integration in Warrn">
    Open a service or team in Warrn. Go to the **Integrations** tab, add **Sentry**, and copy the generated webhook URL.
  </Step>

  <Step title="Create an Internal Integration in Sentry">
    In Sentry, go to **Settings > Developer Settings**. Click **Create New Integration** and choose **Internal Integration**. Name it (e.g. "Warrn") and paste the webhook URL from Warrn.
  </Step>

  <Step title="Configure webhooks and permissions">
    Under **Webhooks**, enable **Alert Rule Action**. Under **Permissions**, grant **Read & Write** access to **Issue & Event**. Save the integration, then copy the **Auth Token** and **Client Secret** shown on the next page.
  </Step>

  <Step title="Create an alert rule">
    In Sentry, go to **Alerts > Create Alert Rule**. Add an action that sends notifications via your new integration. This routes triggered alerts to Warrn.
  </Step>

  <Step title="Enable bi-directional sync (optional)">
    Back in Warrn, enter the **Auth Token** and your **Sentry Organization Slug** (from your Sentry URL) in the integration settings. This lets Warrn resolve issues in Sentry when you resolve alerts in Warrn.
  </Step>
</Steps>

## How it works

Sentry webhooks include a `Sentry-Hook-Resource` header indicating the resource type: `event_alert`, `issue`, or `error`.

* **event\_alert** (alert rule triggered): Creates a new alert in Warrn. Deduplicates by `issue_id`.
* **issue created**: Creates a new alert in Warrn. Deduplicates by issue `id`.
* **issue resolved**: Auto-resolves the matching Warrn alert.
* **Other issue events** (assigned, archived, etc.): Logged as timeline events on the existing alert.

### Field mapping

| Sentry field                              | Warrn field                                   |
| ----------------------------------------- | --------------------------------------------- |
| `data.event.title` / `data.issue.title`   | Alert name                                    |
| Exception details, culprit, platform, URL | Description                                   |
| `data.event.level` / `data.issue.level`   | Severity (mapped, see below)                  |
| `issue_id` or `id`                        | Alert alias (used for dedup and auto-resolve) |
| Sentry tags, issue type, issue category   | Tags                                          |

## Severity mapping

| Sentry level              | Warrn severity |
| ------------------------- | -------------- |
| `fatal`                   | critical       |
| `error`                   | high           |
| `warning`                 | medium         |
| `info`                    | low            |
| `debug`                   | low            |
| (missing or unrecognized) | medium         |

<Note>
  If you provide a **Client Secret** in Warrn, webhook signature verification is enabled. Sentry signs each request with an HMAC-SHA256 signature in the `Sentry-Hook-Signature` header.
</Note>
