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

# Sentry Integration

> Investigate Sentry issues and send issue changes, alert firings, or error events to Cotool Logs.

Connect Sentry to look up issues and individual events during an investigation. If you also enable log ingestion, Sentry can send new events to Cotool Logs for search and [signal detections](https://docs.cotool.ai/detections-platform/signals.md). The API connection and webhook delivery are configured separately.

## Connect Sentry

You need a Sentry owner or manager to create an [internal integration](https://docs.sentry.io/organization/integrations/integration-platform/internal-integration/). In Cotool, use an account with organization-wide **Manage Tools** to configure the connection and webhook.

**1. Create an internal integration in Sentry**

In Sentry, go to **Settings > Developer Settings > Custom Integrations > Create New Integration** and choose **Internal Integration**.

**2. Configure scopes**

Set **Organization**, **Project**, **Member**, and **Issue & Event** to **Read**. Grant **Issue & Event: Read & Write** only if you want agents to update issues, such as resolving, archiving, assigning, or changing their priority.

**3. Connect in Cotool**

Save the integration and copy its token. In Cotool, open **Integrations > Sentry**, choose **Data region**, enter the **Organization slug** (for example, `acme` for `acme.sentry.io`), and paste the **Internal integration token**. If you select **Self-hosted**, enter the **Sentry URL** as well.

> [!NOTE]
>
> In interactive **Chat**, Cotool asks for confirmation before running the
> Sentry issue update action. Automated **response agents** do not pause for
> approval by default; enable [Require approval](https://docs.cotool.ai/agents/response-approvals.md)
> on the action in the agent's **Tools** settings if you want human review
> before an agent updates Sentry issues.

Agents can look up the issue ID from an alert and use Sentry to inspect the exception, request, release, or affected users, even if ingestion is off.

## Ingest events through a webhook

In the Cotool integration's **Log Ingest** card, enable only the streams you need:

| Stream | What Sentry delivers | Sentry configuration |
| - | - | - |
| **Issues** | Issue creation and updates, including resolution, assignment, archiving, reopening, and comments. | Enable the **issue** and **comment** webhook subscriptions. |
| **Alerts** | Firings from selected issue and metric alert rules. | Turn on **Alert Rule Action** and add the integration as an action on each alert rule Cotool should receive. |
| **Errors** | Individual error events, which can include exception, request, release, and user details. | Enable the **error** subscription. This needs a Sentry Business or Enterprise plan and can be high volume. |

**1. Configure the webhook URL and subscriptions**

Copy the **Webhook URL** from the Cotool integration's **Webhook** card.
Paste it in the Sentry internal integration and configure the
subscriptions for the streams you enabled.

**2. Save the Client Secret in Cotool**

In Sentry, save the integration and copy its **Client Secret**. Paste it
into the **Webhook** card in Cotool and save. Cotool uses this secret to
verify Sentry deliveries; it is not the API token.

**3. Verify delivery**

Wait for an event from an enabled stream. Check the latest delivery in
the **Webhook** card, then check that the event is indexed in [Log
Search](https://docs.cotool.ai/log-ingest/search.md). Webhook ingestion starts with new
deliveries; it does not backfill Sentry's history.

## Verify coverage and triage

Cotool stores received events in `cotool_logs.sentry`. Start by checking which event types have arrived:

```sql theme={null}
SELECT stream, event_type, count() AS events, max(event_time) AS latest_event
FROM cotool_logs.sentry
WHERE event_time >= now() - INTERVAL 24 HOUR
GROUP BY stream, event_type
ORDER BY latest_event DESC
```

If no events arrive, check the stream, webhook subscription or alert rule action, and client secret. Alert rules send events only when they fire. After reconnecting Sentry, update its internal integration with the new webhook URL.

> [!TIP]
>
> Review **Passthrough alerts** before routing to a response agent. By
> default, only new issues whose errors indicate possible probing are promoted
> from signals; issue alerts and critical metric alert firings can also become
> Cotool alerts. Ingesting a Sentry event does not guarantee a Cotool alert.
> See [Signals and Signal Detections](https://docs.cotool.ai/detections-platform/signals.md) and [Alert
> Routing](https://docs.cotool.ai/alerts/routing.md).


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.