Trace URLs
Each trace has a unique URL that you can use to share it with others or to access it directly.
Get trace url
Sometimes, it is useful to get the trace URL directly in the SDK. E.g. to add it to your logs or interactively look at it when running experiments in notebooks.
When using the @observe()
decorator:
from langfuse.decorators import langfuse_context, observe
@observe()
def fn():
langfuse_context.get_current_trace_url()
fn()
When using the low-level SDK:
trace = langfuse.trace(...)
trace.get_trace_url()
Share trace via url
By default, only members of your Langfuse project can view a trace.
You can make a trace public
to share it via a public link. This allows others to view the trace without needing to log in or be members of your Langfuse project.