> AI agents: this is one page from PostHog's docs. Full index of Markdown docs for LLMs: https://posthog.com/llms.txt # Triage and alerts – Error Tracking pocket guide Canonical URL: https://posthog.com/learn/error-tracking/pocket-guide/triage-and-alerts > **Cloud region:** This page uses US Cloud hosts. For an EU Cloud project, use `https://eu.posthog.com` instead of `https://app.posthog.com` (app host for links). ## On this page - [Route issues to their owners with assignment rules](#route-issues-to-their-owners-with-assignment-rules) - [Track fixes in GitHub](#track-fixes-in-github) - [Get alerted when an issue spikes](#get-alerted-when-an-issue-spikes) - [Self-driving](#self-driving) Chapter 06 # Triage and alerts – Error Tracking pocket guide Every week at stand-up, Twig's engineers go through the new issues together. At first it takes 5 minutes. As Twig grows, it takes 10, then 20, and eventually the whole meeting. Most of that time goes to the same questions every week: who owns this issue, and does it need attention now? So the engineers look for ways to send each issue to the people who own it, and to only interrupt someone when an issue needs them. ## Route issues to their owners with assignment rules Most issues belong to one team. The Trips team owns everything under `src/trips/`, including **Trip details**. Instead of assigning those issues by hand at stand-up, the engineers add an assignment rule that sends issues from `src/trips/` to the Trips team Fig. 1. New assignment rule Matching exceptions will be automatically assigned to the chosen user or role. FiltersMatchAllAny1 Exception source2 ∋ contains src/trips/ Add filter Assignee3 Trips 184 exceptions across 7 issues would have been assigned in the last 7 days Test ruleCancelSave Fig. 1 – This rule assigns issues from source files under src/trips/ to the Trips role. Before you save it, you can test how many exceptions it would have matched in the last 7 days. Rules run at ingestion, after [source maps](https://posthog.com/docs/error-tracking/upload-source-maps.md) are applied, so they match Twig's unminified [stack trace](https://posthog.com/docs/error-tracking/stack-traces.md). The first rule that matches assigns the issue, so specific rules go first. ## Track fixes in GitHub Twig's engineering teams plan their sprints in GitHub issues. They configure Error Tracking to create mirrored issues in GitHub issues directly, so they can groom it as a part of their sprint planning Fig. 2. twig/webIssues Trip details fail when the host record doesn't load #381 P1Trips Openopened just now PH posthog-app opened this issue just now ### Summary Trip details fail to open for a booked stay. The guest sees an error instead of their host and trip information. ### Impact 1 Sessions 47 Guests 31 Stays 3 ### Evidence 2 TypeError: Cannot read properties of undefined (reading 'name') Top frame: `src/trips/trip-details.ts:12:20` First seen four minutes after `web@1.4.2`. Affected recordings show repeated clicks on **Try again**. ### Suggested fix Pass Twig's loaded host records to `readTripHost`, and show a fallback when the host name is missing. PostHog issue: app.posthog.com/error\_tracking/...3 Fig. 2 – A GitHub issue created from PostHog. PostHog fills in the link back to the issue, and you can edit the body to add the impact and a suggested fix before you create it. If your team works out of GitLab, Linear, or Jira, you can do the same. ## Get alerted when an issue spikes Some issues can't wait for the next stand-up. When **Trip details** breaks for hundreds of guests, the Trips team wants to know right away, without a message for every new issue. PostHog alerts on three triggers: - **Issue created** fires for every new issue, which can mean many messages a day. - **Issue reopened** fires when a resolved issue comes back, which catches regressions. - **Issue spiking** fires when an issue gets far more exceptions than usual. PostHog compares each 5-minute window with the issue's baseline from the past hour Fig. 3. Trip details fail to load Occurrences over the last hour Spiking Per 5 minutesBaseline: about 60 7201 1 hour agoNow Alert720 occurrences in 5 minutes, against a baseline of about 602 Fig. 3 – Twig's Trip details issue gets 720 occurrences in the latest 5-minute window, about 12 times its baseline from the past hour. The engineers only alert on spiking issues. New issues already go to the team that owns them, which grooms them, so an alert for each one only adds noise. Spike alerts go to the Trips team's Slack channel. When the spike alert fires, someone on the Trips team opens the issue and watches a recording of a guest who hit it. If it's a real bug, they fix it and link the GitHub issue. If it's noise, they suppress it. Stand-up takes 5 minutes again. To set up the same for your app, create a role for each team in your organization settings, then add assignment rules and alerts in [Error Tracking settings](https://app.posthog.com/error_tracking/configuration#selectedSetting=error-tracking-alerting). Alerts can go to [Slack](https://posthog.com/docs/data-pipelines/destinations/slack.md) or a [webhook](https://posthog.com/docs/data-pipelines/destinations/webhook.md). PostHog AI can suggest rules and alerts from your recent exceptions: Prompt for PostHog AI ```text Group my $exception events from the last 30 days by the source files in $exception_sources and the path of $current_url, and leave out third-party code. Name each group by the part of my product it covers, like trips or bookings. Suggest one error tracking assignment rule per group, with the property, operator, and value it filters on. List the rules most specific first, because the first rule that matches assigns the issue. Then suggest which error tracking alerts each team needs, for reopened issues and spikes, and where to send them. ``` [Set up triage with PostHog AI](https://app.posthog.com/#panel=max:Group%20my%20%24exception%20events%20from%20the%20last%2030%20days%20by%20the%20source%20files%20in%20%24exception_sources%20and%20the%20path%20of%20%24current_url%2C%20and%20leave%20out%20third-party%20code.%20Name%20each%20group%20by%20the%20part%20of%20my%20product%20it%20covers%2C%20like%20trips%20or%20bookings.%20Suggest%20one%20error%20tracking%20assignment%20rule%20per%20group%2C%20with%20the%20property%2C%20operator%2C%20and%20value%20it%20filters%20on.%20List%20the%20rules%20most%20specific%20first%2C%20because%20the%20first%20rule%20that%20matches%20assigns%20the%20issue.%20Then%20suggest%20which%20error%20tracking%20alerts%20each%20team%20needs%2C%20for%20reopened%20issues%20and%20spikes%2C%20and%20where%20to%20send%20them.)It suggests assignment rules and alerts from your recent exceptions. You add them in Error Tracking settings. ## Self-driving As Twig grows with more users, checking alerts and dashboards and getting issues auto-assigned still leaves many exceptions unresolved. So Twig's engineers turn to self-driving to help resolve these issues. [Self-driving →](https://posthog.com/learn/error-tracking/pocket-guide/self-driving.md) **Explore further** [Assign issues to teammates](https://posthog.com/docs/error-tracking/assigning-issues.md) · [Set up integrations](https://posthog.com/docs/error-tracking/integrations.md) · [Send error tracking alerts](https://posthog.com/docs/error-tracking/alerts.md) · [Detect spikes](https://posthog.com/docs/error-tracking/spikes.md)