Skip to content

fix(webhooks): Split out the metric alert action to be in a task#112177

Merged
Christinarlong merged 8 commits intomasterfrom
crl/new-task-for-metric-alert-webhook
Apr 3, 2026
Merged

fix(webhooks): Split out the metric alert action to be in a task#112177
Christinarlong merged 8 commits intomasterfrom
crl/new-task-for-metric-alert-webhook

Conversation

@Christinarlong
Copy link
Copy Markdown
Contributor

Since the metric alert webhook does not cross a task boundary and that the rpc call it does instead spawns off another thread to do the work we're getting errors when trying to use the sigalarm timeout.

This PR basically copies over the logic the metric alert trigger did but in a task. Also moves the work to be done via region/cell silo since idt we really want control tasks if we can avoid it/this task doesn't really have a reason to be in control

@github-actions github-actions bot added the Scope: Backend Automatically applied to PRs that change backend components label Apr 2, 2026
Comment thread src/sentry/sentry_apps/tasks/sentry_apps.py Outdated
@Christinarlong Christinarlong marked this pull request as ready for review April 2, 2026 22:27
@Christinarlong Christinarlong requested review from a team as code owners April 2, 2026 22:27
Comment thread src/sentry/rules/actions/notify_event_service.py
@github-actions

This comment was marked as outdated.

Comment thread src/sentry/sentry_apps/tasks/sentry_apps.py Outdated
Comment thread src/sentry/sentry_apps/tasks/sentry_apps.py
Comment thread src/sentry/rules/actions/notify_event_service.py
Comment thread src/sentry/sentry_apps/tasks/sentry_apps.py
retry=Retry(times=3, delay=60 * 5),
silo_mode=SiloMode.CELL,
)
@retry_decorator
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do we need the retry decorator if the Retry in the task decorator is already defined?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yeah we still need the decorator as the decorator will specify on what exceptions to retry, alert or neither on.

Comment thread src/sentry/rules/actions/notify_event_service.py
Copy link
Copy Markdown
Contributor

@cursor cursor bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cursor Bugbot has reviewed your changes and found 1 potential issue.

Fix All in Cursor

Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.

Comment thread tests/sentry/rules/actions/test_notify_event_service.py Outdated
Comment thread src/sentry/sentry_apps/utils/webhooks.py
@github-actions

This comment was marked as outdated.

@Christinarlong Christinarlong merged commit b4f2897 into master Apr 3, 2026
107 checks passed
@Christinarlong Christinarlong deleted the crl/new-task-for-metric-alert-webhook branch April 3, 2026 18:46
@Christinarlong Christinarlong added the Trigger: Revert Add to a merged PR to revert it (skips CI) label Apr 3, 2026
@getsentry-bot
Copy link
Copy Markdown
Contributor

PR reverted: 8a0a9a0

getsentry-bot added a commit that referenced this pull request Apr 3, 2026
…ask (#112177)"

This reverts commit b4f2897.

Co-authored-by: Christinarlong <60594860+Christinarlong@users.noreply.github.com>
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 Trigger: Revert Add to a merged PR to revert it (skips CI)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants