Skip to content

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

fix(otel): parse langfuse usage details if available (#10153)

Hassieb Pakzaddd77c8e4810e
diff --git a/packages/shared/src/server/otel/OtelIngestionProcessor.ts b/packages/shared/src/server/otel/OtelIngestionProcessor.ts
index ed3b339eb8..89d4d087be 100644
--- a/packages/shared/src/server/otel/OtelIngestionProcessor.ts
+++ b/packages/shared/src/server/otel/OtelIngestionProcessor.ts
@@ -884,7 +884,6 @@ export class OtelIngestionProcessor {
null,
usageDetails: this.extractUsageDetails(
attributes,
- isLangfuseSDKSpans,
instrumentationScopeName,
) as any,
costDetails: this.extractCostDetails(
@@ -1730,10 +1729,9 @@ export class OtelIngestionProcessor {
private extractUsageDetails(
attributes: Record<string, unknown>,
- isLangfuseSDKSpan: boolean,
instrumentationScopeName: string,
): Record<string, unknown> {
- if (isLangfuseSDKSpan) {
+ if (attributes[LangfuseOtelSpanAttributes.OBSERVATION_USAGE_DETAILS]) {
try {
return JSON.parse(
attributes[