Upgrade @voltagent/langfuse-exporter to Langfuse JS SDK v5
Author: hassiebpCreated Jul 15, 2026Updated Jul 15, 2026
Hi VoltAgent team — I'm Hassieb from the Langfuse team.
I reviewed @voltagent/langfuse-exporter. It currently groups OTel spans and recreates them through the v3 langfuse event API. With JS/TS SDK v5.4+, this can become a much thinner OTel integration:
- Replace the custom v3-backed exporter with a wrapper around
LangfuseSpanProcessorfrom@langfuse/otel. - Normalize VoltAgent's custom
ai.*/usage.*fields to standardgen_ai.*and Langfuse observation attributes before export. - If VoltAgent's instrumentation scope is not covered by the v5 default filter, add a scoped
shouldExportSpanrule that includes VoltAgent spans without pulling in unrelated HTTP/database spans. - Attach user/session/tags/trace-name attributes to every span rather than reconstructing them only on the root trace.
- Preserve parent IDs, generation usage/TTFT, error status, batching, force-flush, and shutdown in tests.
Guides: JS SDK v3→v4 and v4→v5.
If you need support with the migration, we're happy to jump on a call or help review a PR.
Source: VoltAgent/voltagent