From 3cb2273ffefc0e33b3987754c77c37f66c7b70e7 Mon Sep 17 00:00:00 2001 From: Anirudh Pillai Date: Mon, 25 Nov 2024 13:51:02 +0000 Subject: [PATCH] distinct id --- posthog/tasks/alerts/checks.py | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/posthog/tasks/alerts/checks.py b/posthog/tasks/alerts/checks.py index 7b97bdb4d293f..9e3e3d92f4e4a 100644 --- a/posthog/tasks/alerts/checks.py +++ b/posthog/tasks/alerts/checks.py @@ -73,6 +73,8 @@ def __init__(self, err: Exception): "Number of alerts we calculated", ) +ANIRUDH_DISTINCT_ID = "wcPbDRs08GtNzrNIXfzHvYAkwUaekW7UrAo4y3coznT" + @shared_task(ignore_result=True) def checks_cleanup_task() -> None: @@ -102,7 +104,7 @@ def alerts_backlog_task() -> None: HOURLY_ALERTS_BACKLOG_GAUGE.set(hourly_alerts_breaching_sla) posthoganalytics.capture( - "anirudh@posthog.com", + ANIRUDH_DISTINCT_ID, "alert check backlog", properties={ "alert_check_frequency": AlertCalculationInterval.HOURLY, @@ -123,7 +125,7 @@ def alerts_backlog_task() -> None: DAILY_ALERTS_BACKLOG_GAUGE.set(daily_alerts_breaching_sla) posthoganalytics.capture( - "anirudh@posthog.com", + ANIRUDH_DISTINCT_ID, "alert check backlog", properties={ "alert_check_frequency": AlertCalculationInterval.DAILY, @@ -264,7 +266,7 @@ def check_alert(alert_id: str) -> None: ALERT_CHECK_ERROR_COUNTER.inc() posthoganalytics.capture( - alert.created_by.email, + alert.created_by.distinct_id, "alert check failed", properties={ "alert_id": alert.id, @@ -308,7 +310,7 @@ def check_alert_and_notify_atomically(alert: AlertConfiguration) -> None: # Event to count alert checks posthoganalytics.capture( - alert.created_by.email, + alert.created_by.distinct_id, "alert check", properties={ "alert_id": alert.id, @@ -331,7 +333,7 @@ def check_alert_and_notify_atomically(alert: AlertConfiguration) -> None: evaluation_error_message = traceback.format_exc() posthoganalytics.capture( - alert.created_by.email, + alert.created_by.distinct_id, "alert check failed", properties={ "alert_id": alert.id, @@ -371,7 +373,7 @@ def check_alert_and_notify_atomically(alert: AlertConfiguration) -> None: evaluation_error_message = traceback.format_exc() posthoganalytics.capture( - alert.created_by.email, + alert.created_by.distinct_id, "alert check failed", properties={ "alert_id": alert.id,