Skip to content

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

fix(ui): label observation level as Status in tables (#16269)

Nikita Kabardin0613c8e39016
diff --git a/packages/shared/src/eventsTable.ts b/packages/shared/src/eventsTable.ts
index c6b9659f51..3e53078414 100644
--- a/packages/shared/src/eventsTable.ts
+++ b/packages/shared/src/eventsTable.ts
@@ -177,11 +177,12 @@ const eventsTableColsDefinition = [
nullable: true,
},
{
- name: "Level",
+ name: "Status",
id: "level",
type: "stringOptions",
internal: "e.level",
options: [],
+ aliases: ["Level"],
},
{
name: "Status Message",
diff --git a/packages/shared/src/features/evals/observationForEval.ts b/packages/shared/src/features/evals/observationForEval.ts
index 726753e6e7..a993f5bb82 100644
--- a/packages/shared/src/features/evals/observationForEval.ts
+++ b/packages/shared/src/features/evals/observationForEval.ts
@@ -340,11 +340,12 @@ export const observationEvalFilterColumns: ObservationEvalColumnDef[] = [
options: [], // to be filled at runtime
},
{
- name: "Level",
+ name: "Status",
id: "level",
type: "stringOptions",
internal: "level",
options: Object.values(ObservationLevel).map((key) => ({ value: key })),
+ aliases: ["Level"],
},
{
name: "Version",
diff --git a/packages/shared/src/observationsTable.ts b/packages/shared/src/observationsTable.ts
index 477fac2367..2029d9372f 100644
--- a/packages/shared/src/observationsTable.ts
+++ b/packages/shared/src/observationsTable.ts
@@ -117,7 +117,7 @@ export const observationsTableCols: ColumnDefinition[] = [
nullable: true,
},
{
- name: "Level",
+ name: "Status",
id: "level",
type: "stringOptions",
internal: 'o."level"::text',
@@ -127,6 +127,7 @@ export const observationsTableCols: ColumnDefinition[] = [
{ value: "WARNING" },
{ value: "ERROR" },
] as { value: ObservationLevelType }[],
+ aliases: ["Level"],
},
{
name: "Status Message",
diff --git a/packages/shared/src/server/tableMappings/mapEventsTable.ts b/packages/shared/src/server/tableMappings/mapEventsTable.ts
index 1d8a2af501..68088ea4f5 100644
--- a/packages/shared/src/server/tableMappings/mapEventsTable.ts
+++ b/packages/shared/src/server/tableMappings/mapEventsTable.ts
@@ -131,8 +131,9 @@ export const eventsTableNativeUiColumnDefinitions: UiColumnMappings = [
"if(mapExists((k, v) -> (k = 'total'), cost_details), cost_details['total'], NULL)",
},
{
- uiTableName: "Level",
+ uiTableName: "Status",
uiTableId: "level",
+ aliases: ["Level"],
clickhouseTableName: "events_proto",
clickhouseSelect: "level",
queryPrefix: "e",
diff --git a/packages/shared/src/server/tableMappings/mapObservationsTable.ts b/packages/shared/src/server/tableMappings/mapObservationsTable.ts
index 387d30c18a..5e02037b7a 100644
--- a/packages/shared/src/server/tableMappings/mapObservationsTable.ts
+++ b/packages/shared/src/server/tableMappings/mapObservationsTable.ts
@@ -149,8 +149,9 @@ export const observationsTableUiColumnDefinitions: UiColumnMappings = [
"if(mapExists((k, v) -> (k = 'total'), cost_details), cost_details['total'], NULL)",
},
{
- uiTableName: "Level",
+ uiTableName: "Status",
uiTableId: "level",
+ aliases: ["Level"],
clickhouseTableName: "observations",
clickhouseSelect: "level",
queryPrefix: "o",
diff --git a/packages/shared/src/server/tableMappings/mapTracesTable.ts b/packages/shared/src/server/tableMappings/mapTracesTable.ts
index 7001648fc3..6f24af1d5d 100644
--- a/packages/shared/src/server/tableMappings/mapTracesTable.ts
+++ b/packages/shared/src/server/tableMappings/mapTracesTable.ts
@@ -9,8 +9,9 @@ export const tracesTableUiColumnDefinitions: UiColumnMappings = [
clickhouseSelect: "t.bookmarked",
},
{
- uiTableName: "Level",
+ uiTableName: "Status",
uiTableId: "level",
+ aliases: ["Level"],
clickhouseTableName: "observations",
clickhouseSelect: "aggregated_level",
queryPrefix: "o",
diff --git a/packages/shared/src/tableDefinitions/mapDashboards.ts b/packages/shared/src/tableDefinitions/mapDashboards.ts
index 4af9f7eea6..5c1c3ef023 100644
--- a/packages/shared/src/tableDefinitions/mapDashboards.ts
+++ b/packages/shared/src/tableDefinitions/mapDashboards.ts
@@ -73,7 +73,8 @@ export const dashboardColumnDefinitions: UiColumnMappings = [
clickhouseTableName: "observations",
clickhouseSelect: "o.level",
uiTableId: "level",
- uiTableName: "Level",
+ uiTableName: "Status",
+ aliases: ["Level"],
},
{
clickhouseTableName: "traces",
diff --git a/packages/shared/src/tableDefinitions/tracesTable.ts b/packages/shared/src/tableDefinitions/tracesTable.ts
index 5fa16e020c..ee32c13c54 100644
--- a/packages/shared/src/tableDefinitions/tracesTable.ts
+++ b/packages/shared/src/tableDefinitions/tracesTable.ts
@@ -86,7 +86,7 @@ export const tracesOnlyCols: ColumnDefinition[] = [
nullable: true,
},
{
- name: "Level",
+ name: "Status",
id: "level",
type: "stringOptions",
internal: '"level"',
@@ -96,6 +96,7 @@ export const tracesOnlyCols: ColumnDefinition[] = [
{ value: "WARNING" },
{ value: "ERROR" },
] as { value: ObservationLevelType }[],
+ aliases: ["Level"],
},
{
name: "Tags",
diff --git a/web/src/components/table/use-cases/observations.tsx b/web/src/components/table/use-cases/observations.tsx
index fbe1d2f3fb..b84ec2b77c 100644
--- a/web/src/components/table/use-cases/observations.tsx
+++ b/web/src/components/table/use-cases/observations.tsx
@@ -780,7 +780,7 @@ export default function ObservationsTable({
{
accessorKey: "level",
id: "level",
- header: "Level",
+ header: "Status",
size: 100,
headerTooltip: {
description:
diff --git a/web/src/components/table/use-cases/traces.tsx b/web/src/components/table/use-cases/traces.tsx
index 9597df8662..13742f0276 100644
--- a/web/src/components/table/use-cases/traces.tsx
+++ b/web/src/components/table/use-cases/traces.tsx
@@ -1024,7 +1024,7 @@ export default function TracesTable({
{
accessorKey: "level",
id: "level",
- header: "Level",
+ header: "Status",
size: 75,
loadingCell: <TableTextLoadingCell />,
cell: ({ row }) => {
diff --git a/web/src/features/chart-view-prototype/components/MockEventsTable.tsx b/web/src/features/chart-view-prototype/components/MockEventsTable.tsx
index 75247123a6..29979d88b8 100644
--- a/web/src/features/chart-view-prototype/components/MockEventsTable.tsx
+++ b/web/src/features/chart-view-prototype/components/MockEventsTable.tsx
@@ -55,7 +55,7 @@ export const MockEventsTable = React.memo(function MockEventsTable({
<TableHead className="h-8">Type</TableHead>
<TableHead className="h-8">Name</TableHead>
<TableHead className="h-8">Model</TableHead>
- <TableHead className="h-8">Level</TableHead>
+ <TableHead className="h-8">Status</TableHead>
<TableHead className="h-8 text-right">Latency</TableHead>
<TableHead className="h-8 text-right">Cost</TableHead>
<TableHead className="h-8 text-right">Tokens</TableHead>
diff --git a/web/src/features/chart-view/vocab.ts b/web/src/features/chart-view/vocab.ts
index eec794b75d..7d751ae7a2 100644
--- a/web/src/features/chart-view/vocab.ts
+++ b/web/src/features/chart-view/vocab.ts
@@ -77,7 +77,7 @@ export const DIMENSIONS: DimensionDef[] = [
{ key: "none", label: "Total (no breakdown)", field: null },
{ key: "model", label: "Model", field: "providedModelName" },
{ key: "name", label: "Name", field: "name" },
- { key: "level", label: "Level", field: "level" },
+ { key: "level", label: "Status", field: "level" },
{ key: "type", label: "Type", field: "type" },
{ key: "environment", label: "Environment", field: "environment" },
];
diff --git a/web/src/features/dashboard/lib/dashboardUiTableToViewMapping.clienttest.ts b/web/src/features/dashboard/lib/dashboardUiTableToViewMapping.clienttest.ts
index f93c560539..ebcd056305 100644
--- a/web/src/features/dashboard/lib/dashboardUiTableToViewMapping.clienttest.ts
+++ b/web/src/features/dashboard/lib/dashboardUiTableToViewMapping.clienttest.ts
@@ -4,6 +4,7 @@ import { describe, expect, it } from "vitest";
import {
displayNameForFilterColumn,
+ mapLegacyUiTableFilterToView,
mapViewFilterToUiTableFilter,
mapWidgetUiTableFilterToView,
} from "./dashboardUiTableToViewMapping";
@@ -41,6 +42,9 @@ describe("displayNameForFilterColumn", () => {
["isRootObservation", "Is Root Observation"],
["userId", "User"],
["calledToolNames", "Tool Names (Called)"],
+ ["level", "Status"],
+ ["Level", "Status"],
+ ["Status", "Status"],
])("resolves %s to %s", (column, expected) => {
expect(displayNameForFilterColumn(column)).toBe(expected);
});
@@ -50,4 +54,24 @@ describe("displayNameForFilterColumn", () => {
"totallyUnknownColumn",
);
});
+
+ it("maps stored Level dashboard filters onto the level view field", () => {
+ expect(
+ mapLegacyUiTableFilterToView("observations", [
+ {
+ column: "Level",
+ type: "stringOptions",
+ operator: "any of",
+ value: ["ERROR"],
+ },
+ ]),
+ ).toEqual([
+ {
+ column: "level",
+ type: "stringOptions",
+ operator: "any of",
+ value: ["ERROR"],
+ },
+ ]);
+ });
});
diff --git a/web/src/features/dashboard/lib/dashboardUiTableToViewMapping.ts b/web/src/features/dashboard/lib/dashboardUiTableToViewMapping.ts
index c5b15d0d32..8d5b9e1de4 100644
--- a/web/src/features/dashboard/lib/dashboardUiTableToViewMapping.ts
+++ b/web/src/features/dashboard/lib/dashboardUiTableToViewMapping.ts
@@ -117,7 +117,10 @@ const viewFilterDefinitions: Record<
"providedModelName",
sourceSpec("Model", { uiTableId: "model" }),
),
- defineField("level", sourceSpec("Level", { uiTableId: "level" })),
+ defineField(
+ "level",
+ sourceSpec("Status", { uiTableId: "level", aliases: ["Level"] }),
+ ),
defineField(
"toolNames",
sourceSpec("Tool Names (Available)", { uiTableId: "toolNames" }),
diff --git a/web/src/features/events/components/MobileFiltersSheet.stories.tsx b/web/src/features/events/components/MobileFiltersSheet.stories.tsx
index 70f746422b..ba92d53e63 100644
--- a/web/src/features/events/components/MobileFiltersSheet.stories.tsx
+++ b/web/src/features/events/components/MobileFiltersSheet.stories.tsx
@@ -81,7 +81,7 @@ const fakeFacets = (
{[
"Name",
"Environment",
- "Level",
+ "Status",
"Tags",
"Model",
"User",
diff --git a/web/src/features/events/config/filter-config.clienttest.ts b/web/src/features/events/config/filter-config.clienttest.ts
new file mode 100644
index 0000000000..1c8e862862
--- /dev/null
+++ b/web/src/features/events/config/filter-config.clienttest.ts
@@ -0,0 +1,58 @@
+import {
+ eventsTableCols,
+ observationsTableCols,
+ tracesTableCols,
+} from "@langfuse/shared";
+import { normalizeFilterColumnNames } from "@/src/features/filters/lib/filter-transform";
+import { observationFilterConfig } from "@/src/features/filters/config/observations-config";
+import { traceFilterConfig } from "@/src/features/filters/config/traces-config";
+import {
+ getEventsColumnName,
+ observationEventsFilterConfig,
+} from "@/src/features/events/config/filter-config";
+
+describe("observation status display name", () => {
+ it("uses Status for both the table column and the sidebar filter", () => {
+ expect(getEventsColumnName("level")).toBe("Status");
+ expect(
+ observationEventsFilterConfig.facets.find(
+ (facet) => facet.column === "level",
+ )?.label,
+ ).toBe("Status");
+ expect(
+ observationsTableCols.find((column) => column.id === "level")?.name,
+ ).toBe("Status");
+ expect(
+ observationFilterConfig.facets.find((facet) => facet.column === "level")
+ ?.label,
+ ).toBe("Status");
+ expect(tracesTableCols.find((column) => column.id === "level")?.name).toBe(
+ "Status",
+ );
+ expect(
+ traceFilterConfig.facets.find((facet) => facet.column === "level")?.label,
+ ).toBe("Status");
+ });
+
+ it("still resolves saved filters that address the column as Level", () => {
+ for (const columns of [
+ eventsTableCols,
+ observationsTableCols,
+ tracesTableCols,
+ ]) {
+ const [normalized] = normalizeFilterColumnNames(
+ [
+ {
+ column: "Level",
+ type: "stringOptions",
+ operator: "any of",
+ value: ["ERROR"],
+ },
+ ],
+ columns,
+ );
+
+ expect(normalized?.column).toBe("level");
+ }
+ });
+});
diff --git a/web/src/features/events/config/filter-config.ts b/web/src/features/events/config/filter-config.ts
index b7ec7a137a..84f166c7c7 100644
--- a/web/src/features/events/config/filter-config.ts
+++ b/web/src/features/events/config/filter-config.ts
@@ -132,11 +132,11 @@ export const observationEventsFilterConfig: FilterConfig = {
label: getEventsColumnName("traceTags"),
},
{
- // Display relabel to "Status" (see traces-config); column id stays
- // `level` until the cross-surface rename lands.
+ // Display name comes from eventsTableCols so the sidebar and table
+ // column stay aligned. Column id stays `level`.
type: "categorical" as const,
column: "level",
- label: "Status",
+ label: getEventsColumnName("level"),
renderIcon: renderLevelIcon,
},
{
diff --git a/web/src/features/experiments/components/table/ExperimentGridCell.tsx b/web/src/features/experiments/components/table/ExperimentGridCell.tsx
index 6b7513b7d6..75c554ad6a 100644
--- a/web/src/features/experiments/components/table/ExperimentGridCell.tsx
+++ b/web/src/features/experiments/components/table/ExperimentGridCell.tsx
@@ -549,7 +549,7 @@ export const ExperimentGridCell = ({
{
accessorKey: "level",
cell: ({ data }) => (
- <MetadataItem label="Level">
+ <MetadataItem label="Status">
<span className="text-xs">{data.level}</span>
</MetadataItem>
),
diff --git a/web/src/features/experiments/config/experiment-items-filter-config.ts b/web/src/features/experiments/config/experiment-items-filter-config.ts
index 5d262ecec0..d7319fb544 100644
--- a/web/src/features/experiments/config/experiment-items-filter-config.ts
+++ b/web/src/features/experiments/config/experiment-items-filter-config.ts
@@ -37,7 +37,7 @@ export const experimentItemsTableCols: ColumnDefinition[] = [
internal: "start_time",
},
{
- name: "Level",
+ name: "Status",
id: "level",
type: "stringOptions",
internal: "level",
@@ -47,6 +47,7 @@ export const experimentItemsTableCols: ColumnDefinition[] = [
{ value: "WARNING" },
{ value: "ERROR" },
] as { value: ObservationLevelType }[],
+ aliases: ["Level"],
},
{
name: "Cost ($)",
diff --git a/web/src/features/filters/config/observations-config.ts b/web/src/features/filters/config/observations-config.ts
index 27e246ccd7..8ab936cf7c 100644
--- a/web/src/features/filters/config/observations-config.ts
+++ b/web/src/features/filters/config/observations-config.ts
@@ -54,8 +54,8 @@ export const observationFilterConfig: FilterConfig = {
label: "Trace Tags",
},
{
- // Display relabel to "Status" (see traces-config); column id stays
- // `level` until the cross-surface rename lands.
+ // Display name is "Status"; column id stays `level` to match the
+ // observation-level API field and saved filters.
type: "categorical" as const,
column: "level",
label: "Status",
diff --git a/web/src/features/filters/config/traces-config.ts b/web/src/features/filters/config/traces-config.ts
index fb0c1fe69a..7661ae1e85 100644
--- a/web/src/features/filters/config/traces-config.ts
+++ b/web/src/features/filters/config/traces-config.ts
@@ -79,9 +79,8 @@ export const traceFilterConfig: FilterConfig = {
label: "Comment Content",
},
{
- // Product direction is to call observation levels "Status" everywhere
- // (display relabel only here; the column id / grammar field stays
- // `level` until the cross-surface rename lands).
+ // Product direction is to call observation levels "Status" everywhere.
+ // Display relabel only; the column id / grammar field stays `level`.
type: "categorical" as const,
column: "level",
label: "Status",
diff --git a/web/src/features/metrics/metricsFilterColumns.ts b/web/src/features/metrics/metricsFilterColumns.ts
index a912057324..93fa508a03 100644
--- a/web/src/features/metrics/metricsFilterColumns.ts
+++ b/web/src/features/metrics/metricsFilterColumns.ts
@@ -274,11 +274,12 @@ const getMetricsFilterColumnSpecs = ({
},
{
column: {
- name: "Level",
+ name: "Status",
id: "level",
type: "stringOptions",
options: observationLevelOptions,
internal: "internalValue",
+ aliases: ["Level"],
},
},
{
diff --git a/web/src/features/search-bar/components/AutocompleteListbox.stories.tsx b/web/src/features/search-bar/components/AutocompleteListbox.stories.tsx
index a7b4460db1..2deb37c181 100644
--- a/web/src/features/search-bar/components/AutocompleteListbox.stories.tsx
+++ b/web/src/features/search-bar/components/AutocompleteListbox.stories.tsx
@@ -25,7 +25,7 @@ const fieldPlan: CompletionPlan = {
id: "field:level",
kind: "field",
label: "level",
- detail: "Observation level",
+ detail: "Observation status",
fieldId: "level",
},
{
diff --git a/web/src/features/search-bar/lib/explain.clienttest.ts b/web/src/features/search-bar/lib/explain.clienttest.ts
index ba8b013f21..feb7c7ec66 100644
--- a/web/src/features/search-bar/lib/explain.clienttest.ts
+++ b/web/src/features/search-bar/lib/explain.clienttest.ts
@@ -31,7 +31,7 @@ describe("explainSegment", () => {
expect(explain("metadata.region:eu")).toBe(
'Metadata "region" is exactly "eu".',
);
- expect(explain("level:ERROR")).toBe('Level is "ERROR".');
+ expect(explain("level:ERROR")).toBe('Status is "ERROR".');
expect(explain("statusMessage:chat*")).toBe(
'Status message starts with "chat".',
);
@@ -54,7 +54,7 @@ describe("explainSegment", () => {
"Start time is after 2026-06-01.",
);
expect(explain("-level:(ERROR OR WARNING)")).toBe(
- 'Level is none of "ERROR", "WARNING".',
+ 'Status is none of "ERROR", "WARNING".',
);
});
@@ -95,7 +95,8 @@ describe("explainSegment", () => {
}
// Only array fields get a plural verb ("Trace tags include"); everything
// else is followed by "is", so a plural label would read "… tokens is".
- if (field.syncMode !== "arrayOption") {
+ // "Status" is a singular noun that happens to end in s.
+ if (field.syncMode !== "arrayOption" && field.label !== "Status") {
expect(field.label, field.id).not.toMatch(/s$/);
}
}
diff --git a/web/src/features/search-bar/lib/fields.ts b/web/src/features/search-bar/lib/fields.ts
index dd7cdb92fa..d217d52361 100644
--- a/web/src/features/search-bar/lib/fields.ts
+++ b/web/src/features/search-bar/lib/fields.ts
@@ -153,7 +153,7 @@ export const FIELDS: FieldDef[] = [
{ id: "ingestionSource", aliases: ["ingestionsource", "ingestion_source", "source"], kind: "text", syncMode: "exactOption", label: "Ingestion source", description: "Ingestion source (API or OTel path)" },
{ id: "userId", aliases: ["userid", "user_id", "user"], kind: "text", syncMode: "exactOption", label: "User ID", description: "Trace user id", nullable: true },
{ id: "sessionId", aliases: ["sessionid", "session_id", "session"], kind: "text", syncMode: "exactOption", label: "Session ID", description: "Trace session id", nullable: true },
- { id: "level", aliases: [], kind: "text", syncMode: "exactOption", label: "Level", description: "Observation level" },
+ { id: "level", aliases: [], kind: "text", syncMode: "exactOption", label: "Status", description: "Observation status" },
{ id: "statusMessage", aliases: ["statusmessage", "status_message", "status"], kind: "text", syncMode: "textSearch", label: "Status message", description: "Status message", nullable: true },
{ id: "modelId", aliases: ["modelid", "model_id"], kind: "text", syncMode: "exactOption", label: "Model ID", description: "Internal model id", nullable: true },
{ id: "providedModelName", aliases: ["providedmodelname", "provided_model_name", "model"], kind: "text", syncMode: "exactOption", label: "Model name", description: "Provided model name", nullable: true },
diff --git a/worker/src/__tests__/traceFilterUtils.test.ts b/worker/src/__tests__/traceFilterUtils.test.ts
index a270f4d497..e669541941 100644
--- a/worker/src/__tests__/traceFilterUtils.test.ts
+++ b/worker/src/__tests__/traceFilterUtils.test.ts
@@ -46,21 +46,24 @@ describe("inMemoryFilterRequiresMetadata", () => {
expect(inMemoryFilterRequiresMetadata(filter)).toBe(true);
});
- it("returns false when the filter requires a database lookup", () => {
- // A Level condition cannot be evaluated in memory, so the whole filter
- // goes to the database and the cached trace's metadata is never read.
- const filter: FilterState = [
- {
- type: "stringObject",
- column: "metadata",
- key: "tier",
- operator: "=",
- value: "premium",
- },
- { type: "string", column: "Level", operator: "=", value: "ERROR" },
- ];
- expect(inMemoryFilterRequiresMetadata(filter)).toBe(false);
- });
+ it.each(["Level", "Status", "level"] as const)(
+ "returns false when the filter requires a database lookup (%s)",
+ (column) => {
+ // Observation status cannot be evaluated in memory, so the whole filter
+ // goes to the database and the cached trace's metadata is never read.
+ const filter: FilterState = [
+ {
+ type: "stringObject",
+ column: "metadata",
+ key: "tier",
+ operator: "=",
+ value: "premium",
+ },
+ { type: "string", column, operator: "=", value: "ERROR" },
+ ];
+ expect(inMemoryFilterRequiresMetadata(filter)).toBe(false);
+ },
+ );
it("returns true for unknown columns", () => {
const filter: FilterState = [
diff --git a/worker/src/features/database-read-stream/observation-stream.ts b/worker/src/features/database-read-stream/observation-stream.ts
index f25f156c47..41f02247ca 100644
--- a/worker/src/features/database-read-stream/observation-stream.ts
+++ b/worker/src/features/database-read-stream/observation-stream.ts
@@ -1,6 +1,7 @@
import {
BatchExportFileFormat,
FilterCondition,
+ matchesUiColumnMapping,
type ScoreDataTypeType,
TimeFilter,
TracingSearchType,
@@ -93,8 +94,8 @@ export const getObservationStream = async (
// Filter out trace-level filters since we don't join the traces table for filtering
// This prevents batch export failures when trace-level filters are present
const observationOnlyFilters = (filter ?? []).filter((f) => {
- const columnDef = observationsTableUiColumnDefinitions.find(
- (col) => col.uiTableName === f.column || col.uiTableId === f.column,
+ const columnDef = observationsTableUiColumnDefinitions.find((col) =>
+ matchesUiColumnMapping(col, f.column),
);
// Keep the filter if it's not a trace-level filter
return columnDef?.clickhouseTableName !== "traces";
@@ -465,8 +466,8 @@ const getObservationStreamFromEvents = async (
// this export path) and comment filters (comments live in Postgres and are
// resolved before the stream via applyCommentFilters).
const exportableFilters = (filter ?? []).filter((f) => {
- const columnDef = eventsTableUiColumnDefinitions.find(
- (col) => col.uiTableName === f.column || col.uiTableId === f.column,
+ const columnDef = eventsTableUiColumnDefinitions.find((col) =>
+ matchesUiColumnMapping(col, f.column),
);
if (columnDef?.clickhouseTableName === "comments") return false;
if (columnDef?.clickhouseTableName === "scores") {
diff --git a/worker/src/features/database-read-stream/trace-stream.ts b/worker/src/features/database-read-stream/trace-stream.ts
index 6b359a65ff..83a04c13bd 100644
--- a/worker/src/features/database-read-stream/trace-stream.ts
+++ b/worker/src/features/database-read-stream/trace-stream.ts
@@ -1,5 +1,6 @@
import {
FilterCondition,
+ matchesUiColumnMapping,
type ScoreDataTypeType,
TracingSearchType,
tracesTableCols,
@@ -58,8 +59,8 @@ export const getTraceStream = async (props: {
// Filter out observation-level filters since we don't join the observations table
// This prevents batch export failures when observation-level filters are present
const traceOnlyFilters = (filter ?? []).filter((f) => {
- const columnDef = tracesTableUiColumnDefinitions.find(
- (col) => col.uiTableName === f.column || col.uiTableId === f.column,
+ const columnDef = tracesTableUiColumnDefinitions.find((col) =>
+ matchesUiColumnMapping(col, f.column),
);
// Keep the filter if it's not an observation-level filter
return columnDef?.clickhouseTableName !== "observations";
diff --git a/worker/src/features/evaluation/traceFilterUtils.ts b/worker/src/features/evaluation/traceFilterUtils.ts
index e5d9ff9e44..d7f26a7a88 100644
--- a/worker/src/features/evaluation/traceFilterUtils.ts
+++ b/worker/src/features/evaluation/traceFilterUtils.ts
@@ -1,4 +1,8 @@
-import { FilterState, TraceDomain } from "@langfuse/shared";
+import {
+ FilterState,
+ matchesUiColumnMapping,
+ TraceDomain,
+} from "@langfuse/shared";
import { tracesTableUiColumnDefinitions } from "@langfuse/shared/src/server";
const _inMemoryTraceFilterColumns = [
@@ -21,9 +25,7 @@ type InMemoryTraceFilterColumn = (typeof _inMemoryTraceFilterColumns)[number];
function getColumnDefinition(column: string) {
const columnDef = tracesTableUiColumnDefinitions.find(
(col) =>
- col.uiTableId === column ||
- col.uiTableName === column ||
- col.clickhouseSelect === column,
+ matchesUiColumnMapping(col, column) || col.clickhouseSelect === column,
);
if (!columnDef) {
throw new Error(`Unhandled column for trace filter: ${column}`);