Want to record user or session IDs? See the Track users and
sessions guide.
Trace-level metadata
Useupdate_current_trace() to attach metadata to
the entire trace (i.e., the full request lifecycle).
Promote inputs and outputs onto the trace
update_current_trace() expects you to name every value by hand. When the value you want
is already a function argument or a field of what the function returns, pass promote to
@trace() instead: Openlayer lifts it onto the trace as a top-level column you can filter
on and write tests against.
Pass a list to keep the original names:
score and a confidence column while
explanation stays where it is.
Pass a dict to rename the columns as you promote them:
A name that matches neither an input nor an output field is skipped with a
warning, as is an output that is not a dict, Pydantic model, or dataclass.
@trace_async() takes promote with the same semantics.Step-level metadata
Useupdate_current_step() to attach metadata to individual steps inside a trace.
This is useful for logging retrieval parameters, generation settings, or intermediate results.