Decorator: disable tracing at the decorated function level #3954
Replies: 2 comments 3 replies
-
Hey @klemenstraeger! I'm here to help you with any bugs, questions, or contributions you have. Let's tackle this together! To disable tracing for specific requests in Langfuse, you should ensure that the Here are a few things to consider:
If these suggestions do not resolve the issue, you might need to explore further customization or check for updates in the Langfuse documentation or codebase that might address this specific use case. |
Beta Was this translation helpful? Give feedback.
-
hi @klemenstraeger - do I understand you correctly that you wish for some kind of switch on the execution level that controls whether a function and all its potentially nested decorated functions are traced or not? Something like
Having this fine grained control would be definitely a new feature to be added, currently we support an enabled switch on the global level only. |
Beta Was this translation helpful? Give feedback.
-
Hi there,
we have a use case where we want to disable the tracing with langfuse for certain requests (specified in the request body). However by using
langfuse_context.configure(enabled=request.enable_tracing)
only the following requests are not logged. However the requests where we don't want to trace the request are logged in Langfuse.
Do we need to call
flush()
after disabling the client or is there another option to temporarily disable tracing for certain requests?PS: We use FastAPI + Litellm as a Wrapper
Beta Was this translation helpful? Give feedback.
All reactions