Skip to content

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

fix(otel): skip multiproject check for non-python (#7568)

Hassieb Pakzad1a5c5f6383e7
diff --git a/web/src/features/otel/server/OtelIngestionProcessor.ts b/web/src/features/otel/server/OtelIngestionProcessor.ts
index 582e59d994..04728d816e 100644
--- a/web/src/features/otel/server/OtelIngestionProcessor.ts
+++ b/web/src/features/otel/server/OtelIngestionProcessor.ts
@@ -310,7 +310,11 @@ export class OtelIngestionProcessor {
scopeSpan.scope?.name.startsWith("langfuse-sdk") ?? false;
const scopeAttributes = this.extractScopeAttributes(scopeSpan);
- this.validatePublicKey(isLangfuseSDKSpans, scopeAttributes);
+ this.validatePublicKey(
+ isLangfuseSDKSpans,
+ scopeAttributes,
+ resourceAttributes,
+ );
if (isLangfuseSDKSpans) {
recordIncrement("langfuse.otel.ingestion.langfuse_sdk_batch", 1);
@@ -598,11 +602,15 @@ export class OtelIngestionProcessor {
private validatePublicKey(
isLangfuseSDKSpans: boolean,
scopeAttributes: Record<string, unknown>,
+ resourceAttributes: Record<string, unknown>,
): void {
if (
isLangfuseSDKSpans &&
(!this.publicKey ||
- (scopeAttributes["public_key"] as unknown as string) !== this.publicKey)
+ (scopeAttributes["public_key"] as unknown as string) !==
+ this.publicKey) &&
+ (resourceAttributes["telemetry.sdk.language"] as unknown as string) ===
+ "python" // Only Python has multi project setups. Node OTEL does not allow setting scope.attributes, thus skipping the check for node
) {
throw new ForbiddenError(
`Langfuse OTEL SDK span has different public key '${scopeAttributes["public_key"]}' than used for authentication '${this.publicKey}'. Discarding span.`,