diff --git a/src/sentry_plugins/slack/plugin.py b/src/sentry_plugins/slack/plugin.py index f329d6e6e976a9..8c08c79e8fcd78 100644 --- a/src/sentry_plugins/slack/plugin.py +++ b/src/sentry_plugins/slack/plugin.py @@ -24,6 +24,8 @@ status.HTTP_429_TOO_MANY_REQUESTS, ] +SLACK_PLUGIN_TITLE_LENGTH_LIMIT = 256 + class SlackPlugin(CorePluginMixin, notify.NotificationPlugin): title = "Slack" @@ -166,7 +168,7 @@ def notify(self, notification: Notification, raise_exception: bool = False) -> N if not self.is_configured(project): return - title = event.title.encode("utf-8") + title = event.title[:SLACK_PLUGIN_TITLE_LENGTH_LIMIT].encode("utf-8") # TODO(dcramer): we'd like this to be the event culprit, but Sentry # does not currently retain it if group.culprit: