python sdk: observations n same trace
Hey,
I try to have one trace for all my endpoints without succeed
example of my code
9 Replies
Hi @isaaccs, is this stable across all of your endpoints?
span = tracer.current_root_span()
yes
i also try with harcoded trace_id
found it, try
langfuse.trace(CreateTrace(id=trace_id))
, trace_id does not exist on the Pydantic objectSee all parameters here: https://langfuse.com/docs/sdk/python#traces-1
Python SDK - Langfuse
Fully async and typed Python SDK. Uses Pydantic objects for data verification.
oh yes thank you
🤗
Happy that it works for you
@Max currently improving the python interfces, with v2 this will be much simpler (without having to change much though)
perfect
last question
let suppose my code is like that
how can i get something like this
depends, you can either use the sdk clients, each call returns the object which can create child objects
alternatively, you can nest with ids youself
instead of creating your own ids, you can also let the sdk generate ids
hope this helps