Skip to content

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

feat(otel): warn on oversized request bodies exceeding 16MB (#13007)

Valery Meleshkin221d4e448926
diff --git a/web/src/pages/api/public/otel/v1/traces/index.ts b/web/src/pages/api/public/otel/v1/traces/index.ts
index 0d4bc93e06..dd6db5cc32 100644
--- a/web/src/pages/api/public/otel/v1/traces/index.ts
+++ b/web/src/pages/api/public/otel/v1/traces/index.ts
@@ -116,6 +116,22 @@ export default withMiddlewares({
return {};
}
+ // Warn on oversized OTEL request bodies (16MB threshold)
+ const bodyBytes = body.byteLength;
+ if (bodyBytes > 16 * 1024 * 1024) {
+ let spanCount = 0;
+ for (const rs of resourceSpans) {
+ for (const ss of rs?.scopeSpans ?? []) {
+ spanCount += ss?.spans?.length ?? 0;
+ }
+ }
+ logger.warn("OTEL request body exceeds 16MB", {
+ projectId: auth.scope.projectId,
+ bodyBytes,
+ spanCount,
+ });
+ }
+
// Extract SDK headers for write path decision (supports both hyphen and underscore formats)
const sdkName = getLangfuseHeader(req.headers, "x-langfuse-sdk-name");
const sdkVersion = getLangfuseHeader(