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

# Sentry Integration

> Integrate with Sentry to give Annie access to your errors, releases, and performance data during incident investigations.

# Sentry Integration

Connect Sentry to give Annie visibility into application errors, releases, and performance regressions. During an incident, Annie can correlate Sentry issues with your infrastructure changes and surface the events that matter.

## Setup Guide

1. Go to the [Sentry integration page](https://app.anyshift.io/integrations/incidents-management/sentry)
2. Click **New token** to add your Sentry user auth token
3. Fill in the form fields below and click **Save Sentry token**

### 1. Display name

A human-readable label for this token (e.g. `Production Sentry`). Used only to identify the credential in the Anyshift UI.

### 2. Auth token

A Sentry **user auth token**. Generate one from your Sentry account under **User Settings > Auth Tokens > Create New Token**.

### 3. Host (optional)

Leave this field empty to use Sentry SaaS (`sentry.io`).

For self-hosted or organization-scoped instances, enter the **bare hostname** — for example `anyshift.sentry.io`. Do not include `https://`

### Required Permissions

The auth token needs the following scopes for Annie to access your Sentry data:

* `org:read` — Read organization information
* `project:read` — List and read projects
* `event:read` — Read issues and events. **Also required by the webhook below.** When a regression arrives, Anyshift uses this same token to read the issue's latest event for its **release version**, **commit SHA**, and **trace id**. Without `event:read` the regression is still recorded, but those fields stay empty and Annie cannot tie it back to the release, commit, and author that caused it.

## Sentry Webhook (real-time event ingestion)

The auth token above lets Annie **read** Sentry on demand. The **webhook** does the opposite: it lets Sentry **push** error **regressions** to Anyshift in real time, so Annie can tie each returning error back to the release and commit that caused it.

> **The webhook needs the auth token too.** The webhook delivery carries the issue, but not its release or commit. Anyshift fills those in using the **auth token from step 2** (which must include `event:read`). So configure the auth token first; a webhook with no `event:read` token records regressions without the release, commit, and author link.

The webhook is delivered by a Sentry **internal integration** that you create inside your own Sentry organization and point at a per-project URL we give you. The integration signs each delivery with its **Client Secret**, which you submit to Anyshift so we can verify it. Each Sentry org provides its own secret; we store it encrypted and use it only to verify incoming signatures.

1. On the [Sentry integration page](https://app.anyshift.io/integrations/incidents-management/sentry), find the **Webhook** section and **copy the webhook URL** shown there — it is unique to your project.
2. In Sentry, go to **Settings → Developer Settings → Custom Integrations → New Internal Integration**.
3. Name it (e.g. `Anyshift`). Under **Permissions**, set **Issue & Event** to **Read**.
4. Under **Webhooks**, enable the **issue** resource and set the **Webhook URL** to the URL you copied in step 1.
5. **Save** the integration — Sentry generates a **Client Secret**. Copy it.
6. Back in Anyshift's **Webhook** section, paste the **Client Secret** and click **Save**. The section will show as configured.

### What gets recorded

Only **regressions** are recorded — a Sentry issue that was previously resolved and has come back (`unresolved`). New or ongoing errors are **not** ingested. When a regression arrives, Anyshift stores a durable record (issue id, title, error type, level, platform, first-seen, environment) and enriches it with the immutable **release version**, **commit SHA**, and a sample **trace id** — so Annie can pivot straight into the offending change and into your APM/logs. Volatile fields (current event count, affected users, status, assignee) are read live via the Sentry API rather than stored.

## How It Works

Once connected, Annie's AI agent can:

* **Investigate errors** — Pull issue details, stack traces, and event payloads
* **Correlate with releases** — Tie errors to the release that introduced them
* **Surface performance regressions** — Identify performance issues that coincide with infrastructure or deploy changes
* **Link to your resource graph** — Map Sentry projects and services to the cloud resources they run on

**Anyshift + Sentry = faster root cause on application-layer incidents.**
