🪢 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: skip otel processing on empty batch (#8964)
Steffen Schmitz242e33c2f6af
diff --git a/web/src/__tests__/async/otel-api.servertest.ts b/web/src/__tests__/async/otel-api.servertest.tsindex 75b9116a53..f5f15684cf 100644--- a/web/src/__tests__/async/otel-api.servertest.ts+++ b/web/src/__tests__/async/otel-api.servertest.ts@@ -210,4 +210,18 @@ describe("/api/public/otel/v1/traces API Endpoint", () => {expect(observation!.totalUsage).toBe(2037);}, 25_000);}, 30_000);++ it("should skip processing for empty resourceSpans", async () => {+ const payload = {+ // resourceSpans: []+ };++ const response = await makeAPICall(+ "POST",+ "/api/public/otel/v1/traces",+ payload,+ );++ expect(response.status).toBe(200);+ });});diff --git a/web/src/pages/api/public/otel/v1/traces/index.ts b/web/src/pages/api/public/otel/v1/traces/index.tsindex be9ee85d66..772fe4255b 100644--- a/web/src/pages/api/public/otel/v1/traces/index.ts+++ b/web/src/pages/api/public/otel/v1/traces/index.ts@@ -90,6 +90,10 @@ export default withMiddlewares({}}+ if (!resourceSpans || resourceSpans.length === 0) {+ return res.status(200).json({});+ }+const processor = new OtelIngestionProcessor({projectId: auth.scope.projectId,publicKey: auth.scope.publicKey,