Skip to content

simplify langchain distributed tracing example#2436

Open
klaasmeinke wants to merge 2 commits intolangfuse:mainfrom
klaasmeinke:patch-1
Open

simplify langchain distributed tracing example#2436
klaasmeinke wants to merge 2 commits intolangfuse:mainfrom
klaasmeinke:patch-1

Conversation

@klaasmeinke
Copy link

@klaasmeinke klaasmeinke commented Jan 7, 2026

I think that the previous example was complicating the solution for just adding a trace id.


Important

Simplifies Langchain trace ID handling by using trace_context in CallbackHandler instead of span wrapping.

  • Documentation:
    • Simplifies the process of adding a trace ID to Langchain executions in trace-ids-and-distributed-tracing.mdx.
    • Replaces the span wrapping method with a direct trace_context argument in CallbackHandler.
    • Removes unnecessary span creation and updates example code accordingly.

This description was created by Ellipsis for 447e9cd. You can customize this summary. It will automatically update as commits are pushed.

Updated the method to pass a custom trace ID in Langchain execution by using the 'trace_context' argument. Removed the previous method of using 'trace_context' in the span.
@vercel
Copy link

vercel bot commented Jan 7, 2026

@klaasmeinke is attempting to deploy a commit to the langfuse Team on Vercel.

A member of the Team first needs to authorize it.

@dosubot dosubot bot added the size:S This PR changes 10-29 lines, ignoring generated files. label Jan 7, 2026
@CLAassistant
Copy link

CLAassistant commented Jan 7, 2026

CLA assistant check
All committers have signed the CLA.

@klaasmeinke klaasmeinke changed the title Refactor trace ID handling in Langchain execution simplify langchain distributed tracing example Jan 7, 2026
@dosubot dosubot bot added the enhancement New feature or request label Jan 7, 2026
…acing.mdx

Co-authored-by: ellipsis-dev[bot] <65095814+ellipsis-dev[bot]@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request size:S This PR changes 10-29 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants