Add responses operation value to gen_ai.operation.name#3337
Add responses operation value to gen_ai.operation.name#3337singankit wants to merge 3 commits intoopen-telemetry:mainfrom
responses operation value to gen_ai.operation.name#3337Conversation
Add support for OpenAI Responses API operation type in the gen_ai.operation.name attribute.
model/gen-ai/registry.yaml
Outdated
| value: "execute_tool" | ||
| brief: 'Execute a tool' | ||
| stability: development | ||
| - id: responses |
There was a problem hiding this comment.
My opinion is that chat completion and responses have very similar operations. Reponses Migration guide also talks about the similarity of features between the two.
If chat-completion is available as an operation in Gen AI Sem Conv can responses be an operation too ?
There was a problem hiding this comment.
I don't think responses should be added in this way. It's the name of one implementation/protocol of a "chat" API. Each provider has one or more. From my perspective, the operation should continue being chat, and if the name of the endpoint needs to be tracked, it can be done in a separate tag.
| The `gen_ai.data_source.id` SHOULD match the identifier used by the GenAI system rather than a name specific to the external storage, such as a database or | ||
| object store. Semantic conventions referencing `gen_ai.data_source.id` MAY also leverage additional attributes, such as `db.*`, to further identify and describe the data source. | ||
| examples: ['H7STPQYOND'] | ||
| - id: gen_ai.api.type |
There was a problem hiding this comment.
I think it should be OpenAI specific, unless we have other cases when there are multiple types of the same API.
| - id: gen_ai.api.type | |
| - id: openai.api.type |
Also, even if there are multiple versions, we might find other means to record it for other systems (e.g. anthropic.api.version = 1 | 2 or gcp.api.protocol = grpc | rest). we actually already do for GCP with gen_ai.system.name = gcp.vertexai | gcp.gemini | gcp.gen_ai.
There was a problem hiding this comment.
could you please also update PR title and description accordingly?
| - id: gen_ai.api.type | ||
| stability: development | ||
| type: string | ||
| brief: The API type or version used for the GenAI operation. |
There was a problem hiding this comment.
I think this should not include version. If you look into OpenAI API they could change version independently of type https://api.openai.com/v1/responses
| note: > | ||
| This attribute is used to distinguish between different API versions or types provided by the same provider | ||
| for similar operations. For example, OpenAI provides both "chat.completions" and "responses" APIs for chat operations. | ||
| examples: ['chat.completions', 'responses', 'completions'] |
There was a problem hiding this comment.
please define strict enum for OpenAI attribute
| | `execute_tool` | Execute a tool |  | | ||
| | `generate_content` | Multimodal content generation operation such as [Gemini Generate Content](https://ai.google.dev/api/generate-content) |  | | ||
| | `invoke_agent` | Invoke GenAI agent |  | | ||
| | `responses` | Responses API operation such as [OpenAI Responses API](https://platform.openai.com/docs/api-reference/responses) |  | |
There was a problem hiding this comment.
probably need to regenerate this file


Add support for OpenAI Responses API operation type in the gen_ai.operation.name attribute.
Fixes #
Changes
Please provide a brief description of the changes here.
Important
Pull requests acceptance are subject to the triage process as described in Issue and PR Triage Management.
PRs that do not follow the guidance above, may be automatically rejected and closed.
Merge requirement checklist
[chore]