Connect Sentry to Amonit
Amonit team · Updated
Short answer: create a Sentry internal integration with your Amonit URL as its webhook URL, and paste its Client Secret into Amonit. Then add the integration as an action in your Sentry alerts. An issue alert opens an alert in Amonit, and resolving the issue in Sentry resolves it. Metric alerts work the same way.
Set it up
- In Amonit, go to Integrations → Sentry → Connect, pick the team that should be paged, and save. The integration’s page shows its URL.
- In Sentry, go to Organization Settings → Integrations → Custom Integrations and create an internal integration. Use the Amonit URL as its Webhook URL.
- Turn on Alert Action. Under webhooks, subscribe to issue, so that resolving an issue resolves its alert. This needs read access to issues and events. Save.
- Copy the integration’s Client Secret into Sentry Client Secret on the integration’s page in Amonit, and save. Until you do, Amonit refuses Sentry’s requests.
- In each alert that should page, add the action Send a notification via your integration.
What happens
| Sentry sends | Amonit |
|---|---|
| Issue alert triggered | Opens one alert per issue, titled with the event’s title. The priority comes from the event’s level: fatal P1, error P2, warning P3, info and debug P5. If the same issue alerts again, it counts as a repeat and doesn’t page again. |
| Issue resolved | Resolves that issue’s alert. |
| Issue created, assigned, archived or unresolved | Nothing. Only alert rules page. |
| Metric alert, critical or warning | Opens a P1 or P3 alert for the incident. |
| Metric alert resolved | Resolves the alert. |
| Anything else (installation, comments, …) | Nothing. |
The alert links to the event or the metric alert in Sentry. It goes to the integration’s team, and that team’s escalation policy decides who gets the push and the phone call.
Sentry’s side is described in its docs: integration platform, webhooks, issue alerts and metric alerts.
Security
- Every request must carry Sentry’s signature, the
Sentry-Hook-Signatureheader: an HMAC-SHA256 of the body made with the Client Secret. Without the right signature, Amonit answers403and creates nothing. - The Client Secret is stored encrypted and never shown again. To change it, paste the new one.
- The URL contains the integration’s token, and the token is still required. If it leaks, regenerate it on the integration’s page and update the webhook URL in Sentry.
Limits
This setup follows Sentry’s documentation. We haven’t yet run it against a live Sentry account. If something doesn’t behave as described here, email [email protected].