Skip to content

fix(alerts): Populate metric_alert webhook actions for native monitors#118388

Draft
Christinarlong wants to merge 1 commit into
masterfrom
Christinarlong/empty-metric-alert-webhook-actions
Draft

fix(alerts): Populate metric_alert webhook actions for native monitors#118388
Christinarlong wants to merge 1 commit into
masterfrom
Christinarlong/empty-metric-alert-webhook-actions

Conversation

@Christinarlong

@Christinarlong Christinarlong commented Jun 24, 2026

Copy link
Copy Markdown
Contributor

Summary

When a Metric Monitor (workflow_engine Detector) fires and notifies a Sentry App, the metric_alert webhook payload had an empty data.metric_alert.alert_rule.triggers[].actions array — so the Sentry App action and its configured settings (e.g. a channel select) never reached the app.

The payload is rebuilt from workflow_engine models by WorkflowEngineDataConditionSerializer.get_attrs, which attaches actions to a trigger only when the workflow's action-filter DataConditionGroup contains an ISSUE_PRIORITY_GREATER_OR_EQUAL condition whose comparison matches the trigger's priority (HIGH=75 / MEDIUM=50):

if trigger.condition_result in dcg_comparison_pairs.get(dcg_id, set())
  • Migrated alert rules always create that priority condition → match succeeds. ✅
  • Natively-created Metric Monitor connected alerts seed the action filter with empty conditions (automationBuilderContext.tsx). With no priority condition, nothing matched and the actions were dropped → actions: []. ❌

Fix

Track whether each action-filter DCG gates on priority at all, and treat a DCG with no priority gate as firing for any priority — so its actions are attributed to the detector's triggers. Migrated rules still take the priority-match branch and are unchanged; only priority-less (native) filters take the new path.

A priority-less filter matches all of the detector's triggers, which is semantically correct (an empty filter fires for any priority); the webhook's top-level status still identifies which trigger fired.

Fixes #118042
Refs ENG-7988

When a Metric Monitor fires and notifies a Sentry App, the metric_alert
webhook payload had an empty triggers[].actions array, so the Sentry App
action and its configured settings never reached the app.

The webhook payload is rebuilt from workflow_engine models by
WorkflowEngineDataConditionSerializer, which attached actions to a trigger
only when the workflow's action-filter DataConditionGroup contained an
ISSUE_PRIORITY_GREATER_OR_EQUAL condition matching the trigger's priority.
Alert rules migrated from the legacy system always create that condition,
but natively-created connected alerts seed their action filter with no
conditions, so nothing matched and the actions were dropped.

Treat an action filter with no priority gate as firing for any priority,
so its actions are attributed to the detector's triggers.

Fixes GH-118042
Refs ENG-7988
Co-Authored-By: Claude <noreply@anthropic.com>
@github-actions github-actions Bot added the Scope: Backend Automatically applied to PRs that change backend components label Jun 24, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Scope: Backend Automatically applied to PRs that change backend components

Projects

None yet

1 participant