Skip to main content
PostHog’s error tracking groups exceptions into issues and can notify you when an issue is created, reopened, or starts spiking. Connect it to incident.io to page the right people when that happens. PostHog sends alerts to incident.io through an HTTP webhook. Each trigger has its own webhook, so you create one for each trigger you want, all pointing at the same incident.io alert source. Alerts take their title from the exception, describe which trigger fired, and link back to the issue in PostHog when you include the project in the webhook body.

Instructions

  1. Head over to the Alerts section in your incident.io dashboard.
  2. Select the Sources tab at the top of the page.
  3. Press the Create source button.
  4. Search for PostHog and click Continue to create the alert source.
  5. In PostHog, open Error tracking → Configuration → Alerting and click New notification.
  6. Choose the HTTP Webhook for the trigger you want: issue created, issue reopened, or issue spiking.
  7. Paste the Webhook URL from the incident.io setup page into the webhook URL field.
  8. Under Headers, add an Authorization header set to Bearer {secret_token} using the token shown in incident.io.
  9. Replace the JSON body with this template, so alerts link back to the issue in PostHog:
  10. Click Test function, then Create & enable. If it’s set up correctly, the alert appears in incident.io.
Repeat steps 5 to 10 for each trigger you want alerts for, using the same URL and token each time.

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.