Skip to content

Upgrade genkitx-langfuse to Langfuse JS SDK v5 #2

Description

@hassiebp

Hi genkitx-langfuse team 👋 — I'm Hassieb from the Langfuse team.

Genkit is already OpenTelemetry-native, so the v5 migration can simplify the plugin by removing the custom exporter that converts every OTel span back into v3 .trace()/.generation()/.span() calls.

The concrete migration looks like:

  • Use LangfuseSpanProcessor from @langfuse/otel@^5.4.0 in the Genkit telemetry provider.
  • Keep a lightweight enrichment step, or update Genkit's emitted attributes, to map genkit:input/output/type/path plus model/usage data onto standard gen_ai.* and Langfuse observation attributes.
  • Set shouldExportSpan to include Genkit instrumentation scopes/genkit:* spans explicitly; the v5 default filter may otherwise drop them.
  • Put user/session/trace metadata on every span so Fast Preview can query child observations directly.
  • Add regression coverage for flow→model→tool hierarchy, usage/cost, errors, filtering, flush, and shutdown.

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.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions