Skip to content

:hedgehog: PostHog is the leading platform for building self-driving products. Our developer tools – AI observability, analytics, session replay, flags, experiments, error tracking, logs, and more – capture all the context agents need to diagnose problems, uncover opportunities, and ship fixes. Steer it all from Slack, web, desktop, or the MCP.

fix(tracing): build aggregation date filters in UTC explicitly (#58322)

Frank Hamand2640e596d55e
diff --git a/products/tracing/backend/aggregation_query_runner.py b/products/tracing/backend/aggregation_query_runner.py
index 689be0e9ae84..8d1581fc5e9c 100644
--- a/products/tracing/backend/aggregation_query_runner.py
+++ b/products/tracing/backend/aggregation_query_runner.py
@@ -19,6 +19,7 @@ import datetime as dt
import contextvars
from concurrent.futures import ThreadPoolExecutor
from typing import TYPE_CHECKING, cast
+from zoneinfo import ZoneInfo
from posthog.schema import (
AggregatedSpanRow,
@@ -136,6 +137,7 @@ class _SpanAggregationMixin:
date_range=self.query.dateRange,
team=self.team,
interval=IntervalType.MINUTE,
+ timezone_info=ZoneInfo("UTC"),
now=dt.datetime.now(),
)
@@ -149,6 +151,7 @@ class _SpanAggregationMixin:
date_range=self.query.dateRange,
team=self.team,
interval=IntervalType.MINUTE,
+ timezone_info=ZoneInfo("UTC"),
now=dt.datetime.now(),
compare_to=compare_filter.compare_to,
)
@@ -157,6 +160,7 @@ class _SpanAggregationMixin:
date_range=self.query.dateRange,
team=self.team,
interval=IntervalType.MINUTE,
+ timezone_info=ZoneInfo("UTC"),
now=dt.datetime.now(),
)