For a comprehensive reference of all available attributes and semantic conventions, see the Semantic Conventions guide.
Setting Attributes
UsesetAttributes() on any span to attach metadata. For trace-level context, set attributes on the root span:
Common Attributes
- User and session:
langwatch.user.id,langwatch.thread.id- see Tracking Conversations - Application context:
app.version,environment,region - LLM operations:
gen_ai.request.model,gen_ai.request.temperature - Custom business logic:
customer.tier,feature.flags
Setting Attributes on Child Spans
You can set attributes on any span in your trace hierarchy:Adding Labels to Traces
Labels allow you to organize, filter, and categorize your traces in the LangWatch dashboard:Viewing in LangWatch
All captured span attributes will be visible in the LangWatch UI:- Root span attributes are displayed in the trace details view, providing an overview of the entire operation
- Child span attributes are shown when you inspect individual spans within a trace
- Filter and search for traces and spans based on specific attribute values
- Analyze performance by correlating metrics with different attributes
- Debug issues by quickly understanding the context and parameters of a failed or slow operation