Skip to content

🪢 Open source agent evals & observability: Trace, evaluate, and improve LLM applications with one open platform.

feat(dashboard): allow filtering by observation name (#6511)

Steffen Schmitz2d4708921c67
diff --git a/web/src/features/query/dashboardUiTableToViewMapping.ts b/web/src/features/query/dashboardUiTableToViewMapping.ts
index a0c9b565ae..46d320c21d 100644
--- a/web/src/features/query/dashboardUiTableToViewMapping.ts
+++ b/web/src/features/query/dashboardUiTableToViewMapping.ts
@@ -10,6 +10,10 @@ const viewMappings: Record<z.infer<typeof views>, Record<string, string>[]> = {
uiTableName: "Trace Name",
viewName: "name",
},
+ {
+ uiTableName: "Observation Name",
+ viewName: "observationName",
+ },
{
uiTableName: "Tags",
viewName: "tags",
@@ -40,6 +44,10 @@ const viewMappings: Record<z.infer<typeof views>, Record<string, string>[]> = {
uiTableName: "Trace Name",
viewName: "traceName",
},
+ {
+ uiTableName: "Observation Name",
+ viewName: "name",
+ },
{
uiTableName: "User",
viewName: "userId",
@@ -106,6 +114,10 @@ const viewMappings: Record<z.infer<typeof views>, Record<string, string>[]> = {
uiTableName: "Trace Name",
viewName: "traceName",
},
+ {
+ uiTableName: "Observation Name",
+ viewName: "observationName",
+ },
{
uiTableName: "Release",
viewName: "traceRelease",
@@ -148,6 +160,10 @@ const viewMappings: Record<z.infer<typeof views>, Record<string, string>[]> = {
uiTableName: "Trace Name",
viewName: "traceName",
},
+ {
+ uiTableName: "Observation Name",
+ viewName: "observationName",
+ },
{
uiTableName: "Release",
viewName: "traceRelease",
@@ -170,6 +186,12 @@ const isLegacyUiTableFilter = (
clickhouseTableName: "traces",
clickhouseSelect: 't."sessionId"',
},
+ {
+ uiTableName: "Observation Name",
+ uiTableId: "observationName",
+ clickhouseTableName: "observations",
+ clickhouseSelect: 'o."name"',
+ },
])
.some((columnDef) => columnDef.uiTableName === filter.column);
};
diff --git a/web/src/features/query/dataModel.ts b/web/src/features/query/dataModel.ts
index a420c492c0..7ec04609d9 100644
--- a/web/src/features/query/dataModel.ts
+++ b/web/src/features/query/dataModel.ts
@@ -45,6 +45,12 @@ export const traceView: ViewDeclarationType = {
sql: "environment",
type: "string",
},
+ observationName: {
+ sql: "name",
+ alias: "observationName",
+ type: "string",
+ relationTable: "observations",
+ },
},
measures: {
count: {
diff --git a/web/src/features/widgets/components/WidgetForm.tsx b/web/src/features/widgets/components/WidgetForm.tsx
index 4a39e94aef..66c67368e8 100644
--- a/web/src/features/widgets/components/WidgetForm.tsx
+++ b/web/src/features/widgets/components/WidgetForm.tsx
@@ -161,6 +161,12 @@ export function WidgetForm({
options: nameOptions,
internal: "internalValue",
},
+ {
+ name: "Observation Name",
+ id: "observationName",
+ type: "string",
+ internal: "internalValue",
+ },
{
name: "Tags",
id: "tags",
diff --git a/web/src/pages/project/[projectId]/dashboards/[dashboardId]/index.tsx b/web/src/pages/project/[projectId]/dashboards/[dashboardId]/index.tsx
index 8825e7217d..bd0556da66 100644
--- a/web/src/pages/project/[projectId]/dashboards/[dashboardId]/index.tsx
+++ b/web/src/pages/project/[projectId]/dashboards/[dashboardId]/index.tsx
@@ -127,6 +127,12 @@ export default function DashboardDetail() {
options: nameOptions,
internal: "internalValue",
},
+ {
+ name: "Observation Name",
+ id: "observationName",
+ type: "string",
+ internal: "internalValue",
+ },
{
name: "Tags",
id: "tags",