question about langfuse integration: if i wanted to retrieve the trace_id to subsequently add a user-inputted score to a trace, one example i've seen sets a root trace before invoking llama-index
langfuse_callback_handler = LlamaIndexCallbackHandler()
Settings.callback_manager = CallbackManager([langfuse_callback_handler])
def my_func():
# Create a new trace on your main execution path
root_trace = langfuse.trace(name="trace-name")
# Set the root trace, subsequent LlamaIndex observations will be nested under root
langfuse_callback_handler.set_root(root_trace)
# Your LlamaIndex code here
# Reset root, subsequent LlamaIndex observations will now use the default grouping and trace creation
langfuse_callback_handler.set_root(None)
is this thread-safe? or would we need to create and pass a new callback handler/manager for each invocation?
or is there a simpler way to retrieve the trace_id so that it can be manually updated via langfuse sdk later?