Skip to main content
Applies to:


Summary

Goal: Understand which spans appear in the trace Thread view and how input/output extraction works.

Thread view span selection

Automatic span filtering

Thread view displays spans where span_attributes.type = 'llm' or span_attributes.type = 'score'. Only LLM spans have their input/output parsed into messages for conversation rendering. Extraction reads OpenTelemetry GenAI semantic conventions like gen_ai.prompt and gen_ai.completion. This process is automatic when you instrument providers or send OTel GenAI attributes.

Span type attribution

Set span_attributes.type to control which spans appear in Thread view:
import braintrust

with braintrust.traced(
    span_attributes={"type": "llm"}
):
    # This span should appear in Thread view
    result = client.chat.completions.create(...)

Configuration limitations

Thread view span selection is not configurable beyond the type attribute. You cannot point Thread view to specific span types or exclude certain provider spans.

Custom trace views

Build custom selection logic

Create a custom trace view to control which spans are displayed and how they’re rendered. Custom views receive the full trace JSON and can extract fields from any span. See the custom views guide for implementation details.