Skip to content

Commit

Permalink
distinct id
Browse files Browse the repository at this point in the history
  • Loading branch information
anirudhpillai committed Nov 25, 2024
1 parent 13e139c commit 3cb2273
Showing 1 changed file with 8 additions and 6 deletions.
14 changes: 8 additions & 6 deletions posthog/tasks/alerts/checks.py
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down Expand Up @@ -102,7 +104,7 @@ def alerts_backlog_task() -> None:
HOURLY_ALERTS_BACKLOG_GAUGE.set(hourly_alerts_breaching_sla)

posthoganalytics.capture(
"[email protected]",
ANIRUDH_DISTINCT_ID,
"alert check backlog",
properties={
"alert_check_frequency": AlertCalculationInterval.HOURLY,
Expand All @@ -123,7 +125,7 @@ def alerts_backlog_task() -> None:
DAILY_ALERTS_BACKLOG_GAUGE.set(daily_alerts_breaching_sla)

posthoganalytics.capture(
"[email protected]",
ANIRUDH_DISTINCT_ID,
"alert check backlog",
properties={
"alert_check_frequency": AlertCalculationInterval.DAILY,
Expand Down Expand Up @@ -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,

Check failure on line 269 in posthog/tasks/alerts/checks.py

View workflow job for this annotation

GitHub Actions / Python code quality checks

Item "None" of "User | None" has no attribute "distinct_id"

Check failure on line 269 in posthog/tasks/alerts/checks.py

View workflow job for this annotation

GitHub Actions / Python code quality checks

Argument 1 to "capture" has incompatible type "str | Any | None"; expected "str"
"alert check failed",
properties={
"alert_id": alert.id,
Expand Down Expand Up @@ -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,

Check failure on line 313 in posthog/tasks/alerts/checks.py

View workflow job for this annotation

GitHub Actions / Python code quality checks

Item "None" of "User | None" has no attribute "distinct_id"

Check failure on line 313 in posthog/tasks/alerts/checks.py

View workflow job for this annotation

GitHub Actions / Python code quality checks

Argument 1 to "capture" has incompatible type "str | Any | None"; expected "str"
"alert check",
properties={
"alert_id": alert.id,
Expand All @@ -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,

Check failure on line 336 in posthog/tasks/alerts/checks.py

View workflow job for this annotation

GitHub Actions / Python code quality checks

Item "None" of "User | None" has no attribute "distinct_id"

Check failure on line 336 in posthog/tasks/alerts/checks.py

View workflow job for this annotation

GitHub Actions / Python code quality checks

Argument 1 to "capture" has incompatible type "str | Any | None"; expected "str"
"alert check failed",
properties={
"alert_id": alert.id,
Expand Down Expand Up @@ -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,

Check failure on line 376 in posthog/tasks/alerts/checks.py

View workflow job for this annotation

GitHub Actions / Python code quality checks

Item "None" of "User | None" has no attribute "distinct_id"

Check failure on line 376 in posthog/tasks/alerts/checks.py

View workflow job for this annotation

GitHub Actions / Python code quality checks

Argument 1 to "capture" has incompatible type "str | Any | None"; expected "str"
"alert check failed",
properties={
"alert_id": alert.id,
Expand Down

0 comments on commit 3cb2273

Please sign in to comment.