Instructions
- Head over to the Alerts section in your incident.io dashboard.
- Select the Sources tab at the top of the page.
- Press the Create source button.
- Search for PostHog and click Continue to create the alert source.
- In PostHog, open Error tracking → Configuration → Alerting and click New notification.
- Choose the HTTP Webhook for the trigger you want: issue created, issue reopened, or issue spiking.
- Paste the Webhook URL from the incident.io setup page into the webhook URL field.
-
Under Headers, add an
Authorizationheader set toBearer {secret_token}using the token shown in incident.io. -
Replace the JSON body with this template, so alerts link back to the issue in PostHog:
- Click Test function, then Create & enable. If it’s set up correctly, the alert appears in incident.io.
What each PostHog event does
Created and reopened share one alert per issue, so you’re paged once per issue however many alert rules match it. Each spike gets its own alert, because PostHog has already aggregated the exceptions into it and a spike on a known issue needs its own page.
Resolve alerts automatically
Send the$error_tracking_issue_resolved event to the same webhook URL and incident.io resolves the issue’s alert when someone resolves it in PostHog. PostHog’s Alerting page has no ready-made webhook for it, so create one more HTTP Webhook from any of the three, and set its Trigger to Error tracking issue resolved.
Resolving the alert doesn’t resolve an incident on its own. For triage incidents, turn on Decline triage incidents if the linked alerts are resolved on the alert route. For live incidents, trigger a workflow on alert resolution. Spike alerts are separate alerts, so resolve those in incident.io.
Route alerts by team
PostHog issue events don’t name an owning team, so add one to the JSON body yourself, for example"team": "payments", and read it into a Team alert attribute with the expression $.team. If you use PostHog’s assignment rules, filter each webhook by assignee and create one webhook per team instead. See routing alerts to teams for what to do with the attribute once it’s set.
Once alerts are arriving, create an alert route to filter, group, and escalate them, or to automatically create incidents.