MrOrz
MrOrz4w ago

Setting trace ID and parent observation ID with Python decorator SDK

I love the simplicity of Python Decorator SDK and would like to incorporate distributed tracing with it. In our setup, we have LLM apps that would call Tools, with both types of microservices linked to the same Langfuse project. LLM apps would pass the current Langfuse trace ID and observation ID to Tools when the LLM app decide to call tools. Currently we are able to set custom trace ID by passing langfuse_observation_id kwarg to the first method that is wrapped by @observe. However, we can't do the same as we also want to set parent_observation_id. Although it is possible to set it through the low-level SDK, seems that if we choose to use decorators we just can't achieve the same. What is the recommended way to set parent observation ID through the decorator based Python SDK?
Decorator-based Python Integration - Langfuse
A decorator-based integration to give you powerful tracing, evals, and analytics for your LLM application
Python SDK (Low-level) - Langfuse
Fully async and typed Python SDK. Uses Pydantic objects for data verification.
Solution:
Thanks for raising this, can you please open an issue for this? We are happy to have a look into this to extend the functionality here: https://langfuse.com/issues
GitHub
Issues · langfuse/langfuse
🪢 Open source LLM engineering platform: LLM Observability, metrics, evals, prompt management, playground, datasets. Integrates with LlamaIndex, Langchain, OpenAI SDK, LiteLLM, and more. 🍊YC W23 - ...
Jump to solution
2 Replies
Solution
Marc
Marc3w ago
Thanks for raising this, can you please open an issue for this? We are happy to have a look into this to extend the functionality here: https://langfuse.com/issues
GitHub
Issues · langfuse/langfuse
🪢 Open source LLM engineering platform: LLM Observability, metrics, evals, prompt management, playground, datasets. Integrates with LlamaIndex, Langchain, OpenAI SDK, LiteLLM, and more. 🍊YC W23 - ...
MrOrz
MrOrz3w ago
Thanks for the suggestion, let's continue the discussion on Github https://github.com/orgs/langfuse/discussions/3186
GitHub
Setting trace ID and parent observation ID with Python decorator SD...
Describe the feature or potential improvement I love the simplicity of Python Decorator SDK and would like to incorporate distributed tracing with it. In our setup, we have LLM apps that would call...