Feat: Use session_id to trace temporary chats with Langfuse #524
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Currently, all temporary chats are assigned the chat_id value "local." Due to the existing implementation in the langfuse_filter_pipeline.py, all temporary chats from different users are grouped into a single trace labeled "chat:local." This results in inaccurate trace data and incorrect user usage statistics.
To resolve this, I propose using the session_id as the trace name whenever chat_id is set to "local."
I have tested this approach in a local environment, and it functions as expected.
Discussions: