feat(alerting): Sentry alerting integration with provider-agnostic interface#1001
Merged
zbigniewsobiecki merged 1 commit intodevfrom Mar 23, 2026
Merged
Conversation
…c interface Introduces Sentry as the first alerting provider under a new 'alerting' integration category, using provider-agnostic naming throughout so that adding a second provider (PagerDuty, Datadog, etc.) requires no prompt or interface changes. ## Provider-agnostic naming (the PM analogy) Like how Trello "card" + JIRA "issue" are abstracted to "work item" in the PM category, Sentry-specific language is hidden behind the alerting namespace at every agent-facing layer: - AgentInput fields: `alertIssueId`, `alertOrgId`, `alertIssueUrl` - Gadgets: `GetAlertingIssue`, `GetAlertingEventDetail`, `ListAlertingEvents` - CLI tools: `get-alerting-issue`, `get-alerting-event`, `list-alerting-events` - Context step: `alertingIssue` (was `sentryIssue`) - Agent YAML prompts: no Sentry-specific language Sentry internals (client, types, HMAC verification) remain Sentry-named as the abstraction boundary stops at the agent-facing interface. ## New capabilities - `alerting:read` capability with all three gadgets (GetAlertingIssue, GetAlertingEventDetail, ListAlertingEvents) — ListAlertingEvents was previously missing despite having a CLI tool and core function - Sentry webhook handler via `createWebhookHandler` factory, gaining webhook logging to `webhook_logs` and opt-in HMAC-SHA256 signature verification (`Sentry-Hook-Signature` header, raw hex format) - `verifySentrySignature` in signatureVerification.ts (timing-safe) - `verifySentryWebhookSignature` in webhookVerification.ts reads `webhook_secret` from the alerting integration credential ## Fixes - `formatSentryEvent` cognitive complexity reduced from 34 to ~8 by extracting five section helpers (appendEventMeta, appendEventTags, appendEventRequest, appendEventUser, appendEventStacktrace) - Removed dead `_client` caching variable from sentry/client.ts - Removed Sentry branding from formatted output strings ## Tests - 41 new/updated tests: verifySentrySignature (9), SentryIssueAlertTrigger (15), SentryMetricAlertTrigger (12), builtins registration (1 new + mock) Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Codecov Report❌ Patch coverage is 📢 Thoughts on this report? Let us know! |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
alertingintegration category with Sentry as first provider — trigger handlers for issue alerts (event_alert) and metric alerts (metric_alert) fire thealertingagentalertIssueId/alertOrgId/alertIssueUrl(AgentInput fields),GetAlertingIssue/GetAlertingEventDetail/ListAlertingEvents(gadgets),alertingIssue(context step) — adding a second provider (PagerDuty, Datadog) won't require prompt changescreateWebhookHandlerfactory, gaining webhook logging towebhook_logsand opt-in HMAC-SHA256 signature verification (Sentry-Hook-Signatureheader)ListAlertingEventsclass was absent despite core function and CLI tool existing — llmist agents can now call itformatSentryEventcomplexity reduced from 34→~8 (extracted 5 section helpers), dead_clientcaching variable removed fromsentry/client.ts, Sentry branding removed from formatted output stringsProvider-agnostic design
Follows the PM analogy: Trello "card" + JIRA "issue" → "work item". Applied here:
sentryIssueIdalertIssueIdsentryOrgSlugalertOrgIdGetSentryIssueGetAlertingIssuesentryIssuealertingIssueSentry internals (client URLs,
SentryEventtype,organizationSlugin the HTTP client) stay Sentry-named — the abstraction boundary is the agent-facing interface.Test plan
verifySentrySignature— 9 tests (valid sig, empty body, tampered body, garbage sig, timing-safe length check, prefix format difference from GitHub/JIRA)SentryIssueAlertTrigger— 15 tests (matches/handle, all title fallback paths, issue ID fromissue_url, missing config, disabled trigger)SentryMetricAlertTrigger— 12 tests (matches/handle, severity filter, warning/critical actions, fallback titles, web_url)registerBuiltInTriggers— Sentry triggers now mocked and verified by namebiome check .)tsc --noEmit)🤖 Generated with Claude Code