: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.
Python ab-testingai-analyticsanalyticscdpdata-warehouseexperimentsfeature-flagsjavascriptproduct-analyticspythonreactsession-replaysurveystypescriptweb-analytics
chore(web-analytics): log query runner entry for diagnostics (#58310)
Lucas Ricoy1eb32863eab7
diff --git a/posthog/hogql_queries/web_analytics/test/test_web_analytics_metrics.py b/posthog/hogql_queries/web_analytics/test/test_web_analytics_metrics.pyindex 6066d9be303d..c95525d7063f 100644--- a/posthog/hogql_queries/web_analytics/test/test_web_analytics_metrics.py+++ b/posthog/hogql_queries/web_analytics/test/test_web_analytics_metrics.py@@ -153,10 +153,9 @@ class TestWebAnalyticsMetrics(TestCase):):WebAnalyticsQueryRunner.calculate(runner)- mock_logger.info.assert_called_once()- call_kwargs = mock_logger.info.call_args- assert call_kwargs[0][0] == "web_analytics_query"- kw = call_kwargs[1]+ canonical_calls = [c for c in mock_logger.info.call_args_list if c[0] and c[0][0] == "web_analytics_query"]+ assert len(canonical_calls) == 1+ kw = canonical_calls[0][1]assert kw["team_id"] == 42assert kw["organization_id"] == "org_abc"assert kw["user_id"] == "user_456"diff --git a/posthog/hogql_queries/web_analytics/web_analytics_query_runner.py b/posthog/hogql_queries/web_analytics/web_analytics_query_runner.pyindex 003109a48c44..b3d3e075fb17 100644--- a/posthog/hogql_queries/web_analytics/web_analytics_query_runner.py+++ b/posthog/hogql_queries/web_analytics/web_analytics_query_runner.py@@ -81,6 +81,12 @@ class WebAnalyticsQueryRunner(AnalyticsQueryRunner[WAR], ABC):breakdown_label = breakdown_value.value if breakdown_value is not None else "none"has_conversion_goal = "true" if getattr(self.query, "conversionGoal", None) else "false"+ logger.info(+ "web_analytics_query_started",+ team_id=self.team.pk,+ query_kind=query_kind,+ )+start = perf_counter()response: Optional[WAR] = Noneerror_type = ""