Skip to content

Commit

Permalink
fix(email) Add logging when we fail to send some messages (#56089)
Browse files Browse the repository at this point in the history
I'm trying to get to the bottom of a delivery issue and having this
would help.
  • Loading branch information
markstory committed Sep 12, 2023
1 parent 5043cdf commit 91584df
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions src/sentry/utils/email/send.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,13 @@ def send_messages(messages: Sequence[EmailMultiAlternatives], fail_silently: boo
failed = len(messages) - sent
if failed > 0:
metrics.incr("email.sent", failed, skip_internal=False, tags={"success": False})
logger.info(
"mail.sent.failure",
extra={
"message_count": len(messages),
"sent": sent,
},
)

for message in messages:
extra = {
Expand Down

0 comments on commit 91584df

Please sign in to comment.