feat(webhooks): Add metrics for legacy webhook migration validation#116039
Merged
Conversation
…ng migration Instruments both the legacy plugin and the new webhook task with `metrics.incr` counters so we can validate dry-run parity: - `legacy_webhook.plugin.send` (old path, per-URL sent/error) - `legacy_webhook.task.result` (new path, per-URL sent/dry_run/group_not_found)
…tinarlong/webhooks-metrics-fix
…sends Introduce LegacyWebhookOutcome enum per review feedback. Add try/except around client.request() in the task so failed sends emit an error metric before re-raising—previously silenced_exceptions swallowed the exception with no metric recorded. Expand the plugin's except clause to also catch ApiError and RestrictedIPAddress for metric parity.
Catching these exceptions without re-raising broke the parent NotificationPlugin.notify() error propagation chain, causing the "Test Plugin" button to falsely report success and suppressing notification-plugin.notify-failed logging.
Contributor
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes and found 1 potential issue.
❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.
Reviewed by Cursor Bugbot for commit 006e6d2. Configure here.
GabeVillalobos
approved these changes
May 21, 2026
| except (RestrictedIPAddress, ApiError): | ||
| metrics.incr( | ||
| "legacy_webhook.plugin.send", | ||
| tags={"outcome": LegacyWebhookOutcome.ERROR}, |
Member
There was a problem hiding this comment.
Do we want to include a tag with the exception type?
Contributor
Author
There was a problem hiding this comment.
its fine, the exception type itself doesn't really matter I just want to track that the total no. of webhooks is the same
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.

the one where i dont ping the whole company