Skip to content

Upgrade Langfuse integration to JS SDK v5Β #6631

Description

@hassiebp

Hi Flowise team πŸ‘‹ β€” I'm Hassieb from the Langfuse team.

Langfuse Cloud's Fast Preview requires JS/TS SDK v5.4.0+ for real-time data. flowise-components currently pins langfuse: 3.3.4 and uses both the v3 LangChain callback and stateful trace client.

The migration in packages/components/src/handler.ts looks like:

  • Replace langfuse/langfuse-langchain with scoped v5 packages: @langfuse/tracing, @langfuse/otel, @langfuse/langchain, and @langfuse/client only for non-tracing APIs.
  • Register one LangfuseSpanProcessor in Flowise's Node OpenTelemetry bootstrap. Credentials and base URL belong on the processor, not on each v5 CallbackHandler.
  • Rewrite AnalyticHandler's .trace()/.span()/.generation() calls as v5 observations and use propagateAttributes() for chat/session/trace fields.
  • Pass callback metadata through supported fields such as traceMetadata; keep release configuration at the processor/environment level.
  • Add regression coverage for chain/LLM/tool nesting, streaming usage, session correlation, and shutdown flushing.

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions