Skip to content

feat(cli): inspect metric alert thresholds and notifications - #1663

Merged
betegon merged 2 commits into
mainfrom
bt/cli-alert-inspection
Oct 26, 2026
Merged

betegon merged 2 commits into
mainfrom
bt/cli-alert-inspection

Conversation

@betegon

@betegon betegon commented Oct 25, 2026 •

Copy link
Copy Markdown
Member

alert metrics view drops thresholds and linked notification workflows, so it cannot answer when an alert fires or whom it notifies. Preserve the detector settings and inspect linked workflows, including their filters, destinations, and enabled states. JSON keeps the existing fields and adds native configuration and workflow documents, with --fields support.

Before

sentry alert metrics view test-org/9 shows an active alert, but omits its thresholds and notification configuration:

Name:         P95 latency
Status:       active
Dataset:      spans
Aggregate:    p95(span.duration)
Query:        environment:prod
Time Window:  5m

After

The same sanitized alert now exposes its thresholds and recovery condition, plus the disabled workflow containing its Slack action. Output excerpts:

│ Condition 1 │ >= 500 → high (75)                             │
│ Condition 2 │ <= 300 → OK / recovery (0)                     │

Workflow 12: Notify on-call
━━━━━━━━━━━━━━━━━━━━━━━━━━━

╭─────────────┬──────────────────╮
│ Status      │ disabled         │
│ Environment │ prod             │
│ Config      │ {"frequency":30} │
╰─────────────┴──────────────────╯

Action 1

│ Provider       │ slack                                                       │
│ Target         │ #backend_alerts                                             │
│ Status         │ active                                                      │

Works by ID or name. Missing or inaccessible workflows appear in workflowErrors (403/404); authentication, network, and server failures still propagate. This inspects current configuration, not notification delivery history.

Validated with 60 alert command/API/formatter tests, CLI typecheck, and lint/format for the changed files.

@vercel

vercel Bot commented Oct 25, 2026 •

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

1 Skipped Deployment
Project Deployment Actions Updated
sentry-local Skipped Skipped Oct 26, 2026 2:39pm UTC

Request Review

@betegon
betegon force-pushed the bt/cli-alert-inspection branch from 10ceead to 076f752 Compare October 26, 2026 13:18
@betegon
betegon marked this pull request as ready for review October 26, 2026 13:18
@github-actions github-actions Bot added the risk: medium PR risk score: medium label Oct 26, 2026
@betegon
betegon force-pushed the bt/cli-alert-inspection branch from 2b28e7f to 16c747f Compare October 26, 2026 14:39
@betegon
betegon merged commit d659bc5 into main Oct 26, 2026
26 checks passed
@betegon
betegon deleted the bt/cli-alert-inspection branch October 26, 2026 15:01

This branch was previously deployed

1 inactive deployment
Preview — 16c747fe Deployed Oct 26, 2026 by vercel[bot]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

risk: medium PR risk score: medium

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant