Skip to content

Commit e169022

Browse files
DominikB2014claude
authored andcommitted
fix(slack): Use set_user for email in Slack event webhook (#112530)
Replace `set_tag("user.email", ...)` with `set_user({"email": ...})` so the user email is properly stored as `sentry.user.email` in span attributes, matching the EAP search attribute definition. Previously, `user.email` was never populated for spans with `slack.event_type` because the tag key didn't match the expected internal attribute name. Also add a few other fields to user --------- Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
1 parent 90daf56 commit e169022

File tree

1 file changed

+7
-1
lines changed
  • src/sentry/integrations/slack/webhooks

1 file changed

+7
-1
lines changed

src/sentry/integrations/slack/webhooks/event.py

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -279,7 +279,13 @@ def on_link_shared(self, request: Request, slack_request: SlackDMRequest) -> boo
279279
sentry_sdk.set_tag("organization.slug", organization.slug)
280280
identity_user = slack_request.get_identity_user()
281281
if identity_user:
282-
sentry_sdk.set_tag("user.email", identity_user.email)
282+
sentry_sdk.set_user(
283+
{
284+
"id": identity_user.id,
285+
"email": identity_user.email,
286+
"username": identity_user.username,
287+
}
288+
)
283289

284290
logger_params = {
285291
"integration_id": slack_request.integration.id,

0 commit comments

Comments
 (0)