Skip to content

Conversation

@bignoncedric
Copy link
Contributor

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
Contributor 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.

@nicohrubec
Copy link
Member

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

@bignoncedric Some of our tests flake from time to time. I triggered a rerun and now everything passes, so feel free to merge anytime!

@bignoncedric
Copy link
Contributor Author

bignoncedric commented Nov 24, 2025

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

@bignoncedric Some of our tests flake from time to time. I triggered a rerun and now everything passes, so feel free to merge anytime!

I may be lost in GitHub UI, but it looks like I can't merge it. I only see the "Update branch" button.
image

@nicohrubec
Copy link
Member

I may be lost in GitHub UI, but it looks like I can't merge it. I only see the "Update branch" button.

Ah, no you are right my bad. I'll merge this in a sec, thanks for contributing!

@nicohrubec nicohrubec merged commit 5e7cd06 into getsentry:develop Nov 24, 2025
230 of 234 checks passed
nicohrubec added a commit that referenced this pull request Nov 24, 2025
This PR adds the external contributor to the CHANGELOG.md file, so that
they are credited for their contribution. See #18281

Co-authored-by: nicohrubec <29484629+nicohrubec@users.noreply.github.com>
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.

3 participants