Summary
The OpenAI chat completions tracer, OpenAI Responses API tracer, and Anthropic messages tracer do not set braintrust.span_attributes with {"type": "llm"} on their spans. Every other integration in the repository correctly sets this attribute. This causes spans from the three highest-traffic integrations to lack proper LLM span categorization in the Braintrust UI.
What is missing
1. These tracers do NOT set braintrust.span_attributes:
trace/contrib/openai/chatcompletions.go — chatCompletionsTracer.StartSpan() (line 38): no span_attributes set
trace/contrib/openai/responses.go — responsesTracer.StartSpan() (line 39): no span_attributes set
trace/contrib/anthropic/messages.go — messagesTracer.StartSpan() (line 38): no span_attributes set
2. These tracers DO correctly set it:
| Integration |
File |
Line |
| OpenAI embeddings |
trace/contrib/openai/embeddings.go |
40 |
| Gemini generateContent |
trace/contrib/genai/generatecontent.go |
121 |
| Gemini embedContent |
trace/contrib/genai/embedcontent.go |
41 |
| Genkit generate |
trace/contrib/genkit/tracegenkit.go |
77 |
| Genkit embedder |
trace/contrib/genkit/embedder.go |
116 |
| LangChainGo LLM |
trace/contrib/langchaingo/tracelangchaingo.go |
207 |
| LangChainGo embedder |
trace/contrib/langchaingo/embedder.go |
134 |
| Eino model |
trace/contrib/cloudwego/eino/traceeino.go |
124 |
| Eino embedding |
trace/contrib/cloudwego/eino/traceeino.go |
179 |
| ADK |
trace/contrib/adk/traceadk.go |
326, 430 |
| Bedrock Converse |
trace/contrib/bedrockruntime/converse.go |
170 |
| Bedrock InvokeModel |
trace/contrib/bedrockruntime/invokemodel.go |
46, 102 |
3. Impact
Per Braintrust's advanced tracing documentation, span_attributes.type = "llm" enables:
- LLM-specific span icons in the UI for easy identification
- The "Try prompt" button in the Braintrust UI
- Proper categorization for LLM-specific monitoring and duration metrics
Without this attribute, OpenAI and Anthropic spans appear as generic spans rather than recognized LLM calls, despite being the most commonly used integrations.
4. The fix is straightforward
Add this call in each tracer's StartSpan method, matching the pattern used by all other integrations:
if err := internal.SetJSONAttr(span, "braintrust.span_attributes", map[string]string{"type": "llm"}); err != nil {
return ctx, span, err
}
Braintrust docs status
Braintrust's advanced tracing docs explicitly document span_attributes.type as a recognized attribute with "llm" as a valid value that enables LLM-specific UI features. Status: supported.
Upstream sources
- This is an internal consistency issue, not an upstream API gap. The
braintrust.span_attributes attribute is a Braintrust convention used across all other integrations in this repository.
Braintrust docs sources
Local repo files inspected
trace/contrib/openai/chatcompletions.go — StartSpan() method: no span_attributes set
trace/contrib/openai/responses.go — StartSpan() method: no span_attributes set
trace/contrib/anthropic/messages.go — StartSpan() method: no span_attributes set
trace/contrib/openai/embeddings.go — correctly sets span_attributes at line 40
- All other integration files listed in the table above — all correctly set
span_attributes
Summary
The OpenAI chat completions tracer, OpenAI Responses API tracer, and Anthropic messages tracer do not set
braintrust.span_attributeswith{"type": "llm"}on their spans. Every other integration in the repository correctly sets this attribute. This causes spans from the three highest-traffic integrations to lack proper LLM span categorization in the Braintrust UI.What is missing
1. These tracers do NOT set
braintrust.span_attributes:trace/contrib/openai/chatcompletions.go—chatCompletionsTracer.StartSpan()(line 38): nospan_attributessettrace/contrib/openai/responses.go—responsesTracer.StartSpan()(line 39): nospan_attributessettrace/contrib/anthropic/messages.go—messagesTracer.StartSpan()(line 38): nospan_attributesset2. These tracers DO correctly set it:
trace/contrib/openai/embeddings.gotrace/contrib/genai/generatecontent.gotrace/contrib/genai/embedcontent.gotrace/contrib/genkit/tracegenkit.gotrace/contrib/genkit/embedder.gotrace/contrib/langchaingo/tracelangchaingo.gotrace/contrib/langchaingo/embedder.gotrace/contrib/cloudwego/eino/traceeino.gotrace/contrib/cloudwego/eino/traceeino.gotrace/contrib/adk/traceadk.gotrace/contrib/bedrockruntime/converse.gotrace/contrib/bedrockruntime/invokemodel.go3. Impact
Per Braintrust's advanced tracing documentation,
span_attributes.type = "llm"enables:Without this attribute, OpenAI and Anthropic spans appear as generic spans rather than recognized LLM calls, despite being the most commonly used integrations.
4. The fix is straightforward
Add this call in each tracer's
StartSpanmethod, matching the pattern used by all other integrations:Braintrust docs status
Braintrust's advanced tracing docs explicitly document
span_attributes.typeas a recognized attribute with"llm"as a valid value that enables LLM-specific UI features. Status: supported.Upstream sources
braintrust.span_attributesattribute is a Braintrust convention used across all other integrations in this repository.Braintrust docs sources
span_attributes.typevalues including"llm","tool","score","function","eval","task","review"Local repo files inspected
trace/contrib/openai/chatcompletions.go—StartSpan()method: nospan_attributessettrace/contrib/openai/responses.go—StartSpan()method: nospan_attributessettrace/contrib/anthropic/messages.go—StartSpan()method: nospan_attributessettrace/contrib/openai/embeddings.go— correctly setsspan_attributesat line 40span_attributes