refly-ai / refly-ai/refly

Complete the Langfuse integration migration to JS SDK v5

Open
#2,283 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
TypeScript
Stars
7.5k
Forks
729
PR merge metrics
No merged PRs in 30d

Description

Hi Refly team 👋 — I'm Hassieb from the Langfuse team.

I reviewed the current setup and this is more than an @langfuse/otel version bump: apps/api uses @langfuse/otel@^4.4.2, while packages/observability also carries @langfuse/langchain@^4.4.2 and the legacy langfuse@^3.30.0 stateful client.

The concrete v5 migration is:

  • Bump @langfuse/otel and @langfuse/langchain to v5.4+, and remove the unscoped langfuse dependency.
  • Rewrite LangfuseClientManager/TraceManager from .trace()/.span()/.generation() clients to v5 observations, exported through the existing LangfuseSpanProcessor.
  • Use propagateAttributes() for user/session/tags/trace metadata so the fields reach every observation.
  • Review the current shouldExportSpan predicate: in v5 it is a full override. Keep it if exporting every non-excluded span is intentional; otherwise combine the excluded-scope check with isDefaultExportSpan.
  • Compile and test the custom FilteredLangfuseCallbackHandler overrides against v5, including masking, nesting, errors, flush, and shutdown.

The relevant guide is JS SDK v4→v5.

If you need support with the migration, we're happy to jump on a call or help review a PR.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start in apps/api and packages/observability, locating LangfuseClientManager, TraceManager, and FilteredLangfuseCallbackHandler plus their package dependencies. Read the linked JS SDK v4→v5 guide, then compile and test the migration, covering masking, nesting, errors, flush, shutdown, metadata propagation, and span-export behavior.

Written by the indexing model from the issue text.

Assessment

Tech stack
typescript
Domain
observability
Issue type
Refactor
Difficulty
4/5
Estimated time
3-5 days
Activity status
Quiet
Clarity
Mostly clear
Newbie friendliness
48/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.