Skip to content

Conversation

@bignoncedric
Copy link

This pull request adds the support to Azure OpenAI client in addition to the existing support of the vanilla OpenAI client.

Fixes issue #18280

Copilot AI review requested due to automatic review settings November 21, 2025 10:43
Copilot finished reviewing on behalf of bignoncedric November 21, 2025 10:46
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This pull request adds tracing support for the Azure OpenAI client in addition to the existing OpenAI client support, resolving issue #18280.

Key Changes:

  • Extended the OpenAI instrumentation to also patch AzureOpenAI client constructor
  • Added test coverage for Azure OpenAI client in both default and v6 test suites

Reviewed Changes

Copilot reviewed 5 out of 5 changed files in this pull request and generated 4 comments.

Show a summary per file
File Description
packages/node/src/integrations/tracing/openai/instrumentation.ts Refactored patching logic to support both OpenAI and AzureOpenAI clients by extracting common wrapping logic into a reusable _patchClient method
dev-packages/node-integration-tests/suites/tracing/openai/v6/test.ts Added test case for Azure OpenAI client with v6 OpenAI SDK
dev-packages/node-integration-tests/suites/tracing/openai/v6/scenario-azure-openai.mjs Created test scenario that instantiates and uses AzureOpenAI client with mock server for v6
dev-packages/node-integration-tests/suites/tracing/openai/test.ts Added test case for Azure OpenAI client with default OpenAI SDK version
dev-packages/node-integration-tests/suites/tracing/openai/scenario-azure-openai.mjs Created test scenario that instantiates and uses AzureOpenAI client with mock server

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Copy link
Member

@RulaKhaled RulaKhaled left a comment

Choose a reason for hiding this comment

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

Very nice, thanks for contributing!

As an improvement, we soon will tweak this a little to allow users to differentiate between azure and vanilla openai, but this is fine for now.

@bignoncedric
Copy link
Author

Very nice, thanks for contributing!

As an improvement, we soon will tweak this a little to allow users to differentiate between azure and vanilla openai, but this is fine for now.

I’m not sure how to move forward with this PR. There are what I believe to be random test failures.

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants