: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
feat(experiments): rename query performance scene to experiments staff tools (#85183)
Juraj Majerik3174e48d98b1
diff --git a/.agents/skills/analyzing-experiment-query-performance/SKILL.md b/.agents/skills/analyzing-experiment-query-performance/SKILL.mdindex 880cdfe2c330..ae57c979373b 100644--- a/.agents/skills/analyzing-experiment-query-performance/SKILL.md+++ b/.agents/skills/analyzing-experiment-query-performance/SKILL.md@@ -2,7 +2,7 @@name: analyzing-experiment-query-performancedescription: >Pull and interpret production experiment query-performance data from the staff-only- `/api/debug_ch_queries` endpoints backing the `/instance/query_performance` scene:+ `/api/debug_ch_queries` endpoints backing the `/experiments/staff` scene:slowest experiment queries, precompute read/build health, and preaggregation cache footprint.Covers prod-US and prod-EU via a `query_performance:read` personal API key, all query params,and response field semantics (exception codes, exposure paths, precompute skip reasons, job states).@@ -13,7 +13,7 @@ description: ># Analyzing experiment query performance-The `/instance/query_performance` scene (staff-only UI) is backed by three GET endpoints+The `/experiments/staff` scene (staff-only UI, "Experiments staff tools") is backed by three GET endpointsthat are also callable directly with a personal API key.They return the exact data the UI renders, sourced from ClickHouse `query_log_archive`(experiment queries only, `lc_product = 'experiments'`), `system.parts`,@@ -247,7 +247,7 @@ re-check the key's scopes before anything else.## Maintenance-This skill documents the `/instance/query_performance` API surface.+This skill documents the `/experiments/staff` API surface.When adding a tab, endpoint, filter, or response field to the scene-(`posthog/api/debug_ch_queries.py` + `frontend/src/scenes/instance/QueryPerformance/`),+(`posthog/api/debug_ch_queries.py` + `frontend/src/scenes/experiments/staff/`),update this file in the same PR.diff --git a/frontend/src/lib/components/Account/NewAccountMenu.tsx b/frontend/src/lib/components/Account/NewAccountMenu.tsxindex 73e77e2a4f99..90c0659296e5 100644--- a/frontend/src/lib/components/Account/NewAccountMenu.tsx+++ b/frontend/src/lib/components/Account/NewAccountMenu.tsx@@ -417,14 +417,15 @@ export function NewAccountMenu({ isLayoutNavCollapsed }: AccountMenuProps): JSX.render={(props) => (<Link{...props}- to={urls.queryPerformance()}+ to={urls.experimentsStaffTools()}buttonProps={{menuItem: true,}}+ // Stable autocapture contract: name stays query-performance even though the label and route are now experiments staff toolsdata-attr="new-account-menu-query-performance"><IconDatabase />- Query performance+ Experiments staff tools</Link>)}/>diff --git a/frontend/src/lib/utils/kea-router.test.ts b/frontend/src/lib/utils/kea-router.test.tsindex 89d9e9aa6066..62545ef1b7eb 100644--- a/frontend/src/lib/utils/kea-router.test.ts+++ b/frontend/src/lib/utils/kea-router.test.ts@@ -29,6 +29,10 @@ describe('router-utils', () => {const altered = addProjectIdIfMissing('/feature_flags/123', 123)expect(altered).toEqual('/project/123/feature_flags/123')})+ it('does not redirect the experiments staff tools URL to a project URL', () => {+ const altered = addProjectIdIfMissing('/experiments/staff', 123)+ expect(altered).toEqual('/experiments/staff')+ })it('does not redirect the cohorts staff tools URL nested under feature flags staff', () => {const altered = addProjectIdIfMissing('/feature_flags/staff/cohorts', 123)expect(altered).toEqual('/feature_flags/staff/cohorts')diff --git a/frontend/src/lib/utils/kea-router.ts b/frontend/src/lib/utils/kea-router.tsindex d8f692eac9d3..3958301934ff 100644--- a/frontend/src/lib/utils/kea-router.ts+++ b/frontend/src/lib/utils/kea-router.ts@@ -25,7 +25,7 @@ const pathsWithoutProjectId = [// The startsWith(exactPath + '/') check below also exempts nested staff tools from// other products, e.g. the cohorts staff tools at /feature_flags/staff/cohorts —// renaming this path affects them too.-const exactPathsWithoutProjectId = ['/feature_flags/staff']+const exactPathsWithoutProjectId = ['/feature_flags/staff', '/experiments/staff']const projectIdentifierInUrlRegex = /^\/project\/(\d+|phc_)/diff --git a/frontend/src/scenes/appScenes.ts b/frontend/src/scenes/appScenes.tsindex d476f358340c..e54281f7227f 100644--- a/frontend/src/scenes/appScenes.ts+++ b/frontend/src/scenes/appScenes.ts@@ -28,7 +28,6 @@ export const appScenes: Record<Scene | string, () => any> = {[Scene.DataPipelinesNew]: () => import('./data-pipelines/DataPipelinesNewScene'),[Scene.DataOps]: () => import('./data-warehouse/DataWarehouseScene'),[Scene.DeadLetterQueue]: () => import('./instance/DeadLetterQueue/DeadLetterQueue'),- [Scene.QueryPerformance]: () => import('./instance/QueryPerformance/QueryPerformance'),[Scene.Destinations]: () => import('./data-pipelines/DestinationsScene'),[Scene.DebugHog]: () => import('./debug/hog/HogRepl'),[Scene.DebugQuery]: () => import('./debug/DebugScene'),@@ -41,6 +40,7 @@ export const appScenes: Record<Scene | string, () => any> = {[Scene.Experiment]: () => import('./experiments/Experiment'),[Scene.ExperimentsSharedMetric]: () => import('./experiments/SharedMetrics/SharedMetric'),[Scene.ExperimentsSharedMetrics]: () => import('./experiments/SharedMetrics/SharedMetrics'),+ [Scene.ExperimentsStaffTools]: () => import('./experiments/staff/ExperimentsStaffTools'),[Scene.Experiments]: () => import('./experiments/Experiments'),[Scene.ExploreEvents]: () => import('./activity/explore/EventsScene'),[Scene.ExploreSessions]: () => import('./activity/explore/SessionsScene'),diff --git a/frontend/src/scenes/instance/QueryPerformance/CacheHealth.tsx b/frontend/src/scenes/experiments/staff/CacheHealth.tsxsimilarity index 100%rename from frontend/src/scenes/instance/QueryPerformance/CacheHealth.tsxrename to frontend/src/scenes/experiments/staff/CacheHealth.tsxdiff --git a/frontend/src/scenes/instance/QueryPerformance/QueryPerformance.tsx b/frontend/src/scenes/experiments/staff/ExperimentsStaffTools.tsxsimilarity index 98%rename from frontend/src/scenes/instance/QueryPerformance/QueryPerformance.tsxrename to frontend/src/scenes/experiments/staff/ExperimentsStaffTools.tsxindex 1eba7e3029a6..10a9c81f33d0 100644--- a/frontend/src/scenes/instance/QueryPerformance/QueryPerformance.tsx+++ b/frontend/src/scenes/experiments/staff/ExperimentsStaffTools.tsx@@ -26,7 +26,7 @@ import { PrecomputeOverview } from './PrecomputeOverview'import { PrecomputationTeam, queryPerformanceLogic, SlowestQuery } from './queryPerformanceLogic'export const scene: SceneExport = {- component: QueryPerformance,+ component: ExperimentsStaffTools,logic: queryPerformanceLogic,}@@ -145,7 +145,7 @@ function QueryStats({)}-export function QueryPerformance(): JSX.Element {+export function ExperimentsStaffTools(): JSX.Element {const { user } = useValues(userLogic)const {precomputationTeams,@@ -176,15 +176,15 @@ export function QueryPerformance(): JSX.Element {return (<><SceneTitleSection- name="Query performance"- description="Internal tooling for monitoring and managing query performance across all projects."+ name="Experiments staff tools"+ description="Internal tooling for monitoring and managing experiment query performance across all projects."resourceType={{type: 'query_performance',forceIcon: <IconDatabase />,}}/><p>- Only users with staff access can view query performance tooling. Please contact your instance admin.+ Only users with staff access can view experiments staff tools. Please contact your instance admin.</p><p>If you're an admin and don't have access, set <code>is_staff=true</code> for your user on the@@ -493,8 +493,8 @@ export function QueryPerformance(): JSX.Element {return (<SceneContent className="mt-4 pb-8"><SceneTitleSection- name="Query performance"- description="Internal tooling for monitoring and managing query performance across all projects."+ name="Experiments staff tools"+ description="Internal tooling for monitoring and managing experiment query performance across all projects."resourceType={{type: 'query_performance',forceIcon: <IconDatabase />,diff --git a/frontend/src/scenes/instance/QueryPerformance/PrecomputeOverview.tsx b/frontend/src/scenes/experiments/staff/PrecomputeOverview.tsxsimilarity index 100%rename from frontend/src/scenes/instance/QueryPerformance/PrecomputeOverview.tsxrename to frontend/src/scenes/experiments/staff/PrecomputeOverview.tsxdiff --git a/frontend/src/scenes/instance/QueryPerformance/PrecomputeTrends.tsx b/frontend/src/scenes/experiments/staff/PrecomputeTrends.tsxsimilarity index 100%rename from frontend/src/scenes/instance/QueryPerformance/PrecomputeTrends.tsxrename to frontend/src/scenes/experiments/staff/PrecomputeTrends.tsxdiff --git a/frontend/src/scenes/instance/QueryPerformance/queryPerformanceLogic.ts b/frontend/src/scenes/experiments/staff/queryPerformanceLogic.tssimilarity index 99%rename from frontend/src/scenes/instance/QueryPerformance/queryPerformanceLogic.tsrename to frontend/src/scenes/experiments/staff/queryPerformanceLogic.tsindex 6b547e6c27e2..533dbf634a29 100644--- a/frontend/src/scenes/instance/QueryPerformance/queryPerformanceLogic.ts+++ b/frontend/src/scenes/experiments/staff/queryPerformanceLogic.ts@@ -360,7 +360,7 @@ export type queryPerformanceLogicType = MakeLogicType<>export const queryPerformanceLogic = kea<queryPerformanceLogicType>([- path(['scenes', 'instance', 'QueryPerformance', 'queryPerformanceLogic']),+ path(['scenes', 'experiments', 'staff', 'queryPerformanceLogic']),actions({setSearch: (search: string) => ({ search }),setPrecomputation: (teamId: number, enabled: boolean) => ({ teamId, enabled }),diff --git a/frontend/src/scenes/owners.yaml b/frontend/src/scenes/owners.yamlindex 4d3e135d2738..26d30ecebe04 100644--- a/frontend/src/scenes/owners.yaml+++ b/frontend/src/scenes/owners.yaml@@ -51,8 +51,6 @@ rules:owners: team-product-analytics- match: '/instance/'owners: team-growth- - match: '/instance/QueryPerformance/'- owners: team-experiments- match: '/marketing-analytics/'owners: team-web-analytics- match: '/max/'diff --git a/frontend/src/scenes/sceneTypes.ts b/frontend/src/scenes/sceneTypes.tsindex b326cc1091fc..5d9b7740d803 100644--- a/frontend/src/scenes/sceneTypes.ts+++ b/frontend/src/scenes/sceneTypes.ts@@ -69,6 +69,7 @@ export enum Scene {Subscription = 'Subscription',ExperimentsSharedMetric = 'ExperimentsSharedMetric',ExperimentsSharedMetrics = 'ExperimentsSharedMetrics',+ ExperimentsStaffTools = 'ExperimentsStaffTools',ExploreEvents = 'ExploreEvents',ExploreSessions = 'ExploreSessions',FeatureFlag = 'FeatureFlag',@@ -137,7 +138,6 @@ export enum Scene {PropertyDefinition = 'PropertyDefinition',PropertyDefinitions = 'PropertyDefinitions',PropertyDefinitionEdit = 'PropertyDefinitionEdit',- QueryPerformance = 'QueryPerformance',Replay = 'Replay',ReplayFilePlayback = 'ReplayFilePlayback',ReplayPlaylist = 'ReplayPlaylist',diff --git a/frontend/src/scenes/scenes.ts b/frontend/src/scenes/scenes.tsindex f1aa7ee07413..3ba698bdbf31 100644--- a/frontend/src/scenes/scenes.ts+++ b/frontend/src/scenes/scenes.ts@@ -146,7 +146,7 @@ export const sceneConfigurations: Record<Scene | string, SceneConfig> = {activityScope: ActivityScope.HOG_FUNCTION,},[Scene.DeadLetterQueue]: { instanceLevel: true },- [Scene.QueryPerformance]: { instanceLevel: true, name: 'Query performance' },+ [Scene.ExperimentsStaffTools]: { instanceLevel: true, name: 'Experiments staff tools' },[Scene.Destinations]: {projectBased: true,name: 'Destinations',@@ -680,6 +680,7 @@ export const redirects: Record<'/feature-flags/:id': ({ id }) => urls.featureFlag(id),'/i/:shortId': ({ shortId }) => urls.insightView(shortId),'/instance': urls.instanceStatus(),+ '/instance/query_performance': urls.experimentsStaffTools(),'/me/settings': urls.settings('user'),'/new': urls.newTab(),'/live-debugger': urls.liveDebugger(),@@ -807,6 +808,8 @@ export const routes: Record<string, [Scene | string, string]> = {[urls.cohortCalculationHistory(':id')]: [Scene.CohortCalculationHistory, 'cohortCalculationHistory'],[urls.cohorts()]: [Scene.Cohorts, 'cohorts'],[urls.experiments()]: [Scene.Experiments, 'experiments'],+ // Must come before the parameterized /experiments/:id route+ [urls.experimentsStaffTools()]: [Scene.ExperimentsStaffTools, 'experimentsStaffTools'],[urls.experimentsSharedMetrics()]: [Scene.ExperimentsSharedMetrics, 'experimentsSharedMetrics'],[urls.experimentsSharedMetric(':id')]: [Scene.ExperimentsSharedMetric, 'experimentsSharedMetric'],[urls.experimentsSharedMetric(':id', ':action')]: [Scene.ExperimentsSharedMetric, 'experimentsSharedMetric'],@@ -853,7 +856,6 @@ export const routes: Record<string, [Scene | string, string]> = {[urls.webScriptsNew()]: [Scene.DataPipelinesNew, 'webScriptsNew'],[urls.asyncMigrationsSettings()]: [Scene.AsyncMigrations, 'asyncMigrationsSettings'],[urls.deadLetterQueue()]: [Scene.DeadLetterQueue, 'deadLetterQueue'],- [urls.queryPerformance()]: [Scene.QueryPerformance, 'queryPerformance'],[urls.destinations()]: [Scene.Destinations, 'destinations'],[urls.materializedColumns()]: [Scene.MaterializedColumns, 'materializedColumns'],[urls.models()]: [Scene.Models, 'models'],diff --git a/frontend/src/scenes/urls.ts b/frontend/src/scenes/urls.tsindex 96021dd3ebbc..34b5d7c2d78f 100644--- a/frontend/src/scenes/urls.ts+++ b/frontend/src/scenes/urls.ts@@ -263,7 +263,7 @@ export const urls = {asyncMigrationsFuture: (): string => '/instance/async_migrations/future',asyncMigrationsSettings: (): string => '/instance/async_migrations/settings',deadLetterQueue: (): string => '/instance/dead_letter_queue',- queryPerformance: (): string => '/instance/query_performance',+ experimentsStaffTools: (): string => '/experiments/staff',materializedColumns: (): string => '/data-management/materialized-columns',unsubscribe: (): string => '/unsubscribe',codeCanvasLink: (channelId: string, dashboardId: string): string => `/code/canvas/${channelId}/${dashboardId}`,