diff --git a/src/sentry/integrations/discord/actions/issue_alert/notification.py b/src/sentry/integrations/discord/actions/issue_alert/notification.py index 92974e31e34f03..39699eec6b013f 100644 --- a/src/sentry/integrations/discord/actions/issue_alert/notification.py +++ b/src/sentry/integrations/discord/actions/issue_alert/notification.py @@ -81,7 +81,14 @@ def send_notification(event: GroupEvent, futures: Sequence[RuleFuture]) -> None: key = f"discord:{integration.id}:{channel_id}" - metrics.incr("notifications.sent", instance="discord.notifications", skip_internal=False) + metrics.incr( + "notifications.sent", + instance="discord.notifications", + tags={ + "issue_type": event.group.issue_type.slug, + }, + skip_internal=False, + ) yield self.future(send_notification, key=key) def render_label(self) -> str: diff --git a/src/sentry/integrations/msteams/actions/notification.py b/src/sentry/integrations/msteams/actions/notification.py index 330d5d5f667f65..30803b96051ce8 100644 --- a/src/sentry/integrations/msteams/actions/notification.py +++ b/src/sentry/integrations/msteams/actions/notification.py @@ -69,7 +69,14 @@ def send_notification(event, futures): key = f"msteams:{integration.id}:{channel}" - metrics.incr("notifications.sent", instance="msteams.notification", skip_internal=False) + metrics.incr( + "notifications.sent", + instance="msteams.notification", + tags={ + "issue_type": event.group.issue_type.slug, + }, + skip_internal=False, + ) yield self.future(send_notification, key=key) def render_label(self): diff --git a/src/sentry/integrations/slack/actions/notification.py b/src/sentry/integrations/slack/actions/notification.py index 4cd81a4f9ea268..8970807ef83622 100644 --- a/src/sentry/integrations/slack/actions/notification.py +++ b/src/sentry/integrations/slack/actions/notification.py @@ -464,7 +464,14 @@ def send_notification_noa(event: GroupEvent, futures: Sequence[RuleFuture]) -> N key = f"slack:{integration.id}:{channel}" - metrics.incr("notifications.sent", instance="slack.notification", skip_internal=False) + metrics.incr( + "notifications.sent", + instance="slack.notification", + tags={ + "issue_type": event.group.issue_type.slug, + }, + skip_internal=False, + ) if features.has("organizations:workflow-engine-trigger-actions", self.project.organization): yield self.future(send_notification_noa, key=key) else: diff --git a/src/sentry/mail/actions.py b/src/sentry/mail/actions.py index 130729c6bd4e7e..1f5a3fbce4a51f 100644 --- a/src/sentry/mail/actions.py +++ b/src/sentry/mail/actions.py @@ -40,7 +40,6 @@ def after(self, event, notification_uuid: str | None = None): "group_id": group.id, "notification_uuid": notification_uuid, } - group = event.group target_type = ActionTargetType(self.data["targetType"]) target_identifier = self.data.get("targetIdentifier", None) @@ -59,7 +58,14 @@ def after(self, event, notification_uuid: str | None = None): self.logger.info("rule.fail.should_notify", extra=extra) return - metrics.incr("notifications.sent", instance=self.metrics_slug, skip_internal=False) + metrics.incr( + "notifications.sent", + instance=self.metrics_slug, + tags={ + "issue_type": group.issue_type.slug, + }, + skip_internal=False, + ) yield self.future( lambda event, futures: mail_adapter.rule_notify( event, diff --git a/src/sentry/rules/actions/notify_event.py b/src/sentry/rules/actions/notify_event.py index 535543d4ab9c5c..2be02aa5ceb9bd 100644 --- a/src/sentry/rules/actions/notify_event.py +++ b/src/sentry/rules/actions/notify_event.py @@ -38,5 +38,12 @@ def after( if not safe_execute(plugin.should_notify, group=group, event=event): continue - metrics.incr("notifications.sent", instance=plugin.slug, skip_internal=False) + metrics.incr( + "notifications.sent", + instance=plugin.slug, + tags={ + "issue_type": event.group.issue_type.slug, + }, + skip_internal=False, + ) yield self.future(plugin.rule_notify) diff --git a/src/sentry/rules/actions/notify_event_service.py b/src/sentry/rules/actions/notify_event_service.py index 5c0964bd0aaa41..0fbc67ade94eaa 100644 --- a/src/sentry/rules/actions/notify_event_service.py +++ b/src/sentry/rules/actions/notify_event_service.py @@ -166,7 +166,14 @@ def after( app = app_service.get_sentry_app_by_slug(slug=service) if app: - metrics.incr("notifications.sent", instance=app.slug, skip_internal=False) + metrics.incr( + "notifications.sent", + instance=app.slug, + tags={ + "issue_type": event.group.issue_type.slug, + }, + skip_internal=False, + ) yield self.future(notify_sentry_app, sentry_app=app) try: @@ -198,7 +205,14 @@ def after( 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) + metrics.incr( + "notifications.sent", + instance=plugin.slug, + tags={ + "issue_type": event.group.issue_type.slug, + }, + skip_internal=False, + ) yield self.future(plugin.rule_notify) def get_sentry_app_services(self) -> Sequence[RpcSentryAppService]: