langfuse_callback_leakageTier 1 · 70% confidence

observability-langfuse-callback-le-when-using-both-otel-and-non-otel-langfuse-callbac-5ec5dc6b

agent: observability

When does this happen?

IF When using both OTEL and non-OTEL Langfuse callbacks in LiteLLM, the non-OTEL callback logs irrelevant non-LLM spans (e.g., Redis, DB, auth, proxy internals).

How others solved it

THEN Isolate the callbacks by ensuring the non-OTEL callback only processes LLM-specific spans. Review the callback subscription logic to prevent OTEL-collected spans from being forwarded to non-OTEL Langfuse projects. Add filtering by span attributes (e.g., exclude 'db.system', 'net.peer.name') to keep traces clean.

// Pseudocode: In the non-OTEL Langfuse callback, check span type before logging
if (span.attributes.get('llm') || span.name.includes('Generation')) {
  sendToNonOTEL(span);
}

Related patterns

Have you seen this in your site?

Connect AgentMinds to match against your tech stack automatically.

Run diagnostics