What problem do you want to solve?
opentelemetry-instrumentation-genai-openai instruments Responses.create() and AsyncResponses.create(), but not Responses.parse() or AsyncResponses.parse().
As a result, applications using the Responses API structured-output helper do not emit a GenAI span:
from openai import AsyncOpenAI
from pydantic import BaseModel
class CalendarEvent(BaseModel):
name: str
date: str
participants: list[str]
client = AsyncOpenAI()
response = await client.responses.parse(
model="gpt-4o-mini",
input="Alice and Bob are going to a science fair on Friday.",
text_format=CalendarEvent,
)
Responses.parse() calls the SDK's request path directly rather than delegating to the instrumented Responses.create() method. Therefore, instrumenting create() does not cover this API.
This differs from chat.completions.parse(), which is already instrumented by #18. That PR explicitly did not change the Responses API path.
I could not find an existing issue or pull request covering Responses.parse() or AsyncResponses.parse().
Describe the solution you'd like
Instrument both methods when they are available in the installed OpenAI SDK:
openai.resources.responses.responses.Responses.parse
openai.resources.responses.responses.AsyncResponses.parse
The implementation could reuse the existing Responses API invocation and response extraction logic used by Responses.create().
Describe alternatives you've considered
No response
Additional Context
openai==3.0.0
opentelemetry-instrumentation-genai-openai==1.0b0
The current instrumentation source also registers Responses API create, stream, and retrieve, but does not register Responses.parse or AsyncResponses.parse.
Would you like to implement it?
None
Tip
React with 👍 to help prioritize this issue. Please use comments to provide useful context, avoiding +1 or me too, to help us triage it. Learn more here.
What problem do you want to solve?
opentelemetry-instrumentation-genai-openaiinstrumentsResponses.create()andAsyncResponses.create(), but notResponses.parse()orAsyncResponses.parse().As a result, applications using the Responses API structured-output helper do not emit a GenAI span:
Responses.parse()calls the SDK's request path directly rather than delegating to the instrumentedResponses.create()method. Therefore, instrumentingcreate()does not cover this API.This differs from
chat.completions.parse(), which is already instrumented by #18. That PR explicitly did not change the Responses API path.I could not find an existing issue or pull request covering
Responses.parse()orAsyncResponses.parse().Describe the solution you'd like
Instrument both methods when they are available in the installed OpenAI SDK:
openai.resources.responses.responses.Responses.parseopenai.resources.responses.responses.AsyncResponses.parseThe implementation could reuse the existing Responses API invocation and response extraction logic used by
Responses.create().Describe alternatives you've considered
No response
Additional Context
openai==3.0.0opentelemetry-instrumentation-genai-openai==1.0b0The current instrumentation source also registers Responses API
create,stream, andretrieve, but does not registerResponses.parseorAsyncResponses.parse.Would you like to implement it?
None
Tip
React with 👍 to help prioritize this issue. Please use comments to provide useful context, avoiding
+1orme too, to help us triage it. Learn more here.