gen_ai.input.messages
The chat history provided to the model as an input.
Instrumentations MUST follow Input messages JSON schema. When the attribute is recorded on events, it MUST be recorded in structured form. When recorded on spans, it MAY be recorded as a JSON string if structured format is not supported and SHOULD be recorded in structured form otherwise.
Messages MUST be provided in the order they were sent to the model. Instrumentations MAY provide a way for users to filter or truncate input messages.
> [!Warning] > This attribute is likely to contain sensitive information including user/PII data.
See Recording content on attributes section for more details.
Examples
- [ { "role": "user", "parts": [ { "type": "text", "content": "Weather in Paris?" } ] }, { "role": "assistant", "parts": [ { "type": "tool_call", "id": "call_VSPygqKTWdrhaFErNvMV18Yl", "name": "get_weather", "arguments": { "location": "Paris" } } ] }, { "role": "tool", "parts": [ { "type": "tool_call_response", "id": " call_VSPygqKTWdrhaFErNvMV18Yl", "result": "rainy, 57°F" } ] } ]
Used by
events (1)
- gen_ai.client.inference.operation.details (opt-in)
spans (8)
- span.anthropic.inference.client (opt-in)
- span.aws.bedrock.client (opt-in)
- span.azure.ai.inference.client (opt-in)
- span.gen_ai.inference.client (opt-in)
- span.gen_ai.invoke_agent.client (opt-in)
- span.gen_ai.invoke_agent.internal (opt-in)
- span.gen_ai.invoke_workflow.internal (opt-in)
- span.openai.inference.client (opt-in)
* required on that signal.
History
- v1.42.0deprecated
Moved to the OpenTelemetry GenAI semantic conventions repository.
Added as development.