Skip to content

Add responses operation value to gen_ai.operation.name#3337

Open
singankit wants to merge 3 commits intoopen-telemetry:mainfrom
singankit:users/singankit/responses_operation
Open

Add responses operation value to gen_ai.operation.name#3337
singankit wants to merge 3 commits intoopen-telemetry:mainfrom
singankit:users/singankit/responses_operation

Conversation

@singankit
Copy link
Contributor

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

  • CONTRIBUTING.md guidelines followed.
  • Change log entry added, according to the guidelines in When to add a changelog entry.
    • If your PR does not need a change log, start the PR title with [chore]
  • Links to the prototypes or existing instrumentations (when adding or changing conventions)

Add support for OpenAI Responses API operation type in the gen_ai.operation.name attribute.
value: "execute_tool"
brief: 'Execute a tool'
stability: development
- id: responses
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think it can be an operation name - there are several operations in responses API:

Image

I think a path forward might be an openai specific attribute that records an API type/version

Copy link
Contributor Author

@singankit singankit Jan 27, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 ?

image

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Adding this screenshot from slack # otel-genai-instrumentation channel for context.

image

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

@singankit singankit requested a review from a team as a code owner January 27, 2026 02:58
@joaopgrassi joaopgrassi moved this from Untriaged to Awaiting codeowners approval in Semantic Conventions Triage Feb 2, 2026
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
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think it should be OpenAI specific, unless we have other cases when there are multiple types of the same API.

Suggested change
- 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.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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']
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

please define strict enum for OpenAI attribute

| `execute_tool` | Execute a tool | ![Development](https://img.shields.io/badge/-development-blue) |
| `generate_content` | Multimodal content generation operation such as [Gemini Generate Content](https://ai.google.dev/api/generate-content) | ![Development](https://img.shields.io/badge/-development-blue) |
| `invoke_agent` | Invoke GenAI agent | ![Development](https://img.shields.io/badge/-development-blue) |
| `responses` | Responses API operation such as [OpenAI Responses API](https://platform.openai.com/docs/api-reference/responses) | ![Development](https://img.shields.io/badge/-development-blue) |
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

probably need to regenerate this file

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Awaiting codeowners approval

Development

Successfully merging this pull request may close these issues.

3 participants