Skip to content

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

perf(score-analytics): route score comparison analytics to the read replica (#18504)

David Trainacebca122f5ab
diff --git a/web/src/features/score-analytics/server/buildEstimateQuery.ts b/web/src/features/score-analytics/server/buildEstimateQuery.ts
index ec68526b1b..d5b4dc1622 100644
--- a/web/src/features/score-analytics/server/buildEstimateQuery.ts
+++ b/web/src/features/score-analytics/server/buildEstimateQuery.ts
@@ -109,6 +109,7 @@ export async function buildEstimateQuery(params: {
fromTimestamp,
toTimestamp,
},
+ preferredClickhouseService: "ReadOnly",
});
const row = result[0];
diff --git a/web/src/features/score-analytics/server/scoreAnalyticsRouter.ts b/web/src/features/score-analytics/server/scoreAnalyticsRouter.ts
index c5f156c873..60a632fb15 100644
--- a/web/src/features/score-analytics/server/scoreAnalyticsRouter.ts
+++ b/web/src/features/score-analytics/server/scoreAnalyticsRouter.ts
@@ -360,6 +360,7 @@ export const createScoreAnalyticsRouter = ({
nBins,
},
tags: { projectId },
+ preferredClickhouseService: "ReadOnly",
clickhouseSettings: {
// Enable short-circuit evaluation to prevent correlation errors
// This ensures if() conditions are evaluated before function calls