Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore(aci): add logging for plugin notifications #88342

Merged
merged 2 commits into from
Mar 31, 2025
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions src/sentry/rules/actions/notify_event_service.py
Original file line number Diff line number Diff line change
Expand Up @@ -180,6 +180,8 @@ def after(
return

if plugin:
extra["plugin"] = service

if not plugin.is_enabled(self.project):
extra["project_id"] = self.project.id
self.logger.info("rules.fail.is_enabled", extra=extra)
Expand All @@ -192,6 +194,10 @@ def after(
self.logger.info("rule.fail.should_notify", extra=extra)
return

extra["organization_id"] = self.project.organization_id
extra["project_id"] = self.project.id
self.logger.info("rules.plugin_notification_sent", extra=extra)

metrics.incr("notifications.sent", instance=plugin.slug, skip_internal=False)
Comment on lines +199 to 201
Copy link
Contributor

@saponifi3d saponifi3d Mar 31, 2025

Choose a reason for hiding this comment

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

can we use the metric that is being sent to verify the notifications instead of adding a log? is there additional data we should have on the metric to make it more useful?

Copy link
Member Author

Choose a reason for hiding this comment

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

unfortunately not, since we need to be able to distinguish these notifications from the "Send notification to all legacy integrations" action (they use the same metric)

yield self.future(plugin.rule_notify)

Expand Down
Loading