@sentry/conventions deprecates gen_ai.response.text in favor of gen_ai.output.messages. gen_ai.response.text holds a stringified array of text strings; gen_ai.output.messages expects a stringified array of structured message objects ([{role, parts: [...], finish_reason}]), which unifies response text and tool calls into a single message.
Entails building the structured message format from the response text and emitting it under the new attribute. Affects all AI integrations (OpenAI, Anthropic, Google GenAI, LangChain, LangGraph, Workers AI, and the shared streaming path). Should be done together with the gen_ai.response.tool_calls replacement, since both merge into the same gen_ai.output.messages attribute.
We can likely postpone this until after the major, if we do it at all, since there are still discussions about handling this in Relay.
References:
@sentry/conventionsdeprecatesgen_ai.response.textin favor ofgen_ai.output.messages.gen_ai.response.textholds a stringified array of text strings;gen_ai.output.messagesexpects a stringified array of structured message objects ([{role, parts: [...], finish_reason}]), which unifies response text and tool calls into a single message.Entails building the structured message format from the response text and emitting it under the new attribute. Affects all AI integrations (OpenAI, Anthropic, Google GenAI, LangChain, LangGraph, Workers AI, and the shared streaming path). Should be done together with the
gen_ai.response.tool_callsreplacement, since both merge into the samegen_ai.output.messagesattribute.We can likely postpone this until after the major, if we do it at all, since there are still discussions about handling this in Relay.
References:
gen_ai.response.textgen_ai.output.messages