🪢 Open source agent evals & observability: Trace, evaluate, and improve LLM applications with one open platform.
TypeScript analyticsautogenevaluationlangchainlarge-language-modelsllama-indexllmllm-evaluationllm-observabilityllmopsmonitoringobservabilityopen-sourceopenaiplaygroundprompt-engineeringprompt-managementself-hostedycombinator
chore: record AMT duration distribution (#8287)
Steffen Schmitz674d66d179fe
diff --git a/packages/shared/src/server/clickhouse/measureAndReturn.ts b/packages/shared/src/server/clickhouse/measureAndReturn.tsindex 3c0eb661ae..2edd05d771 100644--- a/packages/shared/src/server/clickhouse/measureAndReturn.ts+++ b/packages/shared/src/server/clickhouse/measureAndReturn.ts@@ -1,4 +1,4 @@-import { instrumentAsync } from "../instrumentation";+import { instrumentAsync, recordDistribution } from "../instrumentation";import * as opentelemetry from "@opentelemetry/api";import { env } from "../../env";import { logger } from "../logger";@@ -70,6 +70,14 @@ export const measureAndReturn = async <T, Y>(args: {durationDifference,);+ recordDistribution(+ "langfuse.experiment.amts.duration_difference_distribution",+ durationDifference,+ {+ operation: args.operationName,+ },+ );+if (env.LANGFUSE_EXPERIMENT_ADD_QUERY_RESULT_TO_SPAN_PROJECT_IDS.some((p) => p === args.projectId,