Applies to:
- Plan - Any
- Deployment - Any
- Use case - Grouping multi-turn conversation spans under a single trace using client-generated UUIDs while retaining root-span UI features like the Playground button
Summary
Goal: Create a real root span with a client-generated UUID so child spans are grouped correctly and root-only UI features remain available. Features:logger.traced(), parentSpanIds, spanId, rootSpanId
Configuration steps
Step 1: Understand the impact of a missing root span
WhenparentSpanIds references a UUID that has no corresponding logged span, Braintrust still groups child spans by root_span_id. However, the following features require a real root span row:
- + Playground button
- Root-span scoring and automation targets
- Trace-level input, output, metadata, and tags display
- Filters and custom columns that reference root-span fields
Step 2: Create a lightweight root span with a client-generated UUID
Log a root span first usingspanId set to your pre-generated UUID. Then pass that UUID as both rootSpanId and spanId in parentSpanIds for all child spans.