Skip to content

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

chore: bump clickhouse CI version (#19495)

Steffen Reutherda4b60578892
diff --git a/.github/workflows/pipeline.yml b/.github/workflows/pipeline.yml
index 1adc94fda2..78aed6c937 100644
--- a/.github/workflows/pipeline.yml
+++ b/.github/workflows/pipeline.yml
@@ -652,14 +652,14 @@ jobs:
# `clickhouse format` (from clickhouse-common-static) normalizes SQL for
# the equivalence snapshots. Its output is version-specific, so pin the
# exact version and regenerate snapshots on any bump; keep in sync with
- # scripts/codex/cloud_services.sh. 26.4 is the v4-recommended version.
+ # scripts/codex/cloud_services.sh and docker-compose.dev.yml.
# continue-on-error + timeout-minutes: a missing binary OR a stalled apt
# mirror just skips the tests, never blocks (timeout-minutes bounds a
# hang, which continue-on-error alone would not).
continue-on-error: true
timeout-minutes: 5
env:
- CLICKHOUSE_VERSION: 26.4.5.143
+ CLICKHOUSE_VERSION: 26.8.36.3
run: |
set -euo pipefail
sudo mkdir -p /etc/apt/keyrings
diff --git a/docker-compose.build.yml b/docker-compose.build.yml
index 70df5e864a..2b00566c02 100644
--- a/docker-compose.build.yml
+++ b/docker-compose.build.yml
@@ -122,7 +122,7 @@ services:
start_interval: 2s
clickhouse:
- image: docker.io/clickhouse/clickhouse-server
+ image: docker.io/clickhouse/clickhouse-server:26.10.3.7
user: "101:101"
environment:
CLICKHOUSE_DB: default
diff --git a/docker-compose.dev-azure.yml b/docker-compose.dev-azure.yml
index b71c12d8b3..5b694f3a5a 100644
--- a/docker-compose.dev-azure.yml
+++ b/docker-compose.dev-azure.yml
@@ -1,6 +1,6 @@
services:
clickhouse:
- image: docker.io/clickhouse/clickhouse-server:26.3.62.3-lts
+ image: docker.io/clickhouse/clickhouse-server:26.3.62.3
user: "101:101"
environment:
CLICKHOUSE_DB: default
diff --git a/docker-compose.dev-redis-cluster.yml b/docker-compose.dev-redis-cluster.yml
index 1fc0ef4273..458764ec29 100644
--- a/docker-compose.dev-redis-cluster.yml
+++ b/docker-compose.dev-redis-cluster.yml
@@ -14,7 +14,7 @@ services:
clickhouse:
# Latest ClickHouse in the CI matrix. Used to catch parser/settings
# regressions such as DateTime64 unquoted-number scaling on 26.8+.
- image: docker.io/clickhouse/clickhouse-server:26.9
+ image: docker.io/clickhouse/clickhouse-server:26.10.3.7
user: "101:101"
environment:
CLICKHOUSE_DB: default
diff --git a/docker-compose.dev.yml b/docker-compose.dev.yml
index bf583df815..d6328a0d3c 100644
--- a/docker-compose.dev.yml
+++ b/docker-compose.dev.yml
@@ -1,10 +1,10 @@
services:
clickhouse:
- # The CI matrix spans ClickHouse versions: -azure pins 25.12, the Langfuse
- # v4 minimum (events tables require the >=25.x text indexes /
- # enable_full_text_index); this config runs the current Cloud version, and
- # -redis-cluster exercises the newest release.
- image: docker.io/clickhouse/clickhouse-server:26.4
+ # The CI matrix spans ClickHouse versions: -azure pins the oldest line CI
+ # covers (26.3 LTS; events tables require the >=25.x text indexes /
+ # enable_full_text_index), this config runs 26.8 LTS, and -redis-cluster
+ # exercises the newest release.
+ image: docker.io/clickhouse/clickhouse-server:26.8.36.3
user: "101:101"
container_name: ${CLICKHOUSE_CONTAINER_NAME:-langfuse-clickhouse}
environment:
diff --git a/docker-compose.yml b/docker-compose.yml
index a4ea044a45..eb21a0a00d 100644
--- a/docker-compose.yml
+++ b/docker-compose.yml
@@ -145,7 +145,7 @@ services:
LANGFUSE_IN_APP_AGENT_MAX_ACTIVE_RUNS_PER_ORG: ${LANGFUSE_IN_APP_AGENT_MAX_ACTIVE_RUNS_PER_ORG:-}
clickhouse:
- image: docker.io/clickhouse/clickhouse-server:26.3.62.3-lts
+ image: docker.io/clickhouse/clickhouse-server:26.3.62.3
restart: always
user: "101:101"
environment:
diff --git a/packages/shared/src/eventsTable.ts b/packages/shared/src/eventsTable.ts
index ee78ecdc2d..c2d2d604ef 100644
--- a/packages/shared/src/eventsTable.ts
+++ b/packages/shared/src/eventsTable.ts
@@ -37,7 +37,7 @@ export const normalizeEventsTraceName = (
traceName: string | null | undefined,
): string | null => traceName || null;
export const eventsTableTraceNameAggregationSqlForAlias = (alias: string) =>
- `COALESCE(nullIf(argMaxIf(${alias}.trace_name, ${alias}.event_ts, ${alias}.trace_name <> ''), ''), nullIf(argMaxIf(${alias}.name, ${alias}.event_ts, ${eventsTableIsRootObservationSqlForAlias(alias)} AND ${alias}.name <> ''), ''))`;
+ `COALESCE(nullIf(argMaxIf(${alias}.trace_name, ${alias}.event_ts, ${alias}.trace_name <> ''), ''), nullIf(argMaxIf(${alias}.name, ${alias}.event_ts, (${eventsTableIsRootObservationSqlForAlias(alias)} AND ${alias}.name <> '')), ''))`;
export const eventsTableTraceNameAggregationSql =
eventsTableTraceNameAggregationSqlForAlias("e");
diff --git a/packages/shared/src/server/queries/clickhouse-sql/__snapshots__/event-filter-options.golden.test.ts.snap b/packages/shared/src/server/queries/clickhouse-sql/__snapshots__/event-filter-options.golden.test.ts.snap
index 818cf63aeb..4fa835ae7a 100644
--- a/packages/shared/src/server/queries/clickhouse-sql/__snapshots__/event-filter-options.golden.test.ts.snap
+++ b/packages/shared/src/server/queries/clickhouse-sql/__snapshots__/event-filter-options.golden.test.ts.snap
@@ -54,7 +54,7 @@ exports[`golden: events.getEventsExactFilterOptionsForColumns > scope=scoredTrac
option -> (tupleElement(option, 2) > 0),
[
tuple('false', countIf(NOT ((e.parent_span_id = '') OR (e.is_app_root = true))), toUInt64(0)),
- tuple('true', countIf((e.parent_span_id = '') OR (e.is_app_root = true)), toUInt64(0))
+ tuple('true', countIf(((e.parent_span_id = '') OR (e.is_app_root = true))), toUInt64(0))
]
) AS isRootObservationTopOptions,
any(e._sample_factor) AS sample_factor
@@ -191,7 +191,7 @@ exports[`golden: events.getEventsExactFilterOptionsForColumns > scope=unset —
option -> (tupleElement(option, 2) > 0),
[
tuple('false', countIf(NOT ((e.parent_span_id = '') OR (e.is_app_root = true))), toUInt64(0)),
- tuple('true', countIf((e.parent_span_id = '') OR (e.is_app_root = true)), toUInt64(0))
+ tuple('true', countIf(((e.parent_span_id = '') OR (e.is_app_root = true))), toUInt64(0))
]
) AS isRootObservationTopOptions,
any(e._sample_factor) AS sample_factor
diff --git a/packages/shared/src/server/repositories/__snapshots__/events.golden.test.ts.snap b/packages/shared/src/server/repositories/__snapshots__/events.golden.test.ts.snap
index 64eeae3182..17311f873b 100644
--- a/packages/shared/src/server/repositories/__snapshots__/events.golden.test.ts.snap
+++ b/packages/shared/src/server/repositories/__snapshots__/events.golden.test.ts.snap
@@ -628,7 +628,7 @@ exports[`golden: events export streams family > getEventsForBlobStorageExport fi
e.environment AS environment,
e.type AS type,
e.parent_span_id AS parent_observation_id,
- toBool((e.parent_span_id = '') OR (e.is_app_root = true)) AS is_root_observation,
+ toBool(((e.parent_span_id = '') OR (e.is_app_root = true))) AS is_root_observation,
e.name AS name,
e.level AS level,
e.status_message AS status_message,
@@ -698,7 +698,7 @@ exports[`golden: events export streams family > getEventsForBlobStorageExport fi
e.environment AS environment,
e.type AS type,
e.parent_span_id AS parent_observation_id,
- toBool((e.parent_span_id = '') OR (e.is_app_root = true)) AS is_root_observation,
+ toBool(((e.parent_span_id = '') OR (e.is_app_root = true))) AS is_root_observation,
e.name AS name,
e.level AS level,
e.status_message AS status_message,
@@ -710,7 +710,7 @@ exports[`golden: events export streams family > getEventsForBlobStorageExport fi
ifNull(
coalesce(
nullIf(e.trace_name, ''),
- if((e.parent_span_id = '') OR (e.is_app_root = true), nullIf(e.name, ''), NULL)
+ if(((e.parent_span_id = '') OR (e.is_app_root = true)), nullIf(e.name, ''), NULL)
),
''
) AS trace_name,
@@ -968,7 +968,7 @@ exports[`golden: events export streams family > getEventsForBlobStorageExport fi
e.environment AS environment,
e.type AS type,
e.parent_span_id AS parent_observation_id,
- toBool((e.parent_span_id = '') OR (e.is_app_root = true)) AS is_root_observation,
+ toBool(((e.parent_span_id = '') OR (e.is_app_root = true))) AS is_root_observation,
e.name AS name,
e.level AS level,
e.status_message AS status_message,
@@ -980,7 +980,7 @@ exports[`golden: events export streams family > getEventsForBlobStorageExport fi
ifNull(
coalesce(
nullIf(e.trace_name, ''),
- if((e.parent_span_id = '') OR (e.is_app_root = true), nullIf(e.name, ''), NULL)
+ if(((e.parent_span_id = '') OR (e.is_app_root = true)), nullIf(e.name, ''), NULL)
),
''
) AS trace_name,
@@ -1111,7 +1111,7 @@ exports[`golden: events export streams family > getEventsForBlobStorageExport fi
ifNull(
coalesce(
nullIf(e.trace_name, ''),
- if((e.parent_span_id = '') OR (e.is_app_root = true), nullIf(e.name, ''), NULL)
+ if(((e.parent_span_id = '') OR (e.is_app_root = true)), nullIf(e.name, ''), NULL)
),
''
) AS trace_name,
@@ -1183,7 +1183,7 @@ exports[`golden: events export streams family > getEventsForBlobStorageExportPar
e.environment AS environment,
e.type AS type,
e.parent_span_id AS parent_observation_id,
- toBool((e.parent_span_id = '') OR (e.is_app_root = true)) AS is_root_observation,
+ toBool(((e.parent_span_id = '') OR (e.is_app_root = true))) AS is_root_observation,
e.name AS name,
e.level AS level,
e.status_message AS status_message,
@@ -1195,7 +1195,7 @@ exports[`golden: events export streams family > getEventsForBlobStorageExportPar
ifNull(
coalesce(
nullIf(e.trace_name, ''),
- if((e.parent_span_id = '') OR (e.is_app_root = true), nullIf(e.name, ''), NULL)
+ if(((e.parent_span_id = '') OR (e.is_app_root = true)), nullIf(e.name, ''), NULL)
),
''
) AS trace_name,
@@ -1259,7 +1259,7 @@ exports[`golden: events export streams family > getEventsForBlobStorageExportPar
e.environment AS environment,
e.type AS type,
e.parent_span_id AS parent_observation_id,
- toBool((e.parent_span_id = '') OR (e.is_app_root = true)) AS is_root_observation,
+ toBool(((e.parent_span_id = '') OR (e.is_app_root = true))) AS is_root_observation,
e.name AS name,
e.level AS level,
e.status_message AS status_message,
@@ -1271,7 +1271,7 @@ exports[`golden: events export streams family > getEventsForBlobStorageExportPar
ifNull(
coalesce(
nullIf(e.trace_name, ''),
- if((e.parent_span_id = '') OR (e.is_app_root = true), nullIf(e.name, ''), NULL)
+ if(((e.parent_span_id = '') OR (e.is_app_root = true)), nullIf(e.name, ''), NULL)
),
''
) AS trace_name,
@@ -1367,7 +1367,7 @@ exports[`golden: events export streams family > getEventsForBlobStorageExportRaw
e.environment AS environment,
e.type AS type,
e.parent_span_id AS parent_observation_id,
- toBool((e.parent_span_id = '') OR (e.is_app_root = true)) AS is_root_observation,
+ toBool(((e.parent_span_id = '') OR (e.is_app_root = true))) AS is_root_observation,
e.name AS name,
e.level AS level,
e.status_message AS status_message,
@@ -1379,7 +1379,7 @@ exports[`golden: events export streams family > getEventsForBlobStorageExportRaw
ifNull(
coalesce(
nullIf(e.trace_name, ''),
- if((e.parent_span_id = '') OR (e.is_app_root = true), nullIf(e.name, ''), NULL)
+ if(((e.parent_span_id = '') OR (e.is_app_root = true)), nullIf(e.name, ''), NULL)
),
''
) AS trace_name,
@@ -1442,7 +1442,7 @@ exports[`golden: events export streams family > getEventsForBlobStorageExportRaw
e.environment AS environment,
e.type AS type,
e.parent_span_id AS parent_observation_id,
- toBool((e.parent_span_id = '') OR (e.is_app_root = true)) AS is_root_observation,
+ toBool(((e.parent_span_id = '') OR (e.is_app_root = true))) AS is_root_observation,
e.name AS name,
e.level AS level,
e.status_message AS status_message,
@@ -1454,7 +1454,7 @@ exports[`golden: events export streams family > getEventsForBlobStorageExportRaw
ifNull(
coalesce(
nullIf(e.trace_name, ''),
- if((e.parent_span_id = '') OR (e.is_app_root = true), nullIf(e.name, ''), NULL)
+ if(((e.parent_span_id = '') OR (e.is_app_root = true)), nullIf(e.name, ''), NULL)
),
''
) AS trace_name,
@@ -1564,7 +1564,7 @@ exports[`golden: events metadata map and session resolution > getEventsForAnalyt
ifNull(
coalesce(
nullIf(e.trace_name, ''),
- if((e.parent_span_id = '') OR (e.is_app_root = true), nullIf(e.name, ''), NULL)
+ if(((e.parent_span_id = '') OR (e.is_app_root = true)), nullIf(e.name, ''), NULL)
),
''
) AS trace_name,
@@ -1634,7 +1634,7 @@ exports[`golden: events metadata map and session resolution > getObservationsV2F
e.environment AS environment,
e.type AS type,
e.parent_span_id AS parent_observation_id,
- toBool((e.parent_span_id = '') OR (e.is_app_root = true)) AS is_root_observation,
+ toBool(((e.parent_span_id = '') OR (e.is_app_root = true))) AS is_root_observation,
e.name AS name,
e.level AS level,
e.status_message AS status_message,
@@ -1646,7 +1646,7 @@ exports[`golden: events metadata map and session resolution > getObservationsV2F
ifNull(
coalesce(
nullIf(e.trace_name, ''),
- if((e.parent_span_id = '') OR (e.is_app_root = true), nullIf(e.name, ''), NULL)
+ if(((e.parent_span_id = '') OR (e.is_app_root = true)), nullIf(e.name, ''), NULL)
),
''
) AS trace_name,
@@ -1812,7 +1812,7 @@ WHERE (e.project_id IN ({param1:Array(String)}))
))
AND (e.start_time >= fromUnixTimestamp64Milli({param4:Int64}))
AND (e.start_time <= fromUnixTimestamp64Milli({param5:Int64}))
- AND arrayExists((group_project_id, group_trace_ids, min_ms, max_ms) -> ((e.project_id = group_project_id) AND has(group_trace_ids, e.trace_id) AND ((e.start_time >= fromUnixTimestamp64Milli(min_ms)) AND (e.start_time <= fromUnixTimestamp64Milli(max_ms)))), {param6:Array(String)}, {param7:Array(Array(String))}, {param8:Array(Int64)}, {param9:Array(Int64)})
+ AND (arrayExists((group_project_id, group_trace_ids, min_ms, max_ms) -> ((e.project_id = group_project_id) AND has(group_trace_ids, e.trace_id) AND ((e.start_time >= fromUnixTimestamp64Milli(min_ms)) AND (e.start_time <= fromUnixTimestamp64Milli(max_ms)))), {param6:Array(String)}, {param7:Array(Array(String))}, {param8:Array(Int64)}, {param9:Array(Int64)}))
ORDER BY
e.project_id ASC,
e.trace_id ASC",
@@ -1969,7 +1969,7 @@ FROM
ifNull(
coalesce(
nullIf(e.trace_name, ''),
- if((e.parent_span_id = '') OR (e.is_app_root = true), nullIf(e.name, ''), NULL)
+ if(((e.parent_span_id = '') OR (e.is_app_root = true)), nullIf(e.name, ''), NULL)
),
''
) AS trace_name,
@@ -2088,7 +2088,7 @@ FROM
ifNull(
coalesce(
nullIf(e.trace_name, ''),
- if((e.parent_span_id = '') OR (e.is_app_root = true), nullIf(e.name, ''), NULL)
+ if(((e.parent_span_id = '') OR (e.is_app_root = true)), nullIf(e.name, ''), NULL)
),
''
) AS trace_name,
@@ -2209,7 +2209,7 @@ FROM
ifNull(
coalesce(
nullIf(e.trace_name, ''),
- if((e.parent_span_id = '') OR (e.is_app_root = true), nullIf(e.name, ''), NULL)
+ if(((e.parent_span_id = '') OR (e.is_app_root = true)), nullIf(e.name, ''), NULL)
),
''
) AS trace_name,
@@ -2332,7 +2332,7 @@ FROM
ifNull(
coalesce(
nullIf(e.trace_name, ''),
- if((e.parent_span_id = '') OR (e.is_app_root = true), nullIf(e.name, ''), NULL)
+ if(((e.parent_span_id = '') OR (e.is_app_root = true)), nullIf(e.name, ''), NULL)
),
''
) AS trace_name,
@@ -2415,7 +2415,8 @@ exports[`golden: events point-reads & existence family > getTraceByIdFromEventsT
],
},
"route": "unknown",
- "sql": "WITH event_traces AS
+ "sql": "WITH
+ event_traces AS
(
SELECT
e.trace_id AS id,
@@ -2423,7 +2424,11 @@ exports[`golden: events point-reads & existence family > getTraceByIdFromEventsT
coalesce(
nullIf(argMaxIf(e.trace_name, e.event_ts, e.trace_name != ''), ''),
nullIf(
- argMaxIf(e.name, e.event_ts, ((e.parent_span_id = '') OR (e.is_app_root = true)) AND (e.name != '')),
+ argMaxIf(
+ e.name,
+ e.event_ts,
+ (((e.parent_span_id = '') OR (e.is_app_root = true)) AND (e.name != ''))
+ ),
''
)
) AS name,
@@ -2449,7 +2454,7 @@ exports[`golden: events point-reads & existence family > getTraceByIdFromEventsT
) AS latency_milliseconds,
groupUniqArrayIf(e.span_id, e.span_id != '') AS observation_ids,
length(
- groupUniqArrayIf(e.span_id, (e.span_id != '') AND (e.span_id != concat('t-', e.trace_id)))
+ groupUniqArrayIf(e.span_id, ((e.span_id != '') AND (e.span_id != concat('t-', e.trace_id))))
) AS observation_count,
argMaxIf(e.bookmarked, e.event_ts, e.parent_span_id = '') AS bookmarked,
max(e.public) AS public,
@@ -2520,7 +2525,8 @@ exports[`golden: events point-reads & existence family > getTraceByIdFromEventsT
],
},
"route": "unknown",
- "sql": "WITH event_traces AS
+ "sql": "WITH
+ event_traces AS
(
SELECT
e.trace_id AS id,
@@ -2528,7 +2534,11 @@ exports[`golden: events point-reads & existence family > getTraceByIdFromEventsT
coalesce(
nullIf(argMaxIf(e.trace_name, e.event_ts, e.trace_name != ''), ''),
nullIf(
- argMaxIf(e.name, e.event_ts, ((e.parent_span_id = '') OR (e.is_app_root = true)) AND (e.name != '')),
+ argMaxIf(
+ e.name,
+ e.event_ts,
+ (((e.parent_span_id = '') OR (e.is_app_root = true)) AND (e.name != ''))
+ ),
''
)
) AS name,
@@ -2554,7 +2564,7 @@ exports[`golden: events point-reads & existence family > getTraceByIdFromEventsT
) AS latency_milliseconds,
groupUniqArrayIf(e.span_id, e.span_id != '') AS observation_ids,
length(
- groupUniqArrayIf(e.span_id, (e.span_id != '') AND (e.span_id != concat('t-', e.trace_id)))
+ groupUniqArrayIf(e.span_id, ((e.span_id != '') AND (e.span_id != concat('t-', e.trace_id))))
) AS observation_count,
argMaxIf(e.bookmarked, e.event_ts, e.parent_span_id = '') AS bookmarked,
max(e.public) AS public,
@@ -2627,7 +2637,8 @@ exports[`golden: events point-reads & existence family > getTraceByIdFromEventsT
"param4": "2026-01-01 00:00:00.000",
},
"route": "unknown",
- "sql": "WITH event_traces AS
+ "sql": "WITH
+ event_traces AS
(
SELECT
e.trace_id AS id,
@@ -2635,7 +2646,11 @@ exports[`golden: events point-reads & existence family > getTraceByIdFromEventsT
coalesce(
nullIf(argMaxIf(e.trace_name, e.event_ts, e.trace_name != ''), ''),
nullIf(
- argMaxIf(e.name, e.event_ts, ((e.parent_span_id = '') OR (e.is_app_root = true)) AND (e.name != '')),
+ argMaxIf(
+ e.name,
+ e.event_ts,
+ (((e.parent_span_id = '') OR (e.is_app_root = true)) AND (e.name != ''))
+ ),
''
)
) AS name,
@@ -2661,7 +2676,7 @@ exports[`golden: events point-reads & existence family > getTraceByIdFromEventsT
) AS latency_milliseconds,
groupUniqArrayIf(e.span_id, e.span_id != '') AS observation_ids,
length(
- groupUniqArrayIf(e.span_id, (e.span_id != '') AND (e.span_id != concat('t-', e.trace_id)))
+ groupUniqArrayIf(e.span_id, ((e.span_id != '') AND (e.span_id != concat('t-', e.trace_id))))
) AS observation_count,
argMaxIf(e.bookmarked, e.event_ts, e.parent_span_id = '') AS bookmarked,
max(e.public) AS public,
@@ -2734,7 +2749,8 @@ exports[`golden: events point-reads & existence family > getTraceByIdFromEventsT
],
},
"route": "unknown",
- "sql": "WITH event_traces AS
+ "sql": "WITH
+ event_traces AS
(
SELECT
e.trace_id AS id,
@@ -2742,7 +2758,11 @@ exports[`golden: events point-reads & existence family > getTraceByIdFromEventsT
coalesce(
nullIf(argMaxIf(e.trace_name, e.event_ts, e.trace_name != ''), ''),
nullIf(
- argMaxIf(e.name, e.event_ts, ((e.parent_span_id = '') OR (e.is_app_root = true)) AND (e.name != '')),
+ argMaxIf(
+ e.name,
+ e.event_ts,
+ (((e.parent_span_id = '') OR (e.is_app_root = true)) AND (e.name != ''))
+ ),
''
)
) AS name,
@@ -2768,7 +2788,7 @@ exports[`golden: events point-reads & existence family > getTraceByIdFromEventsT
) AS latency_milliseconds,
groupUniqArrayIf(e.span_id, e.span_id != '') AS observation_ids,
length(
- groupUniqArrayIf(e.span_id, (e.span_id != '') AND (e.span_id != concat('t-', e.trace_id)))
+ groupUniqArrayIf(e.span_id, ((e.span_id != '') AND (e.span_id != concat('t-', e.trace_id))))
) AS observation_count,
argMaxIf(e.bookmarked, e.event_ts, e.parent_span_id = '') AS bookmarked,
max(e.public) AS public,
@@ -2846,14 +2866,14 @@ exports[`golden: events point-reads & existence family > getTraceMetadataByIdsFr
e.trace_id AS id,
coalesce(
nullIf(e.trace_name, ''),
- if((e.parent_span_id = '') OR (e.is_app_root = true), nullIf(e.name, ''), NULL)
+ if(((e.parent_span_id = '') OR (e.is_app_root = true)), nullIf(e.name, ''), NULL)
) AS name,
e.user_id AS user_id,
e.tags AS tags
FROM events_core AS e
WHERE (e.project_id = {param1:String})
AND (e.is_deleted = 0)
- AND (coalesce(nullIf(e.trace_name, ''), if((e.parent_span_id = '') OR (e.is_app_root = true), nullIf(e.name, ''), NULL)) IS NOT NULL)
+ AND (coalesce(nullIf(e.trace_name, ''), if(((e.parent_span_id = '') OR (e.is_app_root = true)), nullIf(e.name, ''), NULL)) IS NOT NULL)
AND (e.trace_id IN ({param2:Array(String)}))
LIMIT 1 BY e.trace_id",
},
@@ -2956,7 +2976,8 @@ exports[`golden: events simple aggregates family > getObservationMetricsForPromp
"param2": [],
},
"route": "unknown",
- "sql": "WITH prompt_events AS
+ "sql": "WITH
+ prompt_events AS
(
SELECT
latest.project_id,
@@ -3028,7 +3049,8 @@ exports[`golden: events simple aggregates family > getObservationMetricsForPromp
"param3": "2025-12-01 00:00:00.000",
},
"route": "unknown",
- "sql": "WITH prompt_events AS
+ "sql": "WITH
+ prompt_events AS
(
SELECT
latest.project_id,
@@ -3102,7 +3124,8 @@ exports[`golden: events simple aggregates family > getObservationMetricsForPromp
"param4": "2026-01-02 00:00:00.000",
},
"route": "unknown",
- "sql": "WITH prompt_events AS
+ "sql": "WITH
+ prompt_events AS
(
SELECT
latest.project_id,
@@ -3176,7 +3199,8 @@ exports[`golden: events simple aggregates family > getObservationMetricsForPromp
"param3": "2026-01-02 00:00:00.000",
},
"route": "unknown",
- "sql": "WITH prompt_events AS
+ "sql": "WITH
+ prompt_events AS
(
SELECT
latest.project_id,
@@ -3248,7 +3272,8 @@ exports[`golden: events simple aggregates family > getObservationMetricsForPromp
],
},
"route": "unknown",
- "sql": "WITH prompt_events AS
+ "sql": "WITH
+ prompt_events AS
(
SELECT
latest.project_id,
@@ -3455,7 +3480,7 @@ exports[`golden: events simple aggregates family > getSessionMetricsFromEvents f
max(e.start_time) AS max_timestamp,
min(e.start_time) AS min_timestamp,
groupUniqArray(e.trace_id) AS trace_ids,
- groupUniqArrayIf(e.user_id, (e.user_id IS NOT NULL) AND (e.user_id != '')) AS user_ids,
+ groupUniqArrayIf(e.user_id, ((e.user_id IS NOT NULL) AND (e.user_id != ''))) AS user_ids,
uniq(e.trace_id) AS trace_count,
groupUniqArrayArrayIf(e.tags, notEmpty(e.tags)) AS trace_tags,
argMaxIf(e.environment, e.event_ts, e.environment != '') AS environment,
@@ -3564,7 +3589,11 @@ exports[`golden: events trace aggregation family > getTracesFromEventsTableForPu
coalesce(
nullIf(argMaxIf(e.trace_name, e.event_ts, e.trace_name != ''), ''),
nullIf(
- argMaxIf(e.name, e.event_ts, ((e.parent_span_id = '') OR (e.is_app_root = true)) AND (e.name != '')),
+ argMaxIf(
+ e.name,
+ e.event_ts,
+ (((e.parent_span_id = '') OR (e.is_app_root = true)) AND (e.name != ''))
+ ),
''
)
) AS name,
@@ -3590,7 +3619,7 @@ exports[`golden: events trace aggregation family > getTracesFromEventsTableForPu
) AS latency_milliseconds,
groupUniqArrayIf(e.span_id, e.span_id != '') AS observation_ids,
length(
- groupUniqArrayIf(e.span_id, (e.span_id != '') AND (e.span_id != concat('t-', e.trace_id)))
+ groupUniqArrayIf(e.span_id, ((e.span_id != '') AND (e.span_id != concat('t-', e.trace_id))))
) AS observation_count,
argMaxIf(e.bookmarked, e.event_ts, e.parent_span_id = '') AS bookmarked,
max(e.public) AS public,
@@ -3679,7 +3708,8 @@ exports[`golden: events trace aggregation family > getTracesFromEventsTableForPu
"param4": 50,
},
"route": "unknown",
- "sql": "WITH traces AS
+ "sql": "WITH
+ traces AS
(
SELECT
e.trace_id AS id,
@@ -3687,7 +3717,11 @@ exports[`golden: events trace aggregation family > getTracesFromEventsTableForPu
coalesce(
nullIf(argMaxIf(e.trace_name, e.event_ts, e.trace_name != ''), ''),
nullIf(
- argMaxIf(e.name, e.event_ts, ((e.parent_span_id = '') OR (e.is_app_root = true)) AND (e.name != '')),
+ argMaxIf(
+ e.name,
+ e.event_ts,
+ (((e.parent_span_id = '') OR (e.is_app_root = true)) AND (e.name != ''))
+ ),
''
)
) AS name,
@@ -3713,7 +3747,7 @@ exports[`golden: events trace aggregation family > getTracesFromEventsTableForPu
) AS latency_milliseconds,
groupUniqArrayIf(e.span_id, e.span_id != '') AS observation_ids,
length(
- groupUniqArrayIf(e.span_id, (e.span_id != '') AND (e.span_id != concat('t-', e.trace_id)))
+ groupUniqArrayIf(e.span_id, ((e.span_id != '') AND (e.span_id != concat('t-', e.trace_id))))
) AS observation_count,
argMaxIf(e.bookmarked, e.event_ts, e.parent_span_id = '') AS bookmarked,
max(e.public) AS public,
@@ -3763,7 +3797,7 @@ SELECT
t.release,
CONCAT('/project/', t.project_id, '/traces/', t.id) AS htmlPath
FROM traces AS t
-WHERE t.timestamp >= {param3:DateTime64(3, 'UTC')}
+WHERE (t.timestamp >= {param3:DateTime64(3, 'UTC')})
ORDER BY
t.project_id DESC,
t.timestamp DESC
@@ -3781,7 +3815,8 @@ exports[`golden: events trace aggregation family > getTracesIdentifierForSession
"param2": "golden-session",
},
"route": "unknown",
- "sql": "WITH event_traces AS
+ "sql": "WITH
+ event_traces AS
(
SELECT
e.trace_id AS id,
@@ -3789,7 +3824,11 @@ exports[`golden: events trace aggregation family > getTracesIdentifierForSession
coalesce(
nullIf(argMaxIf(e.trace_name, e.event_ts, e.trace_name != ''), ''),
nullIf(
- argMaxIf(e.name, e.event_ts, ((e.parent_span_id = '') OR (e.is_app_root = true)) AND (e.name != '')),
+ argMaxIf(
+ e.name,
+ e.event_ts,
+ (((e.parent_span_id = '') OR (e.is_app_root = true)) AND (e.name != ''))
+ ),
''
)
) AS name,
diff --git a/packages/shared/src/server/repositories/__snapshots__/experiments.golden.test.ts.snap b/packages/shared/src/server/repositories/__snapshots__/experiments.golden.test.ts.snap
index f318dddd43..6ec189979e 100644
--- a/packages/shared/src/server/repositories/__snapshots__/experiments.golden.test.ts.snap
+++ b/packages/shared/src/server/repositories/__snapshots__/experiments.golden.test.ts.snap
@@ -53,7 +53,7 @@ exports[`golden: experiments simple aggregates family > getExperimentMetricsFrom
sum(e.total_cost) AS total_cost,
avgIf(
dateDiff('millisecond', e.start_time, e.end_time),
- (e.span_id = e.experiment_item_root_span_id) AND (e.end_time IS NOT NULL)
+ ((e.span_id = e.experiment_item_root_span_id) AND (e.end_time IS NOT NULL))
) AS latency_avg
FROM events_core AS e
WHERE (e.project_id = {param1:String})
diff --git a/packages/shared/src/server/repositories/__snapshots__/scores.golden.test.ts.snap b/packages/shared/src/server/repositories/__snapshots__/scores.golden.test.ts.snap
index 4238c26adb..fdf8b4bde1 100644
--- a/packages/shared/src/server/repositories/__snapshots__/scores.golden.test.ts.snap
+++ b/packages/shared/src/server/repositories/__snapshots__/scores.golden.test.ts.snap
@@ -11,7 +11,8 @@ exports[`golden: scores.getAggregatedScoresForPromptsFromEvents > relation=obser
"param3": "2026-01-01 00:00:00.000",
"param4": "2026-01-31 23:59:59.000",
},
- "sql": "WITH prompt_events AS
+ "sql": "WITH
+ prompt_events AS
(
SELECT
latest.project_id,
@@ -86,7 +87,8 @@ exports[`golden: scores.getAggregatedScoresForPromptsFromEvents > relation=obser
"prompt-b",
],
},
- "sql": "WITH prompt_events AS
+ "sql": "WITH
+ prompt_events AS
(
SELECT
latest.project_id,
@@ -160,7 +162,8 @@ exports[`golden: scores.getAggregatedScoresForPromptsFromEvents > relation=trace
],
"param3": "2026-01-01 00:00:00.000",
},
- "sql": "WITH prompt_events AS
+ "sql": "WITH
+ prompt_events AS
(
SELECT
latest.project_id,
@@ -232,7 +235,8 @@ exports[`golden: scores.getAggregatedScoresForPromptsFromEvents > relation=trace
"prompt-b",
],
},
- "sql": "WITH prompt_events AS
+ "sql": "WITH
+ prompt_events AS
(
SELECT
latest.project_id,
diff --git a/packages/shared/src/server/services/__snapshots__/sessions-ui-table-events-service.golden.test.ts.snap b/packages/shared/src/server/services/__snapshots__/sessions-ui-table-events-service.golden.test.ts.snap
index 46716c3e94..c3d90a2de1 100644
--- a/packages/shared/src/server/services/__snapshots__/sessions-ui-table-events-service.golden.test.ts.snap
+++ b/packages/shared/src/server/services/__snapshots__/sessions-ui-table-events-service.golden.test.ts.snap
@@ -14,7 +14,10 @@ exports[`golden: sessions simple aggregates family > getSessionTracesFromEvents
e.project_id AS project_id,
coalesce(
nullIf(argMaxIf(e.trace_name, e.event_ts, e.trace_name != ''), ''),
- nullIf(argMaxIf(e.name, e.event_ts, ((e.parent_span_id = '') OR (e.is_app_root = true)) AND (e.name != '')), '')
+ nullIf(
+ argMaxIf(e.name, e.event_ts, (((e.parent_span_id = '') OR (e.is_app_root = true)) AND (e.name != ''))),
+ ''
+ )
) AS name,
min(e.start_time) AS timestamp,
argMaxIf(e.environment, e.event_ts, e.environment != '') AS environment,
@@ -38,7 +41,7 @@ exports[`golden: sessions simple aggregates family > getSessionTracesFromEvents
) AS latency_milliseconds,
groupUniqArrayIf(e.span_id, e.span_id != '') AS observation_ids,
length(
- groupUniqArrayIf(e.span_id, (e.span_id != '') AND (e.span_id != concat('t-', e.trace_id)))
+ groupUniqArrayIf(e.span_id, ((e.span_id != '') AND (e.span_id != concat('t-', e.trace_id))))
) AS observation_count,
argMaxIf(e.bookmarked, e.event_ts, e.parent_span_id = '') AS bookmarked,
max(e.public) AS public,
@@ -102,14 +105,15 @@ exports[`golden: sessions table aggregation family > getSessionsTableCountFromEv
"param9": "golden-value",
},
"route": "unknown",
- "sql": "WITH session_data AS
+ "sql": "WITH
+ session_data AS
(
SELECT
e.session_id AS session_id,
max(e.start_time) AS max_timestamp,
min(e.start_time) AS min_timestamp,
groupUniqArray(e.trace_id) AS trace_ids,
- groupUniqArrayIf(e.user_id, (e.user_id IS NOT NULL) AND (e.user_id != '')) AS user_ids,
+ groupUniqArrayIf(e.user_id, ((e.user_id IS NOT NULL) AND (e.user_id != ''))) AS user_ids,
uniq(e.trace_id) AS trace_count,
groupUniqArrayArrayIf(e.tags, notEmpty(e.tags)) AS trace_tags,
argMaxIf(e.environment, e.event_ts, e.environment != '') AS environment,
@@ -172,14 +176,15 @@ exports[`golden: sessions table aggregation family > getSessionsTableFromEvents
"param2": 50,
},
"route": "unknown",
- "sql": "WITH session_data AS
+ "sql": "WITH
+ session_data AS
(
SELECT
e.session_id AS session_id,
max(e.start_time) AS max_timestamp,
min(e.start_time) AS min_timestamp,
groupUniqArray(e.trace_id) AS trace_ids,
- groupUniqArrayIf(e.user_id, (e.user_id IS NOT NULL) AND (e.user_id != '')) AS user_ids,
+ groupUniqArrayIf(e.user_id, ((e.user_id IS NOT NULL) AND (e.user_id != ''))) AS user_ids,
uniq(e.trace_id) AS trace_count,
groupUniqArrayArrayIf(e.tags, notEmpty(e.tags)) AS trace_tags,
argMaxIf(e.environment, e.event_ts, e.environment != '') AS environment,
diff --git a/scripts/codex/cloud_services.sh b/scripts/codex/cloud_services.sh
index 9d8e4d0963..9c2f4923e0 100755
--- a/scripts/codex/cloud_services.sh
+++ b/scripts/codex/cloud_services.sh
@@ -13,7 +13,7 @@ CLICKHOUSE_HTTP_PORT="${CLICKHOUSE_HTTP_PORT:-8123}"
CLICKHOUSE_NATIVE_PORT="${CLICKHOUSE_NATIVE_PORT:-9000}"
MINIO_API_PORT="${MINIO_API_PORT:-9090}"
MINIO_CONSOLE_PORT="${MINIO_CONSOLE_PORT:-9091}"
-CLICKHOUSE_VERSION="${CLICKHOUSE_VERSION:-26.4.5.143}"
+CLICKHOUSE_VERSION="${CLICKHOUSE_VERSION:-26.8.36.3}"
POSTGRES_USER="${POSTGRES_USER:-postgres}"
POSTGRES_PASSWORD="${POSTGRES_PASSWORD:-postgres}"