Repository navigation
feat(alerts): open and resolve pagerduty incidents for insight alerts - #127898
Conversation
Insight alerts the platform owns now send incident actions, so a PagerDuty destination on the new insight incident events triggers when the alert starts firing and resolves when it stops. Message destinations still hear no resolve. A PagerDuty function on the firing event keeps its HogFunction path. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
😎 Merged successfully - details. |
🤖 CI report
|
There was a problem hiding this comment.
PostHog Review · Standard · reviewed 1c7e6da: 1 Should fix.
This is the only automatic review while this pull request is a draft. Comment @posthog review to review new changes sooner. Otherwise, a review of the new changes runs when you mark it ready for review.
See this review and its findings in PostHog Review. Comment @posthog review --deep for a Deep review. A Deep review takes longer and looks deeper than a Standard review.
|
Risk: No findings This delta widens the insight alert API's destination-delete allowlist to include the two new incident events, so a PagerDuty trigger/resolve pair can be removed through the insight API (the generic HogFunction API refuses edits to managed alert events). The deletion stays gated by team scoping, alert:write permission, an alert_id pin in the function's filters, a known-template filter, and pair-wise group deletion, so I found no new security risk. Sentinel reviewed |
The generic HogFunction API treats the insight incident events as managed and refuses to edit them, so the insight destinations delete endpoint now matches functions on those events too. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
There was a problem hiding this comment.
Approved.
The risky delivery and API changes have owning-team and strong-familiarity assurance, plus a current-head review reported without findings. The destination deletion fix is present, and no unresolved substantive concerns or other refusal grounds were found.
- Author wrote 98% of the modified lines and has 28 merged PRs in these paths (familiarity STRONG).
- PostHog Review (Standard) reviewed the current head: no findings.
Gate mechanics and policy version
| Gate | Result | |
|---|---|---|
| prerequisites | ✓ | all clear |
| deny-list | ✓ | no deny categories matched |
| size | ✓ | 138L, 7F substantive, 347L/13F incl. docs/generated/snapshots — within ceiling |
| tier | ✓ | T1-agent / T1d-complex (347L, 13F, two-areas, feat) |
| stamphog 2.7.0 | .stamphog/policy.yml @ e3a63b9 · reviewed head e3a63b9 |
|
/trunk merge |
Problem
Changes
$insight_alert_incident_openedand$insight_alert_incident_closed.$insight_alert_firingkeeps its HogFunction path. It still triggers and never resolves.How did you test this code?
Test rationale:
test_only_an_allowlisted_or_platform_owned_firing_failure_or_incident_edge_asks_for_a_deliverygains paged cases. It catches_deliverydropping a resolve because nothing was announced. Removing that path failspaged_resolve.test_an_incident_edge_emits_its_incident_event_beside_any_messagecatches the HogFunction-path emitter dropping incident events.test_an_insight_pagerduty_function_is_native_only_on_the_incident_events(database-backed) catches event ids not read from the function's filters. That would send firing-event functions natively, where every PagerDuty send fails.test_an_incident_destination_is_removed_through_the_insight_apicatches the delete endpoint ignoring incident-event functions, which nothing else can remove. It fails without the fix.Release status
Docs update
docs/internal/alerts-platform-temporal.md, under "Incident edges ignore cooldown and mute".🤖 Agent context
Autonomy: Human-driven (agent-assisted)
Agent: Claude Code, Claude Opus 5.5 (
claude-opus-5-5)Skills:
/writing-tests,/querying-production-databases-via-metabase,/reviewing-with-coderabbit,/simplify,/code-review,/writing-pr-descriptionsMore context for AI agents
--deepreported 0 findings./simplifyand/code-review high --fixfixes are applied. PostHog Review's one finding (delete endpoint) is fixed._incident_actionsinplatform_source_cycle.py, and the narrowed rule inlogic/delivery_path.py.🤖 Generated with Claude Code