Authoring Error Tracking Alerts

作者 PostHog469d1773e9cb无许可证收录于 2026年10月8日更新于 2026年10月8日

Author error tracking alerts that fire when an issue is created, reopened, or starts spiking. Use when the user asks to set up error notifications, route exceptions to Slack/webhook/Linear, or evaluate which error events are worth alerting on. Covers trigger-event selection, integration choice, dedup against existing alerts, and shipping with the canonical message body shape.

仅含说明DevOps & Cloud
AI 生成的概览

编写 PostHog 错误跟踪告警,在问题创建、重新打开或激增时触发,并路由到 Slack、Webhook 或 Linear。

功能
引导智能体创建 PostHog 错误跟踪告警:从三种生命周期触发事件中选择一种、与现有告警去重、选择集成与目标渠道,并使用规范的消息正文创建告警。还涵盖按问题范围的属性过滤、命名约定以及验证与汇报格式。产出的是已配置的告警,而非分析结果或文件。
适用场景
适用于用户要求设置错误或异常通知、在启用错误跟踪后需要一套初始告警,或粘贴问题链接并要求再次发生时通知的场景。不适用于调整激增检测器、调查正在发生的故障,或配置基于数量阈值的日志告警。
运行要求
需要访问 PostHog 的错误跟踪告警、集成和渠道相关 MCP 工具,以及已连接的目标集成,例如 Slack、Webhook URL 或 Linear/GitHub/GitLab。仅为说明文档,不附带脚本。

Authoring error tracking alerts

Authoring an error tracking alert is a routing problem, not a measurement problem. The trigger events already exist and fire on real conditions in the ingestion pipeline — your job is to pick the right trigger for the user's intent, dedupe against what's already configured, and wire a destination they can actually act on.

When to use this skill

  • The user asks to set up alerts / notifications for errors or exceptions in their project.
  • The user wants a starter set of alerts after enabling error tracking.
  • The user pastes an issue link and asks "notify me when this happens again" — usually _reopened with a per-issue property filter.

When not to use this skill

  • Tuning the spike detector itself (multiplier, window, threshold). That lives behind the spike detection config endpoint and is not exposed via MCP today.
  • Investigating an active incident — query the issue / its events directly via posthog:query-error-tracking-issue and posthog:query-error-tracking-issue-events instead of authoring more alerts mid-fire.
  • Configuring volume-threshold alerts (count of $exception events over a window). That's a logs-style alert and is not in scope here — error tracking alerts ride the lifecycle events instead.

Tools

ToolJobWhere it fits
posthog:error-tracking-alerts-listList existing alerts; dedupe before creating.Step 2 — dedupe.
posthog:integrations-listFind the user's Slack workspace id (filter by kind=slack).Step 3 — pick channel.
posthog:integrations-channels-retrieveList Slack channels for a workspace.Step 3 — pick channel.
posthog:error-tracking-alerts-createCreate the alert (HogFunction with type=internal_destination).Step 4 — ship.
posthog:error-tracking-alerts-partial-updateToggle, rename, or modify an existing alert.When tuning, not authoring.
posthog:error-tracking-alerts-deleteSoft-delete an alert.When the user says "remove".

Trigger events — pick exactly one per alert

There are three lifecycle events. Each has a different "noise vs urgency" trade-off — picking the wrong one is the most common cause of alert fatigue here.

EventFires whenUse when
$error_tracking_issue_createdA brand-new issue first appears.Small projects, or projects where every new error type is genuinely worth a look. Floods large/noisy projects.
$error_tracking_issue_reopenedA previously resolved issue starts emitting again.Catch regressions on issues someone already triaged. The safest "I want to know if this comes back" trigger.
$error_tracking_issue_spikingThe spike detector flags abnormal volume on an issue.Production projects with high baseline volume. Threshold/multiplier is shared across the project — check spike config before using.

If the user is vague ("alert me on errors"), default to _spiking. It's the most signal-dense trigger and the least likely to cause alert fatigue. Confirm explicitly before proceeding.

Workflow

1. Confirm intent

You need three things from the user before creating anything:

  • Which trigger event. If unspecified, recommend _spiking and ask for confirmation. Do not silently pick one.
  • Which channel. Slack channel name, webhook URL, Linear team, etc. Never hardcode a production channel. If the user says "the dev channel", ask for the exact channel id or name.
  • Which scope. All issues (most common), or scoped to a specific issue / exception type / assignee.

2. Dedupe against existing alerts

Call posthog:error-tracking-alerts-list. Filter the response client-side by filters.events[].id.

  • If an alert exists for the same event delivering to the same channel, stop. Tell the user it already exists and ask whether they want to change anything (in which case use error-tracking-alerts-partial-update) or skip.
  • Multiple alerts on the same event for the same channel produce duplicate Slack messages — the user almost never wants this.
  • Multiple alerts on the same event for different channels (e.g. one for #oncall, one for the oncall webhook) is fine and sometimes intentional. Confirm.

PostHog's "alerts configured" recommendation only inspects filters.events — adding per-issue filters.properties does not affect the status the recommendations card reports.

3. Pick the integration

For Slack:

  1. posthog:integrations-list with kind=slack → pick the integration id (an integer).
  2. posthog:integrations-channels-retrieve with that id → pick the channel id (e.g. C0123ABC). Channel names like "#oncall" are accepted but channel ids are preferred — they survive renames.

For webhook: the user supplies a single https:// URL. Refuse http:// URLs.

For Linear / GitHub / GitLab: confirm the integration is connected via posthog:integrations-list first, then ask the user which project / repository / team to file issues into.

4. Create the alert

Call posthog:error-tracking-alerts-create with:

json
{  "type": "internal_destination",  "template_id": "template-slack",  "name": "<short, channel-attributed name>",  "enabled": true,  "filters": {    "events": [{ "id": "$error_tracking_issue_created", "type": "events" }]  },  "inputs": {    "slack_workspace": { "value": <slack_integration_id_int> },    "channel": { "value": "<channel_id>" },    "text": { "value": "..." },    "blocks": { "value": [...] }  }}

The canonical Slack blocks payload for each event lives in references/block-templates.md. Copy the matching block verbatim — it matches the in-product alert wizard, so agent-created alerts look identical to UI-created ones.

For per-issue scoping — created / reopened only, spiking events carry no exception properties — add to filters:

json
"properties": [  { "key": "$exception_issue_id", "value": "<issue_uuid>", "operator": "exact", "type": "event" }]

Other useful property filters: $exception_types (exception class names, an array), name (issue title). See references/event-triggers.md for the full property surface per event.

5. Verify

Echo the alert back to the user with: name, trigger event (human-readable), destination, and a one-line preview of the message body. Do not echo Slack workspace ids or webhook URLs — those are sensitive. Tell the user how to disable: "you can pause this alert by setting enabled: false via error-tracking-alerts-partial-update or by toggling it in the destinations UI."

Naming convention

Use <trigger> · <channel> (auto) so the user can scan their alert list and spot agent-created entries. Examples:

  • Issue spiking · #oncall (auto)
  • Issue reopened · #regressions-webhook (auto)
  • Issue created · Linear/Eng (auto)

Do not use the issue title in the name — alerts can match many issues, and the title becomes stale once the issue evolves.

Token-economy rules

  • One posthog:error-tracking-alerts-list call up front, not per candidate.
  • Reuse a single integration lookup for multiple alerts going to the same workspace.
  • Confirm the channel / URL with the user before creating each alert. Never batch-create alerts to a destination the user has not explicitly named.
  • Cap iteration at 1 round per alert. If the user wants three alerts, that's three create calls — not three create calls per alert.

Output

Report what you did, in this shape:

  • For each shipped alert: name, trigger event, destination (channel name or webhook host — never the full URL), enabled state.
  • For each skipped alert: trigger + channel + why (already exists, user declined, missing integration).
  • Anything the user should do next: enable the spike detection config (if they picked _spiking and the detector hasn't been turned on), wire up source maps (so the alert's stack trace links resolve), or tune the alert filters after watching it for a day.

Related skills

  • triaging-error-issues — work out which issues actually matter before wiring alerts for them
  • investigating-error-issue — deep-dive an issue an alert fired for
  • authoring-log-alerts — the same alerting job, but for log lines instead of exceptions

来源与署名

来源:PostHog/ai-plugin位于skills/authoring-error-tracking-alerts提交469d177

许可证: 无许可证

内容归原作者所有。SourceWeft 从公开仓库中收录这些内容。

举报或申请下架

更多来自 PostHog/ai-plugin 的技能

Writing Simplified Technical English

PostHog

应用 ASD-STE100 简化技术英语规则,让智能体撰写的文字含义明确、便于执行。

Writing & Content2026年10月8日

Working With Task Comments

PostHog

通过 PostHog MCP exec 调度器读取并解读 PostHog 任务、产物和画布上的评论。

Productivity & Workflow2026年10月8日

Working With Skills

PostHog

指导智能体使用 PostHog 的 skill-* MCP 工具来发现、读取、创建、更新和重构技能。

AI & Agents2026年10月8日

Working With Scouts

PostHog

关于如何把监控任务委派给 PostHog Signals 侦察代理、处理其报告并长期调校整个代理集群的操作手册。

AI & Agents2026年10月8日

Validating And Publishing Canvases

PostHog

Validate and publish a canvas source project safely: the source-project shape, declared capabilities, reading the current version pointer, iterating on validation diagnostics, guarded publishing with expected_current_version_id, staging a draft build and promoting it, waiting out the queued build, and recovering from a 409 version_conflict or a 429 capacity limit without overwriting concurrent work. Use whenever a canvas edit is ready to save, a draft build is wanted, a canvas publish or build returns diagnostics or a conflict, or a task needs to understand canvas version history.

待分类2026年10月8日

Understanding Billing Usage

PostHog

Explains PostHog billing usage and spend from the customer's visible Billing MCP tools. Use when the user asks why usage or spend is high, which product or project is driving usage, what a usage type means, how to reduce usage, what changed over time, why they got a usage change alert, or whether a spike/drop alert was real or noisy. Also use before product-specific analytics skills when the user names a billable PostHog product metric such as events, recordings, feature flag requests, exceptions, survey responses, synced rows, logs, AI events, AI credits, or Inbox credits. Starts from Billing usage/spend tools, then routes to customer-visible product MCP surfaces for deeper investigation.

待分类2026年10月8日