🪢 Open source agent evals & observability: Trace, evaluate, and improve LLM applications with one open platform.
TypeScript analyticsautogenevaluationlangchainlarge-language-modelsllama-indexllmllm-evaluationllm-observabilityllmopsmonitoringobservabilityopen-sourceopenaiplaygroundprompt-engineeringprompt-managementself-hostedycombinator
refactor(web): move observations table into features/tracing-tables (#17421)
Nikita Kabardin782dd4a29cfc
diff --git a/web/src/features/evals/components/inner-evaluator-form.tsx b/web/src/features/evals/components/inner-evaluator-form.tsxindex b819978e02..d5477c61de 100644--- a/web/src/features/evals/components/inner-evaluator-form.tsx+++ b/web/src/features/evals/components/inner-evaluator-form.tsx@@ -123,8 +123,10 @@ import { PeekTableStateProvider } from "@/src/components/table/peek/contexts/Pee// Lazy load tablesconst TracesTable = lazy(() => import("@/src/features/traces/TracesTable"));-const ObservationsTable = lazy(- () => import("@/src/components/table/use-cases/observations"),+const ObservationsTable = lazy(() =>+ import("@/src/features/tracing-tables").then((m) => ({+ default: m.ObservationsTable,+ })),);const EventsTable = lazy(diff --git a/web/src/features/prompts/components/prompt-detail.tsx b/web/src/features/prompts/components/prompt-detail.tsxindex 2e4f29afa9..1df739a4e9 100644--- a/web/src/features/prompts/components/prompt-detail.tsx+++ b/web/src/features/prompts/components/prompt-detail.tsx@@ -35,7 +35,7 @@ import {import { PromptHistoryNode } from "./prompt-history";import { JumpToPlaygroundDropdownMenuController } from "@/src/features/playground/page/components/JumpToPlaygroundDropdownMenuController";import { ChatMlArraySchema } from "@/src/components/schemas/ChatMlSchema";-import LegacyGenerations from "@/src/components/table/use-cases/observations";+import { ObservationsTable as LegacyGenerations } from "@/src/features/tracing-tables";import EventsTable from "@/src/features/events/components/EventsTable";import { useReadPath } from "@/src/features/events";import {diff --git a/web/src/features/tracing-tables/README.md b/web/src/features/tracing-tables/README.mdindex c164448aa8..03e8c8ac98 100644--- a/web/src/features/tracing-tables/README.md+++ b/web/src/features/tracing-tables/README.md@@ -29,7 +29,7 @@ traces), following the local-store pattern from## Status / Remaining Spread-`ObservationsTable` (`web/src/components/table/use-cases/observations.tsx`)+`ObservationsTable` (`observations/ObservationsTable.tsx`)is still a controller component: inline column building, query-state assemblyfrom multiple hooks, and data preparation in render. Per the 2026-06 decision,the legacy observations page is frozen (bugfix-only); the filtering/searchdiff --git a/web/src/features/tracing-tables/index.ts b/web/src/features/tracing-tables/index.tsnew file mode 100644index 0000000000..fb24b416b3--- /dev/null+++ b/web/src/features/tracing-tables/index.ts@@ -0,0 +1,4 @@+// Tracing-tables front door — selection stores + legacy ObservationsTable.+// ObservationsPage is deliberately absent: the Next.js route imports it+// directly (same pattern as TracePage / SessionsPage).+export { default as ObservationsTable } from "@/src/features/tracing-tables/observations/ObservationsTable";diff --git a/web/src/features/tracing-tables/observations/ObservationsPage.tsx b/web/src/features/tracing-tables/observations/ObservationsPage.tsxnew file mode 100644index 0000000000..7854613617--- /dev/null+++ b/web/src/features/tracing-tables/observations/ObservationsPage.tsx@@ -0,0 +1,87 @@+/* eslint-disable no-nested-ternary */+import { useRouter } from "next/router";+import { ObservationsTable } from "@/src/features/tracing-tables";+import Page from "@/src/components/layouts/page";+import { api } from "@/src/utils/api";+import { TracesOnboarding } from "@/src/components/onboarding/TracesOnboarding";+import {+ getTracingTabs,+ TRACING_TABS,+} from "@/src/features/navigation/utils/tracing-tabs";+import { useReadPath } from "@/src/features/events/hooks/useReadPath";+import ObservationsEventsTable from "@/src/features/events/components/EventsTable";+import { useQueryProject } from "@/src/features/projects/hooks";+import { V4MigrationDelayBadge } from "@/src/features/v4-migration/V4MigrationDelayBadge";++export default function ObservationsPage() {+ const router = useRouter();+ const projectId = router.query.projectId as string;+ const { isV4, isResolved } = useReadPath();+ const { project } = useQueryProject();++ // Check if the user has tracing configured+ // Skip polling entirely if the project flag is already set in the session+ const { data: hasTracingConfigured, isLoading } =+ api.traces.hasTracingConfigured.useQuery(+ { projectId },+ {+ enabled: !!projectId,+ trpc: {+ context: {+ skipBatch: true,+ },+ },+ refetchInterval: project?.hasTraces ? false : 10_000,+ initialData: project?.hasTraces ? true : undefined,+ staleTime: project?.hasTraces ? Infinity : 0,+ },+ );++ const showOnboarding = !isLoading && !hasTracingConfigured;++ return (+ <Page+ headerProps={{+ title: "Tracing",+ // Match traces/index.tsx: no delay badge while onboarding tells the+ // user to set up tracing for the first time.+ titleBadges: showOnboarding ? undefined : (+ <V4MigrationDelayBadge page="observations" />+ ),+ help: {+ description:+ "An observation captures a single function call in an application. See docs to learn more.",+ href: "https://langfuse.com/docs/observability/data-model",+ },+ tabsProps:+ isV4 || !isResolved+ ? undefined+ : {+ tabs: getTracingTabs(projectId),+ activeTab: TRACING_TABS.OBSERVATIONS,+ },+ }}+ scrollable={showOnboarding}+ >+ {/* Show onboarding screen if user has no traces */}+ {showOnboarding ? (+ <TracesOnboarding projectId={projectId} />+ ) : !isResolved ? (+ <>+ {/* Wait for the beta flag before mounting either table. Otherwise the+ legacy table can briefly mount, restore a v3 saved view, and+ promote its viewId into the URL before the correct mode+ resolves. */}+ </>+ ) : isV4 ? (+ <ObservationsEventsTable+ projectId={projectId}+ showControlsInPageHeader+ enableAppRootDefault+ />+ ) : (+ <ObservationsTable projectId={projectId} showControlsInPageHeader />+ )}+ </Page>+ );+}diff --git a/web/src/components/table/use-cases/observations.tsx b/web/src/features/tracing-tables/observations/ObservationsTable.tsxsimilarity index 100%rename from web/src/components/table/use-cases/observations.tsxrename to web/src/features/tracing-tables/observations/ObservationsTable.tsxdiff --git a/web/src/pages/project/[projectId]/observations/index.tsx b/web/src/pages/project/[projectId]/observations/index.tsxindex e3562e9341..f389fbe81e 100644--- a/web/src/pages/project/[projectId]/observations/index.tsx+++ b/web/src/pages/project/[projectId]/observations/index.tsx@@ -1,87 +1 @@-/* eslint-disable no-nested-ternary */-import { useRouter } from "next/router";-import ObservationsTable from "@/src/components/table/use-cases/observations";-import Page from "@/src/components/layouts/page";-import { api } from "@/src/utils/api";-import { TracesOnboarding } from "@/src/components/onboarding/TracesOnboarding";-import {- getTracingTabs,- TRACING_TABS,-} from "@/src/features/navigation/utils/tracing-tabs";-import { useReadPath } from "@/src/features/events/hooks/useReadPath";-import ObservationsEventsTable from "@/src/features/events/components/EventsTable";-import { useQueryProject } from "@/src/features/projects/hooks";-import { V4MigrationDelayBadge } from "@/src/features/v4-migration/V4MigrationDelayBadge";--export default function Generations() {- const router = useRouter();- const projectId = router.query.projectId as string;- const { isV4, isResolved } = useReadPath();- const { project } = useQueryProject();-- // Check if the user has tracing configured- // Skip polling entirely if the project flag is already set in the session- const { data: hasTracingConfigured, isLoading } =- api.traces.hasTracingConfigured.useQuery(- { projectId },- {- enabled: !!projectId,- trpc: {- context: {- skipBatch: true,- },- },- refetchInterval: project?.hasTraces ? false : 10_000,- initialData: project?.hasTraces ? true : undefined,- staleTime: project?.hasTraces ? Infinity : 0,- },- );-- const showOnboarding = !isLoading && !hasTracingConfigured;-- return (- <Page- headerProps={{- title: "Tracing",- // Match traces/index.tsx: no delay badge while onboarding tells the- // user to set up tracing for the first time.- titleBadges: showOnboarding ? undefined : (- <V4MigrationDelayBadge page="observations" />- ),- help: {- description:- "An observation captures a single function call in an application. See docs to learn more.",- href: "https://langfuse.com/docs/observability/data-model",- },- tabsProps:- isV4 || !isResolved- ? undefined- : {- tabs: getTracingTabs(projectId),- activeTab: TRACING_TABS.OBSERVATIONS,- },- }}- scrollable={showOnboarding}- >- {/* Show onboarding screen if user has no traces */}- {showOnboarding ? (- <TracesOnboarding projectId={projectId} />- ) : !isResolved ? (- <>- {/* Wait for the beta flag before mounting either table. Otherwise the- legacy table can briefly mount, restore a v3 saved view, and- promote its viewId into the URL before the correct mode- resolves. */}- </>- ) : isV4 ? (- <ObservationsEventsTable- projectId={projectId}- showControlsInPageHeader- enableAppRootDefault- />- ) : (- <ObservationsTable projectId={projectId} showControlsInPageHeader />- )}- </Page>- );-}+export { default } from "@/src/features/tracing-tables/observations/ObservationsPage";diff --git a/web/src/pages/project/[projectId]/settings/models/[modelId].tsx b/web/src/pages/project/[projectId]/settings/models/[modelId].tsxindex 5caed359d7..a06094d839 100644--- a/web/src/pages/project/[projectId]/settings/models/[modelId].tsx+++ b/web/src/pages/project/[projectId]/settings/models/[modelId].tsx@@ -19,7 +19,7 @@ import Decimal from "decimal.js";import { PriceUnitSelector } from "@/src/features/models/components/PriceUnitSelector";import { useMemo, useState } from "react";import { usePriceUnitMultiplier } from "@/src/features/models/hooks/usePriceUnitMultiplier";-import Generations from "@/src/components/table/use-cases/observations";+import Generations from "@/src/features/tracing-tables/observations/ObservationsTable";import Page from "@/src/components/layouts/page";import { SquareArrowOutUpRight, Info as InfoIcon } from "lucide-react";import {