Merge Traces from 2 separate applications? #4972
-
Is it possible to have 2 separate apps write to the same trace or session_id? I have a frontend python streamlit chatbot app and a backend python RAG orchestrator app, both apps are running in separate containers. They both connect to the same Langfuse project. I was wondering if it's possible to merge both traces that are generated into a single trace in langfuse? Thanks in advance! |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 3 replies
-
Hello @bsonnek! I'm here to help you with any bugs, questions, or contributions. Let's see how we can tackle this challenge together! Langfuse allows you to merge traces from different applications by using the same You can achieve this by updating the current trace with a consistent from langfuse.decorators import langfuse_context, observe
@observe()
def your_function():
langfuse_context.update_current_trace(
session_id="your-shared-session-id"
) Ensure that both your frontend and backend applications use the same To continue talking to Dosu, mention @dosu. Help Dosu learn! Give it feedback: Great Response | Irrelevant Answer | Incorrect Sources | Too Verbose | Hallucination | Other |
Beta Was this translation helpful? Give feedback.
-
Yes, all integrations support using your own traceIds. Thereby the observations will be merged. Alternatively you can use sessions as outlined by dosu but this will result in two separate traces. |
Beta Was this translation helpful? Give feedback.
Yes, all integrations support using your own traceIds. Thereby the observations will be merged.
Alternatively you can use sessions as outlined by dosu but this will result in two separate traces.