Sentry Integration
Connect Sentry to enable agents to analyze errors, exceptions, and performance issues during investigations. Sentry can also be configured as an alert source to automatically trigger investigations when new issues are created or resolved.
Capabilities
Once connected, agents can:
| Capability | Description |
|---|---|
| View Issues | Browse and search error issues |
| Analyze Events | Examine individual error events and stack traces |
| Check Releases | Review release health and regressions |
| Performance Data | Access transaction performance metrics |
| Webhook Triggers | Automatically start investigations when new Sentry issues appear |
Write tools on this integration (add comments to issues) are available to an agent unless its tool filters exclude them. A governance policy on write operations pauses each write for a person to approve. Every call is recorded in the Audit Trail.
Prerequisites
- A Sentry account (Cloud or self-hosted)
- The Owner or Manager role in your Sentry organization, to create an internal integration
Use an internal integration token. The organization owns it, so it keeps working when people leave, and you choose its permissions. A personal auth token stops working when its owner leaves the organization. An organization auth token (sntrys_) only allows CI tasks and cannot read issues or events.
Setup
- Create an Internal Integration in Sentry
- In Sentry, go to Settings → Developer Settings → Custom Integrations
- Click Create New Integration. Then select Internal Integration
- Enter a name (e.g., "Autoheal")
- Under Permissions, set the required permissions
- Click Save Changes
- Copy the token from the Tokens section
- Add Integration in Autoheal
- Go to Integrations in Autoheal
- Click Sentry
- Enter a name (e.g., "Production Sentry")
- Configure Credentials
Enter the following:
- Token: Your internal integration token
- Sentry Hostname: Your Sentry instance hostname (e.g.,
mycompany.sentry.iofor Cloud, orsentry.mycompany.netfor self-hosted)
- Test and Save
Click Test Connection to check the connection. Then click Save.
Required Permissions
Give your internal integration these permissions:
| Permission | Level | Why It's Needed |
|---|---|---|
| Organization | Read | List projects and teams |
| Project | Read | Read projects and releases |
| Issue & Event | Read | Read issues, events, and logs |
To let agents add comments to issues, set Issue & Event to Read & Write. Leave all other permissions at No Access.
Webhook Setup (Alert Source)
Sentry can automatically trigger investigations via webhooks when new issues are created or resolved. Alerts flow through the standard alert pipeline. They appear in the Alerts tab and are grouped by Alertmanager. When configured, they can trigger on-call pages and AI investigations.
- Enable Webhook in Autoheal
- Go to your Sentry integration settings in Integrations
- Click the Webhook tab
- Toggle Enable Webhook. Then copy the generated webhook URL
- Add the Webhook to Your Internal Integration
- In Sentry, go to Settings → Developer Settings → Custom Integrations
- Open the internal integration you created in Setup. If you still use a personal auth token, create an internal integration as described in Setup. Then replace your token with its token
- Under Webhooks, paste the webhook URL from Autoheal
- Under event types, check Issue
- Copy the Client Secret from the Credentials section at the bottom
- Click Save Changes
- Configure Webhook Signing Secret
Back in Autoheal, paste the Client Secret in the Webhook Signing Secret field. This is used to verify webhook signatures (HMAC-SHA256).
Example Queries
Once connected, you can ask an agent:
What are the most frequent errors in the payment service?
Show me the stack trace for the latest NullPointerException
Were there any new errors after yesterday's deployment?
What's the error rate trend for the checkout flow?
Troubleshooting
401 Unauthorized
- Check that the token is correct
- Check that the token hasn't been revoked in the internal integration's Tokens section
403 Forbidden
- Check that the internal integration has the required permissions
- If adding a comment fails, set Issue & Event to Read & Write
Organization Not Found
- Check that the organization slug is correct
- Check for typos (slugs are case-sensitive)
- Check that the internal integration was created in this organization. Its token only works there
No Issues Found
- Check that the internal integration has Issue & Event: Read permission
- Check that there are issues in the specified time range
- Check that project access permissions are correct
Webhook Not Triggering Investigations
- Check that the webhook URL is correctly configured in Sentry's Internal Integration (Settings → Developer Settings → Custom Integrations)
- Check that the Webhook Signing Secret matches the Client Secret from Sentry
- Check that the Issue checkbox is enabled in the Internal Integration's Webhooks section
- Only
issue.createdandissue.resolvedactions trigger the alert pipeline. Other actions (assigned, ignored, archived) and other resource types (error, comment, seer) are discarded automatically - Check the webhook events log in Autoheal for signature verification errors