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.

feat(flags): remove the deprecated usage dashboard endpoints (#114063)

Phil Haack03d1b7979908
diff --git a/docs/internal/feature-flags/django-api-endpoints.md b/docs/internal/feature-flags/django-api-endpoints.md
index a44eba8c55e5..6699e02c59f8 100644
--- a/docs/internal/feature-flags/django-api-endpoints.md
+++ b/docs/internal/feature-flags/django-api-endpoints.md
@@ -73,8 +73,6 @@ See [API write ownership](api-writes.md) for the call path and transaction bound
| `POST` | `.../feature_flags/{pk}/create_static_cohort_for_flag/` | Create a static cohort from matched users |
| `GET` | `.../feature_flags/{pk}/status/` | Flag status (ACTIVE, STALE, DELETED, UNKNOWN) |
| `GET` | `.../feature_flags/{pk}/dependent_flags/` | Flags that depend on this flag |
-| `POST` | `.../feature_flags/{pk}/dashboard/` | Deprecated: create a usage dashboard (sunsets September 25, 2026) |
-| `POST` | `.../feature_flags/{pk}/enrich_usage_dashboard/` | Deprecated: enrich an existing legacy usage dashboard (no removal date set) |
| `POST` | `.../feature_flags/{pk}/enable/` | Set `active: true` only |
| `POST` | `.../feature_flags/{pk}/disable/` | Set `active: false` only |
| `POST` | `.../feature_flags/{pk}/archive/` | Set `archived: true`, disabling the flag in the same write when needed |
diff --git a/frontend/src/scenes/feature-flags/FeatureFlag.tsx b/frontend/src/scenes/feature-flags/FeatureFlag.tsx
index dc78d5e0e389..8ccce5408679 100644
--- a/frontend/src/scenes/feature-flags/FeatureFlag.tsx
+++ b/frontend/src/scenes/feature-flags/FeatureFlag.tsx
@@ -719,11 +719,9 @@ export function FeatureFlag({ id }: FeatureFlagLogicProps): JSX.Element {
function ConnectedUsageDashboard({
featureFlag,
dashboardId,
- hasEnrichedAnalytics,
}: {
featureFlag: FeatureFlagType
dashboardId: number
- hasEnrichedAnalytics: boolean | undefined
}): JSX.Element | null {
const { dashboard, error404 } = useValues(
dashboardLogic({ id: dashboardId, placement: DashboardPlacement.FeatureFlag })
@@ -731,18 +729,6 @@ function ConnectedUsageDashboard({
dashboard: DashboardType | null
error404: boolean
}
- const { enrichUsageDashboard } = useActions(featureFlagLogic)
-
- useEffect(() => {
- if (
- dashboard &&
- hasEnrichedAnalytics &&
- !(dashboard.tiles?.find((tile) => (tile.insight?.name?.indexOf('Feature Viewed') ?? -1) > -1) !== undefined)
- ) {
- enrichUsageDashboard()
- }
- }, [dashboard, hasEnrichedAnalytics, enrichUsageDashboard])
-
// The dashboard FK survives a soft delete (SET_NULL only fires on a hard delete), so a
// deleted dashboard still looks linked here. Fall back to the same inline charts a
// dashboardless flag gets instead of an unrecoverable skeleton.
@@ -801,11 +787,7 @@ function UsageTab({ featureFlag }: { featureFlag: FeatureFlagType }): JSX.Elemen
</LemonBanner>
)}
{dashboardId ? (
- <ConnectedUsageDashboard
- featureFlag={featureFlag}
- dashboardId={dashboardId}
- hasEnrichedAnalytics={hasEnrichedAnalytics}
- />
+ <ConnectedUsageDashboard featureFlag={featureFlag} dashboardId={dashboardId} />
) : featureFlag.id ? (
<FeatureFlagUsageMetrics id={featureFlag.id} />
) : null}
diff --git a/frontend/src/scenes/feature-flags/featureFlagLogic.ts b/frontend/src/scenes/feature-flags/featureFlagLogic.ts
index e67d9c62ad6b..a4b02744a796 100644
--- a/frontend/src/scenes/feature-flags/featureFlagLogic.ts
+++ b/frontend/src/scenes/feature-flags/featureFlagLogic.ts
@@ -1316,9 +1316,6 @@ export interface featureFlagLogicActions {
editing: boolean
expandAdvanced: boolean
}
- enrichUsageDashboard: () => {
- value: true
- }
loadCopyDependencyRequirements: () => {
value: true
}
@@ -2335,7 +2332,6 @@ export const featureFlagLogic = kea<featureFlagLogicType>([
expandAdvanced: options?.expandAdvanced ?? false,
}),
distributeVariantsEqually: true,
- enrichUsageDashboard: true,
setCopyDestinationProject: (id: number | null) => ({ id }),
setAlsoCreateInProjects: (projectIds: number[]) => ({ projectIds }),
setCopySchedule: (copySchedule: boolean) => ({ copySchedule }),
@@ -4001,15 +3997,6 @@ export const featureFlagLogic = kea<featureFlagLogicType>([
reportFeatureFlagScheduleSuccess()
},
showDependentFlagsConfirmation: sharedListeners.showDependentFlagsConfirmation,
- enrichUsageDashboard: async (_, breakpoint) => {
- if (props.id) {
- await breakpoint(1000) // in ms
- // nosemgrep: prefer-codegen-api -- Legacy raw API call with a hand-written URL and an unchecked response type. No generated function covers this endpoint yet. Find out why the generated client skips it (no schema, no product tag, or excluded from the spec) and fix that first.
- await api.create(
- `api/projects/${values.currentProjectId}/feature_flags/${props.id}/enrich_usage_dashboard`
- )
- }
- },
submitFeatureFlagFailure: async () => {
// Collapsed LemonCollapse panels don't render their children, so any inline error
// and its `.Field--error` scroll target won't exist in the DOM until the panel is open.
diff --git a/posthog/test/test_feature_flag_analytics.py b/posthog/test/test_feature_flag_analytics.py
index e8a72939dac1..31ccdf2bad3f 100644
--- a/posthog/test/test_feature_flag_analytics.py
+++ b/posthog/test/test_feature_flag_analytics.py
@@ -23,6 +23,10 @@ from parameterized import parameterized
from posthog import redis
from posthog.constants import FlagRequestType
from posthog.errors import CHQueryErrorUnknownTable
+from posthog.helpers.dashboard_templates import (
+ FEATURE_FLAG_ENRICHED_INTERACTION_INSIGHT_NAME,
+ FEATURE_FLAG_ENRICHED_VIEW_INSIGHT_NAME,
+)
from posthog.models.team.team import Team
from posthog.tasks.tasks import find_flags_with_enriched_analytics as find_flags_with_enriched_analytics_task
@@ -1046,6 +1050,28 @@ class TestEnrichedAnalytics(BaseTest):
self.assertEqual(f1.usage_dashboard.tiles.count(), 4)
self.assertEqual(f3.usage_dashboard.tiles.count(), 2)
+ enriched_insights = {
+ tile.insight.name: (
+ {series["event"] for series in tile.insight.query["source"]["series"]},
+ tile.insight.query["source"]["properties"]["values"][0]["values"][0],
+ )
+ for tile in f1.usage_dashboard.tiles.select_related("insight")
+ if tile.insight
+ and tile.insight.query
+ and tile.insight.name
+ in (FEATURE_FLAG_ENRICHED_VIEW_INSIGHT_NAME, FEATURE_FLAG_ENRICHED_INTERACTION_INSIGHT_NAME)
+ }
+ self.assertEqual(
+ {
+ name: (events, flag_filter["key"], flag_filter["value"])
+ for name, (events, flag_filter) in enriched_insights.items()
+ },
+ {
+ FEATURE_FLAG_ENRICHED_VIEW_INSIGHT_NAME: ({"$feature_view"}, "feature_flag", "test_flag"),
+ FEATURE_FLAG_ENRICHED_INTERACTION_INSIGHT_NAME: ({"$feature_interaction"}, "feature_flag", "test_flag"),
+ },
+ )
+
# now try deleting a usage dashboard. It should not delete the feature flag
f1.usage_dashboard.delete()
diff --git a/products/feature_flags/backend/api/feature_flag.py b/products/feature_flags/backend/api/feature_flag.py
index 5a29b0090e1a..8673fea64792 100644
--- a/products/feature_flags/backend/api/feature_flag.py
+++ b/products/feature_flags/backend/api/feature_flag.py
@@ -10,7 +10,7 @@ from collections.abc import Callable, Iterable, Iterator, Mapping, Sequence
from contextlib import nullcontext
from dataclasses import asdict
from datetime import datetime, timedelta
-from typing import TYPE_CHECKING, Any, Literal, NoReturn, Optional, cast
+from typing import TYPE_CHECKING, Any, NoReturn, Optional, cast
from django.conf import settings
from django.contrib.postgres.aggregates import ArrayAgg
@@ -69,7 +69,6 @@ from posthog.dataclasses import frozen
from posthog.event_usage import report_user_action
from posthog.exceptions import Conflict, first_error_message
from posthog.exceptions_capture import capture_exception
-from posthog.helpers.dashboard_templates import add_enriched_insights_to_feature_flag_dashboard
from posthog.helpers.impersonation import is_impersonated
from posthog.models import Team
from posthog.models.activity_logging.activity_log import Detail, load_activity, log_activity
@@ -188,8 +187,6 @@ scope_audit_logger = structlog.get_logger("posthog.feature_flag_scope_audit")
# the violations that would have been 400s while the #50084 enforcement kill switch is off.
filters_enforcement_logger = structlog.get_logger("posthog.feature_flag_filters_enforcement")
-FEATURE_FLAG_USAGE_DASHBOARD_SUNSET = "Fri, 25 Sep 2026 00:00:00 GMT"
-
# DRF error messages echo caller-controlled input (a ChoiceField repeats the rejected value)
# and bodies up to 20MB reach validation before the filter-size check runs, so an unbounded
# log line is one PATCH away. The bake depends on these logs staying countable.
@@ -1297,14 +1294,6 @@ class FeatureFlagExperimentSetMetadataSerializer(serializers.Serializer):
)
-class FeatureFlagUsageDashboardSuccessSerializer(serializers.Serializer):
- success = serializers.BooleanField(help_text="Whether the usage dashboard operation completed successfully.")
-
-
-class FeatureFlagUsageDashboardErrorSerializer(FeatureFlagUsageDashboardSuccessSerializer):
- error = serializers.CharField(help_text="Why the usage dashboard operation failed.")
-
-
class FeatureFlagSerializer(
TaggedItemSerializerMixin,
EvaluationContextSerializerMixin,
@@ -1342,8 +1331,7 @@ class FeatureFlagSerializer(
allow_null=True,
help_text=(
"Legacy dashboard of saved usage insights for this flag, or null if it has none. "
- "New flags show usage charts inline instead. The dashboard creation endpoint is deprecated "
- "and will be removed after September 25, 2026."
+ "Usage charts are on the flag's Usage tab. The API does not create these dashboards."
),
)
analytics_dashboards = TeamScopedPrimaryKeyRelatedField(
@@ -4233,10 +4221,9 @@ class FeatureFlagViewSet(
def _deleted_flag_rejection(feature_flag: FeatureFlag, restore_hint: str) -> Response | None:
"""Refuse a soft-deleted flag.
- Dashboard-generating actions use this because they would recreate the auto-generated
- insights that the delete_feature_flag_usage_insights sweep deletes. The lifecycle
- actions use it because evaluation reads through a manager that excludes deleted rows,
- so reporting a state change on one would be a success for a flag that serves nobody.
+ The lifecycle actions use this because evaluation reads through a manager that excludes
+ deleted rows, so reporting a state change on one would be a success for a flag that serves nobody.
+ The rollout actions use it because a filters write on a deleted flag takes effect when it is restored.
"""
if not feature_flag.deleted:
return None
@@ -4248,176 +4235,6 @@ class FeatureFlagViewSet(
status=400,
)
- @staticmethod
- def _with_usage_dashboard_deprecation_headers(response: Response, *, include_sunset: bool = True) -> Response:
- response["Deprecation"] = "true"
- if include_sunset:
- response["Sunset"] = FEATURE_FLAG_USAGE_DASHBOARD_SUNSET
- return response
-
- def _report_usage_dashboard_endpoint_call(
- self,
- request: request.Request,
- endpoint: Literal["dashboard", "enrich_usage_dashboard"],
- outcome: Literal["created", "existing", "success", "error"],
- ) -> None:
- try:
- report_user_action(
- request.user,
- "deprecated feature flag usage dashboard endpoint called",
- {"endpoint": endpoint, "outcome": outcome},
- team=self.team,
- organization=self.team.organization,
- )
- except Exception:
- logger.exception("Failed to report deprecated feature flag usage dashboard endpoint call")
-
- # No UI surface calls this, since the Usage tab renders its charts inline.
- # Without required_scopes, APIScopePermission rejects every personal API key, OAuth, and
- # project secret key caller, so only a session-authenticated request reaches this action.
- # It remains functional until the announced sunset.
- @extend_schema(
- request=None,
- responses={
- status.HTTP_200_OK: FeatureFlagUsageDashboardSuccessSerializer,
- status.HTTP_400_BAD_REQUEST: FeatureFlagUsageDashboardErrorSerializer,
- },
- deprecated=True,
- description=(
- "Deprecated. Ensures a saved usage dashboard exists for a feature flag. "
- "This endpoint will be removed after September 25, 2026; usage charts remain available "
- "on the feature flag Usage tab."
- ),
- )
- @action(methods=["POST"], detail=True)
- def dashboard(self, request: request.Request, **kwargs: Any) -> Response:
- from products.dashboards.backend.models.dashboard import Dashboard
-
- feature_flag: FeatureFlag = self.get_object()
- rejection = self._deleted_flag_rejection(feature_flag, "generating a usage dashboard")
- if rejection is not None:
- self._report_usage_dashboard_endpoint_call(request, "dashboard", "error")
- return self._with_usage_dashboard_deprecation_headers(rejection)
- try:
- # The FK on the flag isn't cleared by a dashboard soft-delete, so look the id up
- # through the manager that excludes deleted rows rather than via the FK accessor,
- # which would happily return a deleted dashboard and skip regenerating it.
- usage_dashboard = (
- Dashboard.objects.filter(
- id=feature_flag.usage_dashboard_id, team__project_id=self.team.project_id
- ).first()
- if feature_flag.usage_dashboard_id
- else None
- )
- if usage_dashboard is None:
- usage_dashboard = _create_usage_dashboard(feature_flag, request.user)
- outcome: Literal["created", "existing"] = "created"
- else:
- outcome = "existing"
-
- if feature_flag.has_enriched_analytics and not feature_flag.usage_dashboard_has_enriched_insights:
- add_enriched_insights_to_feature_flag_dashboard(feature_flag, usage_dashboard)
-
- except Exception as e:
- capture_exception(e)
- self._report_usage_dashboard_endpoint_call(request, "dashboard", "error")
- return self._with_usage_dashboard_deprecation_headers(
- Response(
- {
- "success": False,
- "error": "Unable to generate usage dashboard",
- },
- status=status.HTTP_400_BAD_REQUEST,
- )
- )
-
- self._report_usage_dashboard_endpoint_call(request, "dashboard", outcome)
- return self._with_usage_dashboard_deprecation_headers(Response({"success": True}, status=status.HTTP_200_OK))
-
- # Unlike `dashboard` above, the main app does call this: featureFlagLogic.ts's
- # enrichUsageDashboard listener calls it automatically once a flag gains enriched
- # analytics. As with `dashboard`, token callers are rejected before reaching this
- # action, so nearly every call the telemetry below sees is that automatic one.
- @extend_schema(
- request=None,
- responses={
- status.HTTP_200_OK: FeatureFlagUsageDashboardSuccessSerializer,
- status.HTTP_400_BAD_REQUEST: FeatureFlagUsageDashboardErrorSerializer,
- },
- deprecated=True,
- description=(
- "Deprecated. Adds enriched insights to an existing legacy feature flag usage dashboard. "
- "No removal date has been set; usage charts remain available on the feature flag Usage tab."
- ),
- )
- @action(methods=["POST"], detail=True)
- def enrich_usage_dashboard(self, request: request.Request, **kwargs: Any) -> Response:
- feature_flag: FeatureFlag = self.get_object()
- rejection = self._deleted_flag_rejection(feature_flag, "enriching its usage dashboard")
- if rejection is not None:
- self._report_usage_dashboard_endpoint_call(request, "enrich_usage_dashboard", "error")
- return self._with_usage_dashboard_deprecation_headers(rejection, include_sunset=False)
- usage_dashboard = feature_flag.usage_dashboard
-
- if not usage_dashboard:
- self._report_usage_dashboard_endpoint_call(request, "enrich_usage_dashboard", "error")
- return self._with_usage_dashboard_deprecation_headers(
- Response(
- {
- "success": False,
- "error": "Usage dashboard not found. Usage charts are available on the feature flag Usage tab.",
- },
- status=status.HTTP_400_BAD_REQUEST,
- ),
- include_sunset=False,
- )
-
- if feature_flag.usage_dashboard_has_enriched_insights:
- self._report_usage_dashboard_endpoint_call(request, "enrich_usage_dashboard", "error")
- return self._with_usage_dashboard_deprecation_headers(
- Response(
- {
- "success": False,
- "error": "Usage dashboard already has enriched data",
- },
- status=status.HTTP_400_BAD_REQUEST,
- ),
- include_sunset=False,
- )
-
- if not feature_flag.has_enriched_analytics:
- self._report_usage_dashboard_endpoint_call(request, "enrich_usage_dashboard", "error")
- return self._with_usage_dashboard_deprecation_headers(
- Response(
- {
- "success": False,
- "error": "No enriched analytics available for this feature flag",
- },
- status=status.HTTP_400_BAD_REQUEST,
- ),
- include_sunset=False,
- )
- try:
- add_enriched_insights_to_feature_flag_dashboard(feature_flag, usage_dashboard)
- except Exception as e:
- capture_exception(e)
- self._report_usage_dashboard_endpoint_call(request, "enrich_usage_dashboard", "error")
- return self._with_usage_dashboard_deprecation_headers(
- Response(
- {
- "success": False,
- "error": "Unable to enrich usage dashboard",
- },
- status=status.HTTP_400_BAD_REQUEST,
- ),
- include_sunset=False,
- )
-
- self._report_usage_dashboard_endpoint_call(request, "enrich_usage_dashboard", "success")
- return self._with_usage_dashboard_deprecation_headers(
- Response({"success": True}, status=status.HTTP_200_OK), include_sunset=False
- )
-
@extend_schema(
responses={200: DependentFlagSerializer(many=True)},
)
diff --git a/products/feature_flags/backend/api/test/test_feature_flag.py b/products/feature_flags/backend/api/test/test_feature_flag.py
index 78dfb4dd6aaa..557cf5783eef 100644
--- a/products/feature_flags/backend/api/test/test_feature_flag.py
+++ b/products/feature_flags/backend/api/test/test_feature_flag.py
@@ -69,6 +69,7 @@ from products.feature_flags.backend.api.feature_flag import (
FLAG_FILTERS_WRITE_COUNTER,
FeatureFlagSerializer,
FeatureFlagStatusResponseSerializer,
+ _create_usage_dashboard,
_flag_write_source,
parse_created_by_ids,
)
@@ -132,8 +133,7 @@ class TestFeatureFlag(APIBaseTest, ClickhouseTestMixin):
return query["source"]["properties"]["values"][0]["values"][0]["value"]
def _generate_usage_dashboard(self, flag_id: int) -> None:
- response = self.client.post(f"/api/projects/{self.team.id}/feature_flags/{flag_id}/dashboard")
- self.assertEqual(response.status_code, status.HTTP_200_OK)
+ _create_usage_dashboard(FeatureFlag.objects.get(id=flag_id), self.user)
def test_cant_create_flag_with_duplicate_key(self):
FeatureFlag.objects.create(team=self.team, created_by=self.user, key="red_button")
@@ -4729,385 +4729,6 @@ class TestFeatureFlag(APIBaseTest, ClickhouseTestMixin):
# targeting_flag and internal_targeting_flag should be excluded
# (they're survey-specific and filtered out from the main list)
- @patch("products.feature_flags.backend.api.feature_flag.report_user_action")
- def test_generate_usage_dashboard_creates_insights(self, mock_report_user_action):
- response = self.client.post(
- f"/api/projects/{self.team.id}/feature_flags/",
- {
- "name": "Alpha feature",
- "key": "alpha-feature",
- "filters": {"groups": [{"rollout_percentage": 50}]},
- },
- format="json",
- )
- self.assertEqual(response.status_code, status.HTTP_201_CREATED)
- flag_id = response.json()["id"]
- self._generate_usage_dashboard(flag_id)
- instance = FeatureFlag.objects.get(id=flag_id)
- self.assertEqual(instance.key, "alpha-feature")
-
- dashboard = instance.usage_dashboard
- assert dashboard is not None
- assert dashboard.tiles is not None
- tiles = sorted(
- dashboard.tiles.all(),
- key=lambda x: str(x.insight.name if x.insight is not None else ""),
- )
-
- self.assertEqual(dashboard.name, "Generated Dashboard: alpha-feature Usage")
- self.assertEqual(
- dashboard.description,
- "This dashboard was generated by the feature flag with key (alpha-feature)",
- )
- assert dashboard is not None, "Usage dashboard was not created"
- self.assertEqual(dashboard.creation_mode, Dashboard.CreationMode.TEMPLATE)
- self.assertEqual(dashboard.filters, {"date_from": "-30d"})
- self.assertEqual(len(tiles), 2)
- assert tiles[0].insight is not None
- self.assertEqual(tiles[0].insight.name, "Feature Flag Called Total Volume")
- self.assertEqual(
- tiles[0].insight.query,
- {
- "kind": "InsightVizNode",
- "source": {
- "kind": "TrendsQuery",
- "series": [
- {
- "kind": "EventsNode",
- "name": "$feature_flag_called",
- "event": "$feature_flag_called",
- }
- ],
- "interval": "day",
- "dateRange": {"date_from": "-30d", "explicitDate": False},
- "properties": {
- "type": "AND",
- "values": [
- {
- "type": "AND",
- "values": [
- {
- "key": "$feature_flag",
- "type": "event",
- "value": "alpha-feature",
- "operator": "exact",
- }
- ],
- }
- ],
- },
- "trendsFilter": {
- "display": "ActionsLineGraph",
- "showLegend": False,
- "yAxisScaleType": "linear",
- "showValuesOnSeries": False,
- "smoothingIntervals": 1,
- "showPercentStackView": False,
- "aggregationAxisFormat": "numeric",
- "showAlertThresholdLines": False,
- },
- "breakdownFilter": {
- "breakdown": "$feature_flag_response",
- "breakdown_type": "event",
- },
- "filterTestAccounts": False,
- },
- },
- )
- assert tiles[1].insight is not None
- self.assertEqual(tiles[1].insight.name, "Feature Flag calls made by unique users per variant")
- self.assertEqual(
- tiles[1].insight.query,
- {
- "kind": "InsightVizNode",
- "source": {
- "kind": "TrendsQuery",
- "series": [
- {
- "kind": "EventsNode",
- "math": "dau",
- "name": "$feature_flag_called",
- "event": "$feature_flag_called",
- }
- ],
- "interval": "day",
- "dateRange": {"date_from": "-30d", "explicitDate": False},
- "properties": {
- "type": "AND",
- "values": [
- {
- "type": "AND",
- "values": [
- {
- "key": "$feature_flag",
- "type": "event",
- "value": "alpha-feature",
- "operator": "exact",
- }
- ],
- }
- ],
- },
- "trendsFilter": {
- "display": "ActionsTable",
- "showLegend": False,
- "yAxisScaleType": "linear",
- "showValuesOnSeries": False,
- "smoothingIntervals": 1,
- "showPercentStackView": False,
- "aggregationAxisFormat": "numeric",
- "showAlertThresholdLines": False,
- },
- "breakdownFilter": {
- "breakdown": "$feature_flag_response",
- "breakdown_type": "event",
- },
- "filterTestAccounts": False,
- },
- },
- )
-
- # now enable enriched analytics
- instance.has_enriched_analytics = True
- instance.save()
-
- response = self.client.post(
- f"/api/projects/{self.team.id}/feature_flags/{flag_id}/enrich_usage_dashboard",
- format="json",
- )
- self.assertEqual(response.status_code, status.HTTP_200_OK)
-
- instance.refresh_from_db()
-
- dashboard = instance.usage_dashboard
- assert dashboard is not None
- assert dashboard.tiles is not None
- tiles = sorted(
- dashboard.tiles.all(),
- key=lambda x: str(x.insight.name if x.insight is not None else ""),
- )
-
- self.assertEqual(dashboard.name, "Generated Dashboard: alpha-feature Usage")
- self.assertEqual(
- dashboard.description,
- "This dashboard was generated by the feature flag with key (alpha-feature)",
- )
- self.assertEqual(dashboard.filters, {"date_from": "-30d"})
- self.assertEqual(len(tiles), 4)
- assert tiles[0].insight is not None
- self.assertEqual(tiles[0].insight.name, "Feature Flag Called Total Volume")
- self.assertEqual(
- tiles[0].insight.query,
- {
- "kind": "InsightVizNode",
- "source": {
- "kind": "TrendsQuery",
- "series": [
- {
- "kind": "EventsNode",
- "name": "$feature_flag_called",
- "event": "$feature_flag_called",
- }
- ],
- "interval": "day",
- "dateRange": {"date_from": "-30d", "explicitDate": False},
- "properties": {
- "type": "AND",
- "values": [
- {
- "type": "AND",
- "values": [
- {
- "key": "$feature_flag",
- "type": "event",
- "value": "alpha-feature",
- "operator": "exact",
- }
- ],
- }
- ],
- },
- "trendsFilter": {
- "display": "ActionsLineGraph",
- "showLegend": False,
- "yAxisScaleType": "linear",
- "showValuesOnSeries": False,
- "smoothingIntervals": 1,
- "showPercentStackView": False,
- "aggregationAxisFormat": "numeric",
- "showAlertThresholdLines": False,
- },
- "breakdownFilter": {
- "breakdown": "$feature_flag_response",
- "breakdown_type": "event",
- },
- "filterTestAccounts": False,
- },
- },
- )
- assert tiles[1].insight is not None
- self.assertEqual(tiles[1].insight.name, "Feature Flag calls made by unique users per variant")
- self.assertEqual(
- tiles[1].insight.query,
- {
- "kind": "InsightVizNode",
- "source": {
- "kind": "TrendsQuery",
- "series": [
- {
- "kind": "EventsNode",
- "math": "dau",
- "name": "$feature_flag_called",
- "event": "$feature_flag_called",
- }
- ],
- "interval": "day",
- "dateRange": {"date_from": "-30d", "explicitDate": False},
- "properties": {
- "type": "AND",
- "values": [
- {
- "type": "AND",
- "values": [
- {
- "key": "$feature_flag",
- "type": "event",
- "value": "alpha-feature",
- "operator": "exact",
- }
- ],
- }
- ],
- },
- "trendsFilter": {
- "display": "ActionsTable",
- "showLegend": False,
- "yAxisScaleType": "linear",
- "showValuesOnSeries": False,
- "smoothingIntervals": 1,
- "showPercentStackView": False,
- "aggregationAxisFormat": "numeric",
- "showAlertThresholdLines": False,
- },
- "breakdownFilter": {
- "breakdown": "$feature_flag_response",
- "breakdown_type": "event",
- },
- "filterTestAccounts": False,
- },
- },
- )
-
- # enriched insights
- assert tiles[2].insight is not None
- self.assertEqual(tiles[2].insight.name, "Feature Interaction Total Volume")
- self.assertEqual(
- tiles[2].insight.query,
- {
- "kind": "InsightVizNode",
- "source": {
- "kind": "TrendsQuery",
- "series": [
- {
- "kind": "EventsNode",
- "name": "Feature Interaction - Total",
- "event": "$feature_interaction",
- },
- {
- "kind": "EventsNode",
- "math": "dau",
- "name": "Feature Interaction - Unique users",
- "event": "$feature_interaction",
- },
- ],
- "interval": "day",
- "dateRange": {"date_from": "-30d", "explicitDate": False},
- "properties": {
- "type": "AND",
- "values": [
- {
- "type": "AND",
- "values": [
- {
- "key": "feature_flag",
- "type": "event",
- "value": "alpha-feature",
- "operator": "exact",
- }
- ],
- }
- ],
- },
- "trendsFilter": {
- "display": "ActionsLineGraph",
- "showLegend": False,
- "yAxisScaleType": "linear",
- "showValuesOnSeries": False,
- "smoothingIntervals": 1,
- "showPercentStackView": False,
- "aggregationAxisFormat": "numeric",
- "showAlertThresholdLines": False,
- },
- "breakdownFilter": {"breakdown_type": "event"},
- "filterTestAccounts": False,
- },
- },
- )
- assert tiles[3].insight is not None
- self.assertEqual(tiles[3].insight.name, "Feature Viewed Total Volume")
- self.assertEqual(
- tiles[3].insight.query,
- {
- "kind": "InsightVizNode",
- "source": {
- "kind": "TrendsQuery",
- "series": [
- {
- "kind": "EventsNode",
- "name": "Feature View - Total",
- "event": "$feature_view",
- },
- {
- "kind": "EventsNode",
- "math": "dau",
- "name": "Feature View - Unique users",
- "event": "$feature_view",
- },
- ],
- "interval": "day",
- "dateRange": {"date_from": "-30d", "explicitDate": False},
- "properties": {
- "type": "AND",
- "values": [
- {
- "type": "AND",
- "values": [
- {
- "key": "feature_flag",
- "type": "event",
- "value": "alpha-feature",
- "operator": "exact",
- }
- ],
- }
- ],
- },
- "trendsFilter": {
- "display": "ActionsLineGraph",
- "showLegend": False,
- "yAxisScaleType": "linear",
- "showValuesOnSeries": False,
- "smoothingIntervals": 1,
- "showPercentStackView": False,
- "aggregationAxisFormat": "numeric",
- "showAlertThresholdLines": False,
- },
- "breakdownFilter": {"breakdown_type": "event"},
- "filterTestAccounts": False,
- },
- },
- )
-
@parameterized.expand(
[
("no_group_type_mapping", None, "group", "groups"),
@@ -5115,7 +4736,7 @@ class TestFeatureFlag(APIBaseTest, ClickhouseTestMixin):
]
)
@patch("products.feature_flags.backend.api.feature_flag.report_user_action")
- def test_generate_group_usage_dashboard_creates_insights(
+ def test_update_group_feature_flag_key_updates_usage_dashboard(
self, _name, group_type, expected_singular, expected_plural, mock_report_user_action
):
if group_type is not None:
@@ -5127,81 +4748,6 @@ class TestFeatureFlag(APIBaseTest, ClickhouseTestMixin):
name_singular=expected_singular,
name_plural=expected_plural,
)
- response = self.client.post(
- f"/api/projects/{self.team.id}/feature_flags/",
- {
- "name": "Group feature",
- "key": "group-feature",
- "filters": {
- "aggregation_group_type_index": 0,
- "groups": [
- {
- "rollout_percentage": 50,
- "properties": [
- {
- "key": "industry",
- "value": "finance",
- "type": "group",
- "group_type_index": 0,
- }
- ],
- }
- ],
- },
- },
- format="json",
- )
- self.assertEqual(response.status_code, status.HTTP_201_CREATED)
- flag_id = response.json()["id"]
- self._generate_usage_dashboard(flag_id)
- instance = FeatureFlag.objects.get(id=flag_id)
-
- dashboard = instance.usage_dashboard
- assert dashboard is not None
- assert dashboard.tiles is not None
- tiles = sorted(
- dashboard.tiles.all(),
- key=lambda x: str(x.insight.name if x.insight is not None else ""),
- )
- self.assertEqual(len(tiles), 2)
-
- group_property_filter = {
- "key": "$group_0",
- "type": "event",
- "value": "is_set",
- "operator": "is_set",
- }
- flag_property_filter = {
- "key": "$feature_flag",
- "type": "event",
- "value": "group-feature",
- "operator": "exact",
- }
-
- assert tiles[0].insight is not None
- total_volume_query = cast(dict[str, Any], tiles[0].insight.query)
- total_volume_properties = total_volume_query["source"]["properties"]["values"][0]["values"]
- self.assertEqual(total_volume_properties, [flag_property_filter, group_property_filter])
-
- assert tiles[1].insight is not None
- self.assertEqual(tiles[1].insight.name, f"Feature Flag calls made by unique {expected_plural} per variant")
- self.assertEqual(
- tiles[1].insight.description,
- f"Shows the number of unique {expected_singular} calls made on feature flag per variant with key: group-feature",
- )
- unique_calls_query = cast(dict[str, Any], tiles[1].insight.query)
- unique_calls_series = unique_calls_query["source"]["series"][0]
- self.assertEqual(unique_calls_series["math"], "unique_group")
- self.assertEqual(unique_calls_series["math_group_type_index"], 0)
- unique_calls_properties = unique_calls_query["source"]["properties"]["values"][0]["values"]
- self.assertEqual(unique_calls_properties, [flag_property_filter, group_property_filter])
-
- @patch("posthog.personhog_client.client.get_personhog_client")
- @patch("products.feature_flags.backend.api.feature_flag.report_user_action")
- def test_update_group_feature_flag_key_updates_usage_dashboard(
- self, mock_report_user_action, mock_personhog_client
- ):
- mock_personhog_client.return_value.get_group_type_mappings_by_project_id.return_value = MagicMock(mappings=[])
create = self.client.post(
f"/api/projects/{self.team.id}/feature_flags/",
{
@@ -5251,269 +4797,11 @@ class TestFeatureFlag(APIBaseTest, ClickhouseTestMixin):
assert tiles[1].insight is not None
unique_calls_query = cast(dict[str, Any], tiles[1].insight.query)
self.assertEqual(unique_calls_query["source"]["properties"]["values"][0]["values"], expected_properties)
+ self.assertEqual(tiles[1].insight.name, f"Feature Flag calls made by unique {expected_plural} per variant")
self.assertEqual(
tiles[1].insight.description,
- "Shows the number of unique group calls made on feature flag per variant with key: renamed-group-feature",
- )
-
- @time_machine.travel("2021-08-25T22:09:14.252Z", tick=False)
- @patch("products.feature_flags.backend.api.feature_flag.report_user_action")
- def test_dashboard_enrichment_fails_if_already_enriched(self, mock_report_user_action):
- response = self.client.post(
- f"/api/projects/{self.team.id}/feature_flags/",
- {
- "name": "Alpha feature",
- "key": "alpha-feature",
- "filters": {"groups": [{"rollout_percentage": 50}]},
- },
- format="json",
- )
- self.assertEqual(response.status_code, status.HTTP_201_CREATED)
- flag_id = response.json()["id"]
- self._generate_usage_dashboard(flag_id)
- instance = FeatureFlag.objects.get(id=flag_id)
- self.assertEqual(instance.key, "alpha-feature")
-
- # now enable enriched analytics
- instance.has_enriched_analytics = True
- instance.save()
- mock_report_user_action.reset_mock()
-
- response = self.client.post(
- f"/api/projects/{self.team.id}/feature_flags/{flag_id}/enrich_usage_dashboard",
- format="json",
- )
- self.assertEqual(response.status_code, status.HTTP_200_OK)
- self.assertEqual(response["Deprecation"], "true")
- self.assertNotIn("Sunset", response)
- mock_report_user_action.assert_called_once_with(
- self.user,
- "deprecated feature flag usage dashboard endpoint called",
- {"endpoint": "enrich_usage_dashboard", "outcome": "success"},
- team=instance.team,
- organization=self.organization,
- )
-
- # now try enriching again
- mock_report_user_action.reset_mock()
- response = self.client.post(
- f"/api/projects/{self.team.id}/feature_flags/{flag_id}/enrich_usage_dashboard",
- format="json",
- )
- self.assertEqual(response.status_code, status.HTTP_400_BAD_REQUEST)
- self.assertEqual(response["Deprecation"], "true")
- self.assertNotIn("Sunset", response)
- self.assertEqual(
- response.json(),
- {"error": "Usage dashboard already has enriched data", "success": False},
- )
- mock_report_user_action.assert_called_once_with(
- self.user,
- "deprecated feature flag usage dashboard endpoint called",
- {"endpoint": "enrich_usage_dashboard", "outcome": "error"},
- team=instance.team,
- organization=self.organization,
- )
-
- @patch("products.feature_flags.backend.api.feature_flag.report_user_action")
- def test_dashboard_enrichment_fails_if_no_enriched_data(self, mock_report_user_action):
- response = self.client.post(
- f"/api/projects/{self.team.id}/feature_flags/",
- {
- "name": "Alpha feature",
- "key": "alpha-feature",
- "filters": {"groups": [{"rollout_percentage": 50}]},
- },
- format="json",
- )
- self.assertEqual(response.status_code, status.HTTP_201_CREATED)
- flag_id = response.json()["id"]
- instance = FeatureFlag.objects.get(id=flag_id)
- self.assertEqual(instance.key, "alpha-feature")
- self._generate_usage_dashboard(flag_id)
-
- response = self.client.post(
- f"/api/projects/{self.team.id}/feature_flags/{flag_id}/enrich_usage_dashboard",
- format="json",
- )
- self.assertEqual(response.status_code, status.HTTP_400_BAD_REQUEST)
- self.assertEqual(
- response.json(),
- {
- "error": "No enriched analytics available for this feature flag",
- "success": False,
- },
- )
-
- @patch("products.feature_flags.backend.api.feature_flag.report_user_action")
- def test_dashboard_enrichment_fails_if_no_usage_dashboard(self, mock_report_user_action: MagicMock) -> None:
- response = self.client.post(
- f"/api/projects/{self.team.id}/feature_flags/",
- {
- "name": "Alpha feature",
- "key": "alpha-feature",
- "filters": {"groups": [{"rollout_percentage": 50}]},
- },
- format="json",
- )
- self.assertEqual(response.status_code, status.HTTP_201_CREATED)
- flag_id = response.json()["id"]
- flag = FeatureFlag.objects.get(id=flag_id)
- mock_report_user_action.reset_mock()
-
- response = self.client.post(
- f"/api/projects/{self.team.id}/feature_flags/{flag_id}/enrich_usage_dashboard",
- format="json",
- )
- self.assertEqual(response.status_code, status.HTTP_400_BAD_REQUEST)
- self.assertEqual(response["Deprecation"], "true")
- self.assertNotIn("Sunset", response)
- self.assertEqual(
- response.json(),
- {
- "error": "Usage dashboard not found. Usage charts are available on the feature flag Usage tab.",
- "success": False,
- },
- )
- mock_report_user_action.assert_called_once_with(
- self.user,
- "deprecated feature flag usage dashboard endpoint called",
- {"endpoint": "enrich_usage_dashboard", "outcome": "error"},
- team=flag.team,
- organization=self.organization,
- )
-
- def test_dashboard_endpoint_is_idempotent(self) -> None:
- response = self.client.post(
- f"/api/projects/{self.team.id}/feature_flags/",
- {"name": "Alpha feature", "key": "alpha-feature", "filters": {"groups": [{"rollout_percentage": 50}]}},
- format="json",
- )
- self.assertEqual(response.status_code, status.HTTP_201_CREATED)
- flag_id = response.json()["id"]
-
- self._generate_usage_dashboard(flag_id)
- first_dashboard_id = FeatureFlag.objects.get(id=flag_id).usage_dashboard_id
- assert first_dashboard_id is not None
-
- self._generate_usage_dashboard(flag_id)
- instance = FeatureFlag.objects.get(id=flag_id)
-
- self.assertEqual(instance.usage_dashboard_id, first_dashboard_id)
- self.assertTrue(Dashboard.objects.filter(id=first_dashboard_id, deleted=False).exists())
-
- @patch("products.feature_flags.backend.api.feature_flag.report_user_action")
- def test_dashboard_endpoint_announces_deprecation_and_reports_usage(
- self, mock_report_user_action: MagicMock
- ) -> None:
- flag = FeatureFlag.objects.create(team=self.team, created_by=self.user, key="deprecated-dashboard-endpoint")
-
- response = self.client.post(f"/api/projects/{self.team.id}/feature_flags/{flag.id}/dashboard")
-
- self.assertEqual(response.status_code, status.HTTP_200_OK)
- self.assertEqual(response.json(), {"success": True})
- self.assertEqual(response["Deprecation"], "true")
- self.assertEqual(response["Sunset"], "Fri, 25 Sep 2026 00:00:00 GMT")
- mock_report_user_action.assert_called_once_with(
- self.user,
- "deprecated feature flag usage dashboard endpoint called",
- {"endpoint": "dashboard", "outcome": "created"},
- team=flag.team,
- organization=self.organization,
- )
-
- mock_report_user_action.reset_mock()
- response = self.client.post(f"/api/projects/{self.team.id}/feature_flags/{flag.id}/dashboard")
-
- self.assertEqual(response.status_code, status.HTTP_200_OK)
- mock_report_user_action.assert_called_once_with(
- self.user,
- "deprecated feature flag usage dashboard endpoint called",
- {"endpoint": "dashboard", "outcome": "existing"},
- team=flag.team,
- organization=self.organization,
- )
-
- @patch("products.feature_flags.backend.api.feature_flag.capture_exception")
- @patch("products.feature_flags.backend.api.feature_flag.report_user_action")
- @patch("products.feature_flags.backend.api.feature_flag._create_usage_dashboard", side_effect=RuntimeError)
- def test_dashboard_endpoint_deprecation_headers_are_returned_on_error(
- self,
- mock_create_usage_dashboard: MagicMock,
- mock_report_user_action: MagicMock,
- mock_capture_exception: MagicMock,
- ) -> None:
- flag = FeatureFlag.objects.create(team=self.team, created_by=self.user, key="dashboard-generation-error")
-
- response = self.client.post(f"/api/projects/{self.team.id}/feature_flags/{flag.id}/dashboard")
-
- self.assertEqual(response.status_code, status.HTTP_400_BAD_REQUEST)
- self.assertEqual(response.json(), {"success": False, "error": "Unable to generate usage dashboard"})
- self.assertEqual(response["Deprecation"], "true")
- self.assertEqual(response["Sunset"], "Fri, 25 Sep 2026 00:00:00 GMT")
- mock_report_user_action.assert_called_once_with(
- self.user,
- "deprecated feature flag usage dashboard endpoint called",
- {"endpoint": "dashboard", "outcome": "error"},
- team=flag.team,
- organization=self.organization,
- )
- mock_capture_exception.assert_called_once()
- mock_create_usage_dashboard.assert_called_once()
-
- @patch(
- "products.feature_flags.backend.api.feature_flag.report_user_action",
- side_effect=RuntimeError("telemetry unavailable"),
- )
- def test_dashboard_endpoint_ignores_telemetry_failures(self, mock_report_user_action: MagicMock) -> None:
- flag = FeatureFlag.objects.create(team=self.team, created_by=self.user, key="dashboard-telemetry-error")
-
- response = self.client.post(f"/api/projects/{self.team.id}/feature_flags/{flag.id}/dashboard")
-
- self.assertEqual(response.status_code, status.HTTP_200_OK)
- self.assertEqual(response["Deprecation"], "true")
- self.assertEqual(response["Sunset"], "Fri, 25 Sep 2026 00:00:00 GMT")
- flag.refresh_from_db()
- self.assertIsNotNone(flag.usage_dashboard_id)
- mock_report_user_action.assert_called_once()
-
- def test_dashboard_endpoint_regenerates_after_dashboard_is_deleted(self) -> None:
- response = self.client.post(
- f"/api/projects/{self.team.id}/feature_flags/",
- {"name": "Alpha feature", "key": "alpha-feature", "filters": {"groups": [{"rollout_percentage": 50}]}},
- format="json",
+ f"Shows the number of unique {expected_singular} calls made on feature flag per variant with key: renamed-group-feature",
)
- self.assertEqual(response.status_code, status.HTTP_201_CREATED)
- flag_id = response.json()["id"]
-
- self._generate_usage_dashboard(flag_id)
- deleted_dashboard_id = FeatureFlag.objects.get(id=flag_id).usage_dashboard_id
- assert deleted_dashboard_id is not None
- Dashboard.objects.filter(id=deleted_dashboard_id).update(deleted=True)
-
- self._generate_usage_dashboard(flag_id)
- instance = FeatureFlag.objects.get(id=flag_id)
-
- new_dashboard_id = instance.usage_dashboard_id
- assert new_dashboard_id is not None
- self.assertNotEqual(new_dashboard_id, deleted_dashboard_id)
- self.assertTrue(Dashboard.objects.filter(id=new_dashboard_id, deleted=False).exists())
-
- @parameterized.expand(["dashboard", "enrich_usage_dashboard"])
- def test_dashboard_generating_endpoints_reject_a_deleted_flag(self, endpoint: str) -> None:
- flag = FeatureFlag.objects.create(team=self.team, created_by=self.user, key="deleted-flag", deleted=True)
-
- response = self.client.post(f"/api/projects/{self.team.id}/feature_flags/{flag.id}/{endpoint}")
-
- self.assertEqual(response.status_code, status.HTTP_400_BAD_REQUEST)
- self.assertIn("has been deleted", response.json()["error"])
- self.assertEqual(response["Deprecation"], "true")
- if endpoint == "dashboard":
- self.assertEqual(response["Sunset"], "Fri, 25 Sep 2026 00:00:00 GMT")
- else:
- self.assertNotIn("Sunset", response)
- flag.refresh_from_db()
- self.assertIsNone(flag.usage_dashboard_id)
@patch("products.feature_flags.backend.flag_analytics.CACHE_BUCKET_SIZE", 10)
def test_local_evaluation_billing_analytics_for_regular_feature_flag_list(self):
diff --git a/products/feature_flags/backend/flag_analytics.py b/products/feature_flags/backend/flag_analytics.py
index 23dc8c2ec738..ccf047af9550 100644
--- a/products/feature_flags/backend/flag_analytics.py
+++ b/products/feature_flags/backend/flag_analytics.py
@@ -5,6 +5,7 @@ from uuid import UUID
from django.conf import settings
from django.core.cache import cache
+from django.db import transaction
from django.db.models import Q
from posthog.clickhouse.client import sync_execute
@@ -275,10 +276,13 @@ def find_flags_with_enriched_analytics(begin: datetime, end: datetime):
try:
flag = FeatureFlag.objects.get(team__project_id=team.project_id, key=flag_key)
if not flag.has_enriched_analytics:
- flag.has_enriched_analytics = True
- flag.save()
- if flag.usage_dashboard and not flag.usage_dashboard_has_enriched_insights:
- add_enriched_insights_to_feature_flag_dashboard(flag, flag.usage_dashboard)
+ # A failed enrichment rolls back the flag update, so the next run retries this
+ # flag instead of skipping it as already enriched.
+ with transaction.atomic():
+ flag.has_enriched_analytics = True
+ flag.save()
+ if flag.usage_dashboard and not flag.usage_dashboard_has_enriched_insights:
+ add_enriched_insights_to_feature_flag_dashboard(flag, flag.usage_dashboard)
except FeatureFlag.DoesNotExist:
pass
except Exception as e:
diff --git a/products/feature_flags/frontend/generated/api.schemas.ts b/products/feature_flags/frontend/generated/api.schemas.ts
index a243901f07ee..842bf875880d 100644
--- a/products/feature_flags/frontend/generated/api.schemas.ts
+++ b/products/feature_flags/frontend/generated/api.schemas.ts
@@ -648,7 +648,7 @@ export interface FeatureFlagApi {
tags?: unknown[]
evaluation_contexts?: unknown[]
/**
- * Legacy dashboard of saved usage insights for this flag, or null if it has none. New flags show usage charts inline instead. The dashboard creation endpoint is deprecated and will be removed after September 25, 2026.
+ * Legacy dashboard of saved usage insights for this flag, or null if it has none. Usage charts are on the flag's Usage tab. The API does not create these dashboards.
* @nullable
*/
readonly usage_dashboard: number | null
diff --git a/products/model_crossing_uses_baseline.txt b/products/model_crossing_uses_baseline.txt
index 37d8f4d4875b..2a12250a19cd 100644
--- a/products/model_crossing_uses_baseline.txt
+++ b/products/model_crossing_uses_baseline.txt
@@ -639,7 +639,6 @@ product_analytics:backend/hogql_queries/ products.endpoints.backend.tests.test_i
product_analytics:backend/hogql_queries/ products.endpoints.backend.tests.test_materialization_suggestion drives(TrendsQuery) 1
product_analytics:backend/hogql_queries/ products.endpoints.backend.tests.test_openapi_spec drives(TrendsQuery) 4
product_analytics:backend/hogql_queries/ products.endpoints.backend.tests.test_variable_materialization drives(TrendsQuery) 1
-product_analytics:backend/hogql_queries/ products.feature_flags.backend.api.test.test_feature_flag drives(TrendsQuery) 6
product_analytics:backend/hogql_queries/ products.posthog_ai.scripts.hogql_example.test.test_hogql_example drives(TrendsQuery) 3
product_analytics:backend/hogql_queries/ products.signals.backend.test.test_scout_report_api drives(TrendsQuery) 1
product_analytics:backend/hogql_queries/ products.tasks.backend.tests.test_api drives(TrendsQuery) 3
@@ -1015,7 +1014,6 @@ web_analytics:backend/hogql_queries/ products.endpoints.backend.tests.test_insig
web_analytics:backend/hogql_queries/ products.endpoints.backend.tests.test_materialization_suggestion drives(TrendsQuery) 1
web_analytics:backend/hogql_queries/ products.endpoints.backend.tests.test_openapi_spec drives(TrendsQuery) 4
web_analytics:backend/hogql_queries/ products.endpoints.backend.tests.test_variable_materialization drives(TrendsQuery) 1
-web_analytics:backend/hogql_queries/ products.feature_flags.backend.api.test.test_feature_flag drives(TrendsQuery) 6
web_analytics:backend/hogql_queries/ products.posthog_ai.scripts.hogql_example.test.test_hogql_example drives(TrendsQuery) 3
web_analytics:backend/hogql_queries/ products.product_analytics.backend.hogql_queries.trends.test.test_trends_data_warehouse_query drives(TrendsQuery) 23
web_analytics:backend/hogql_queries/ products.product_analytics.backend.hogql_queries.trends.test.test_trends_query_runner drives(TrendsQuery) 2
diff --git a/services/mcp/src/api/generated.ts b/services/mcp/src/api/generated.ts
index b9b16721094d..88a9e78f2ff5 100644
--- a/services/mcp/src/api/generated.ts
+++ b/services/mcp/src/api/generated.ts
@@ -50442,7 +50442,7 @@ export namespace Schemas {
tags?: unknown[];
evaluation_contexts?: unknown[];
/**
- * Legacy dashboard of saved usage insights for this flag, or null if it has none. New flags show usage charts inline instead. The dashboard creation endpoint is deprecated and will be removed after September 25, 2026.
+ * Legacy dashboard of saved usage insights for this flag, or null if it has none. Usage charts are on the flag's Usage tab. The API does not create these dashboards.
* @nullable
*/
readonly usage_dashboard: number | null;
@@ -50833,18 +50833,6 @@ export namespace Schemas {
conditions: FeatureFlagConditionAnalysis[];
}
- export interface FeatureFlagUsageDashboardError {
- /** Whether the usage dashboard operation completed successfully. */
- success: boolean;
- /** Why the usage dashboard operation failed. */
- error: string;
- }
-
- export interface FeatureFlagUsageDashboardSuccess {
- /** Whether the usage dashboard operation completed successfully. */
- success: boolean;
- }
-
export type FeatureFlagVersionResponseFilters = { [key: string]: unknown };
/**