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(tracing): gate a placeholder behind tracing-ui-v2 (#103610)

Jon McCallumb510593602d5
diff --git a/docs/published/handbook/engineering/conventions/frontend-coding.md b/docs/published/handbook/engineering/conventions/frontend-coding.md
index 65a40b8b2f8a..f33cb23ccb08 100644
--- a/docs/published/handbook/engineering/conventions/frontend-coding.md
+++ b/docs/published/handbook/engineering/conventions/frontend-coding.md
@@ -15,6 +15,7 @@ Hence the explicit separation between the data and view layers.
#### General tips
+- The `tracing-ui-v2` feature flag replaces the tracing scene with a `Tracing UI v2` placeholder for targeted testing. When the flag is off or unavailable, the existing tracing UI remains unchanged.
- Think data first: get [your mental model of the data flowing through the app](https://acco.io/i-escaped-node) right, and then everything else will be simpler.
- Be practical, yet remember that you are balancing speed of delivery with ease of maintainability. If you have to choose: code should be easier to understand than it was to write.
diff --git a/frontend/src/lib/constants.tsx b/frontend/src/lib/constants.tsx
index 24eab90b52a5..aa265f2f15b4 100644
--- a/frontend/src/lib/constants.tsx
+++ b/frontend/src/lib/constants.tsx
@@ -528,6 +528,7 @@ export const FEATURE_FLAGS = {
TRACING_OPERATIONS_VIEW: 'tracing-operations-view', // owner: #team-apm — gates the Operations (per-operation aggregate) tab in tracing
TRACING_SAVED_VIEWS: 'tracing-saved-views', // owner: #team-apm — gates saved views (saved filter sets) in tracing
TRACING_SESSION_PERSON_LINKS: 'tracing-session-person-links', // owner: #team-apm — gates span attribute links to session replay and persons, plus the tracing correlation settings
+ TRACING_UI_V2: 'tracing-ui-v2',
TRAFFIC_TYPE_VIRTUAL_PROPERTIES: 'traffic-type-virtual-properties', // owner: #team-web-analytics
UI_CUSTOMIZATION: 'ui-customization-enabled', // owner: @fercgomes #team-self-driving, gates sidebar/homepage UI customization
UNIFIED_APM_PRODUCT: 'unified-apm-product', // owner: #team-apm (@jonmcwest, @frankh), gates the shared APM product backing logs, tracing, and metrics
diff --git a/products/tracing/frontend/TracingScene.tsx b/products/tracing/frontend/TracingScene.tsx
index 88d6adfaec27..b494f27d18bc 100644
--- a/products/tracing/frontend/TracingScene.tsx
+++ b/products/tracing/frontend/TracingScene.tsx
@@ -48,12 +48,17 @@ export const scene: SceneExport = {
}
export default function TracingScene(): JSX.Element {
+ const { featureFlags } = useValues(featureFlagLogic)
const sceneLogic = tracingSceneLogic()
// Keep filters + data + viewer logic alive across React unmounts by attaching them to the scene root.
useAttachedLogic(tracingFiltersLogic({ id: TRACING_SCENE_VIEWER_ID }), sceneLogic)
useAttachedLogic(tracingDataLogic({ id: TRACING_SCENE_VIEWER_ID }), sceneLogic)
useAttachedLogic(tracingViewerLogic({ id: TRACING_SCENE_VIEWER_ID }), sceneLogic)
+ if (featureFlags[FEATURE_FLAGS.TRACING_UI_V2]) {
+ return <p>Tracing UI v2</p>
+ }
+
// Bind the scene's keyed instances so nested components (filter bar, sparkline, ...)
// resolve them from context — the same components work inside an embedded viewer
// bound to a different id.