Skip to content

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

chore: improve clickhouse experimentation (#4239)

Max Deichmann5b5c3ba4396e
diff --git a/web/src/server/utils/checkClickhouseAccess.ts b/web/src/server/utils/checkClickhouseAccess.ts
index 35b44aebe1..8205527e89 100644
--- a/web/src/server/utils/checkClickhouseAccess.ts
+++ b/web/src/server/utils/checkClickhouseAccess.ts
@@ -2,7 +2,7 @@ import { env } from "@/src/env.mjs";
import {
instrumentAsync,
logger,
- recordGauge,
+ recordHistogram,
} from "@langfuse/shared/src/server";
import { type User } from "next-auth";
import * as opentelemetry from "@opentelemetry/api";
@@ -75,11 +75,13 @@ export const measureAndReturnApi = async <T, Y>(args: {
currentSpan?.setAttribute("pg-duration", pgDuration);
currentSpan?.setAttribute("ch-duration", chDuration);
- recordGauge("langfuse.clickhouse_execution_time", chDuration, {
+ recordHistogram("langfuse.clickhouse_experiment", chDuration, {
operation: args.operation,
+ database: "clickhouse",
});
- recordGauge("langfuse.postgres_execution_time", pgDuration, {
+ recordHistogram("langfuse.clickhouse_experiment", pgDuration, {
operation: args.operation,
+ database: "postgres",
});
return env.LANGFUSE_RETURN_FROM_CLICKHOUSE === "true"