Skip to content

Add support for OpenAI client 0.22 to 0.31#564

Merged
JonasKunz merged 4 commits into
elastic:mainfrom
JonasKunz:openai-upgrade
Mar 5, 2025
Merged

Add support for OpenAI client 0.22 to 0.31#564
JonasKunz merged 4 commits into
elastic:mainfrom
JonasKunz:openai-upgrade

Conversation

@JonasKunz

Copy link
Copy Markdown
Contributor

These versions

  • added some new methods in the chat-completion and embeddings API which we don't trace for now, but therefore require dynamic proxying
  • removed the Exception from the close() signature, which fortunately for us is a bytecode-backwards compatible change

I don't think we need to check and add those new methods to our instrumentation now, we should revisit when the OpenAI client is out of beta. Currently there are almost weekly releases changing things, which would just cause too much of an overhead for us.

@JonasKunz
JonasKunz requested a review from a team March 5, 2025 09:38

@SylvainJuge SylvainJuge left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

LGTM, are those methods already covered by existing tests ?

Also, not directly related but should we think about adding the base version of the target library in the instrumentation module name to align with upstream ? I vaguely remember we already talked about it but don't recall what the conclusion was.

@JonasKunz

Copy link
Copy Markdown
Contributor Author

Also, not directly related but should we think about adding the base version of the target library in the instrumentation module name to align with upstream ? I vaguely remember we already talked about it but don't recall what the conclusion was.

Wasn't this just about the package names? We added the supported base versions there.

are those methods already covered by existing tests

Our instrumented methods are, yes. The ones we don't instrument are not, but the proxying mechanism itself is tested.

@JonasKunz
JonasKunz merged commit 701d28b into elastic:main Mar 5, 2025

@codefromthecrypt codefromthecrypt left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Thanks for the continued drift management!

@SylvainJuge SylvainJuge added the enhancement New feature or request label Mar 26, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

agent-java enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants