Skip to content

Commit

Permalink
fix(common): change cluster hard-coded (#25107) (#25130)
Browse files Browse the repository at this point in the history
  • Loading branch information
xu20160924 authored Sep 23, 2024
1 parent 0a80feb commit c2d963c
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions posthog/tasks/tasks.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
from posthog.metrics import pushed_metrics_registry
from posthog.ph_client import get_ph_client
from posthog.redis import get_client
from posthog.settings import CLICKHOUSE_CLUSTER
from posthog.tasks.utils import CeleryQueue

logger = get_logger(__name__)
Expand Down Expand Up @@ -408,11 +409,14 @@ def clickhouse_errors_count() -> None:
name,
value as errors,
dateDiff('minute', last_error_time, now()) minutes_ago
from clusterAllReplicas('posthog', system, errors)
from clusterAllReplicas(%(cluster)s, system, errors)
where code in (999, 225, 242)
order by minutes_ago
"""
rows = sync_execute(QUERY)
params = {
"cluster": CLICKHOUSE_CLUSTER,
}
rows = sync_execute(QUERY, params)
with pushed_metrics_registry("celery_clickhouse_errors") as registry:
errors_gauge = Gauge(
"posthog_celery_clickhouse_errors",
Expand Down

0 comments on commit c2d963c

Please sign in to comment.