: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
fix(api): tag debug_ch_queries calls with product/feature (#57754)
Sandy Spicer3bfd413fc674
diff --git a/posthog/api/debug_ch_queries.py b/posthog/api/debug_ch_queries.pyindex bcfaca3a4c38..679c49259f2d 100644--- a/posthog/api/debug_ch_queries.py+++ b/posthog/api/debug_ch_queries.py@@ -16,6 +16,7 @@ from rest_framework.response import Responsefrom posthog.hogql.query import execute_hogql_queryfrom posthog.clickhouse.client import sync_execute+from posthog.clickhouse.query_tagging import Feature, Product, tag_queriesfrom posthog.cloud_utils import is_cloudfrom posthog.models.team.extensions import get_or_create_team_extensionfrom posthog.models.team.team import Team@@ -206,6 +207,8 @@ class DebugCHQueries(viewsets.ViewSet):if not (request.user.is_staff or DEBUG or is_impersonated_session(request) or not is_cloud()):raise exceptions.PermissionDenied("You're not allowed to see queries.")+ tag_queries(product=Product.INTERNAL, feature=Feature.DEBUG_QUERY)+insight_id = request.query_params.get("insight_id")experiment_id = request.query_params.get("experiment_id")@@ -241,6 +244,8 @@ class DebugCHQueries(viewsets.ViewSet):if not request.user.is_staff:raise exceptions.PermissionDenied("Only staff users can manage precomputation teams.")+ tag_queries(product=Product.INTERNAL, feature=Feature.DEBUG_QUERY)+if request.method == "POST":return self._update_precomputation(request)@@ -344,6 +349,8 @@ class DebugCHQueries(viewsets.ViewSet):if not request.user.is_staff:raise exceptions.PermissionDenied("Only staff users can view slowest queries.")+ tag_queries(product=Product.INTERNAL, feature=Feature.DEBUG_QUERY)+try:hours = int(request.query_params.get("hours", 1))except (TypeError, ValueError):