Skip to content

Commit

Permalink
remove sentry tag
Browse files Browse the repository at this point in the history
  • Loading branch information
anirudhpillai committed Nov 25, 2024
1 parent c978263 commit 716f604
Showing 1 changed file with 2 additions and 7 deletions.
9 changes: 2 additions & 7 deletions posthog/tasks/alerts/checks.py
Original file line number Diff line number Diff line change
Expand Up @@ -333,20 +333,18 @@ def check_alert_and_notify_atomically(alert: AlertConfiguration) -> None:
raise
except Exception as err:
error_message = f"Alert id = {alert.id}, failed to evaluate"
evaluation_error_message = traceback.format_exc()

posthoganalytics.capture(
cast(str, user.distinct_id),
"alert check failed",
properties={
"alert_id": alert.id,
"error": error_message,
"traceback": evaluation_error_message,
"traceback": traceback.format_exc(),
},
)

logger.exception(error_message, exc_info=err)
set_tag("evaluation_error_message", evaluation_error_message)
capture_exception(AlertCheckException(err))

# error can be on user side (incorrectly configured insight/alert)
Expand All @@ -373,21 +371,18 @@ def check_alert_and_notify_atomically(alert: AlertConfiguration) -> None:
send_notifications_for_breaches(alert, breaches)
except Exception as err:
error_message = f"AlertCheckError: error sending notifications for alert_id = {alert.id}"
evaluation_error_message = traceback.format_exc()

posthoganalytics.capture(
cast(str, user.distinct_id),
"alert check failed",
properties={
"alert_id": alert.id,
"error": error_message,
"traceback": evaluation_error_message,
"traceback": traceback.format_exc(),
},
)

logger.exception(error_message, exc_info=err)

set_tag("evaluation_error_message", evaluation_error_message)
capture_exception(Exception(error_message))

# don't want alert state to be updated (so that it's retried as next_check_at won't be updated)
Expand Down

0 comments on commit 716f604

Please sign in to comment.