Parent issue: #69
Summary
The OpenAI middleware tracers do not set the braintrust.span_attributes OTel attribute with type: "llm" on their spans, so OpenAI spans are not classified as LLM spans in the Braintrust UI.
Affected tracers
trace/contrib/openai/chatcompletions.go
trace/contrib/openai/responses.go
Expected behavior
Both tracers should set:
internal.SetJSONAttr(span, "braintrust.span_attributes", map[string]string{"type": "llm"})
Why this matters
Per https://www.braintrust.dev/docs/instrument/advanced-tracing, span_attributes.type = "llm" enables the LLM icon, LLM duration metrics, and the "Try prompt" feature in the Braintrust UI.
Acceptance criteria
- OpenAI Chat Completions tracer sets
braintrust.span_attributes with type: "llm"
- OpenAI Responses tracer sets
braintrust.span_attributes with type: "llm"
- Tests verify the attribute is actually present on emitted spans rather than hardcoding the expected value
Parent issue: #69
Summary
The OpenAI middleware tracers do not set the
braintrust.span_attributesOTel attribute withtype: "llm"on their spans, so OpenAI spans are not classified as LLM spans in the Braintrust UI.Affected tracers
trace/contrib/openai/chatcompletions.gotrace/contrib/openai/responses.goExpected behavior
Both tracers should set:
Why this matters
Per https://www.braintrust.dev/docs/instrument/advanced-tracing,
span_attributes.type = "llm"enables the LLM icon, LLM duration metrics, and the "Try prompt" feature in the Braintrust UI.Acceptance criteria
braintrust.span_attributeswithtype: "llm"braintrust.span_attributeswithtype: "llm"