Skip to content

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

chore: track distribution of ingested event body size (#5723)

Max Deichmann55a5a896f173
diff --git a/packages/shared/src/server/ingestion/processEventBatch.ts b/packages/shared/src/server/ingestion/processEventBatch.ts
index db0edb29c0..b09643c32c 100644
--- a/packages/shared/src/server/ingestion/processEventBatch.ts
+++ b/packages/shared/src/server/ingestion/processEventBatch.ts
@@ -14,6 +14,7 @@ import {
getCurrentSpan,
instrumentAsync,
instrumentSync,
+ recordDistribution,
recordIncrement,
traceException,
} from "../instrumentation";
@@ -94,6 +95,8 @@ export const processEventBatch = async (
// add context of api call to the span
const currentSpan = getCurrentSpan();
recordIncrement("langfuse.ingestion.event", input.length);
+ recordDistribution("langfuse.ingestion.event_distribution", input.length);
+
currentSpan?.setAttribute("langfuse.ingestion.batch_size", input.length);
currentSpan?.setAttribute("langfuse.project.id", authCheck.scope.projectId);
currentSpan?.setAttribute("langfuse.org.id", authCheck.scope.orgId);