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(web-analytics): pre-warm common.hogvm in eager warmer so lazy query import resolves (#63655)

Lucas Ricoy837c91ced76c
diff --git a/.github/workflows/ci-dagster.yml b/.github/workflows/ci-dagster.yml
index aff355f0c84a..3ff6a031e0d5 100644
--- a/.github/workflows/ci-dagster.yml
+++ b/.github/workflows/ci-dagster.yml
@@ -123,6 +123,7 @@ jobs:
- 'posthog/products.py'
- 'posthog/cloud_utils.py'
- 'posthog/ducklake/**'
+ - 'common/hogvm/**'
# Test infrastructure used by dagster tests
- conftest.py
- 'posthog/conftest.py'
diff --git a/products/web_analytics/dags/eager_web_analytics_precompute.py b/products/web_analytics/dags/eager_web_analytics_precompute.py
index 0495b3ec4fb9..4cb4723279e1 100644
--- a/products/web_analytics/dags/eager_web_analytics_precompute.py
+++ b/products/web_analytics/dags/eager_web_analytics_precompute.py
@@ -78,6 +78,11 @@ from products.analytics_platform.backend.models.preaggregation_job import Preagg
from products.web_analytics.backend.hogql_queries.web_lazy_precompute_common import is_precompute_enabled_for_team
from products.web_analytics.dags.web_preaggregated_utils import check_for_concurrent_runs
+# Pre-warm the HogQL bytecode VM at code-location load, while /code is on sys.path: the query path
+# imports common.hogvm lazily, and the Dagster grpc process can't resolve it on first query, so
+# caching it here keeps that lazy import a hit.
+import common.hogvm.python.execute # noqa: F401
+
logger = structlog.get_logger(__name__)