diff --git a/packages/server-utils/src/integrations/tracing-channel/openai.ts b/packages/server-utils/src/integrations/tracing-channel/openai.ts index e1498db89e43..b172c6924300 100644 --- a/packages/server-utils/src/integrations/tracing-channel/openai.ts +++ b/packages/server-utils/src/integrations/tracing-channel/openai.ts @@ -29,9 +29,7 @@ const ORIGIN = 'auto.ai.orchestrion.openai'; // Each instrumented `create` method maps to the gen_ai operation its span reports. const INSTRUMENTED_CHANNELS = [ { channel: CHANNELS.OPENAI_CHAT, operation: 'chat' }, - { channel: CHANNELS.OPENAI_RESPONSES, operation: 'chat' }, { channel: CHANNELS.OPENAI_EMBEDDINGS, operation: 'embeddings' }, - { channel: CHANNELS.OPENAI_CONVERSATIONS, operation: 'chat' }, ] as const; /** diff --git a/packages/server-utils/src/orchestrion/config/openai.ts b/packages/server-utils/src/orchestrion/config/openai.ts index e8091003fc58..4d32e45cf2ca 100644 --- a/packages/server-utils/src/orchestrion/config/openai.ts +++ b/packages/server-utils/src/orchestrion/config/openai.ts @@ -11,7 +11,7 @@ export const openaiConfig = [ })), // OpenAI responses API — same `create(body, options)` shape as chat completions. ...['resources/responses/responses.js', 'resources/responses/responses.mjs'].map(filePath => ({ - channelName: 'responses', + channelName: 'chat', module: { name: 'openai', versionRange: '>=4.0.0 <7', filePath }, functionQuery: { className: 'Responses', methodName: 'create', kind: 'Auto' as const }, })), @@ -23,15 +23,15 @@ export const openaiConfig = [ })), // OpenAI conversations API — same `create(body, options)` shape as chat completions. ...['resources/conversations/conversations.js', 'resources/conversations/conversations.mjs'].map(filePath => ({ - channelName: 'conversations', + channelName: 'chat', module: { name: 'openai', versionRange: '>=4.0.0 <7', filePath }, functionQuery: { className: 'Conversations', methodName: 'create', kind: 'Auto' as const }, })), ] satisfies InstrumentationConfig[]; export const openaiChannels = { + // Chat completions, the responses API, and the conversations API all report a `chat` operation with + // identical span handling, so they share one channel. OPENAI_CHAT: 'orchestrion:openai:chat', - OPENAI_RESPONSES: 'orchestrion:openai:responses', OPENAI_EMBEDDINGS: 'orchestrion:openai:embeddings', - OPENAI_CONVERSATIONS: 'orchestrion:openai:conversations', } as const;