Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add Support for Async openai instrumentation #2984

Merged

Conversation

alizenhom
Copy link
Contributor

@alizenhom alizenhom commented Nov 8, 2024

Description

  • Add wrapper around AsyncCompletions.create to instrument async openai functions
  • Adjust StreamWrapper to include __anext__, __aiter__ & __aenter__

Type of change

  • New feature (non-breaking change which adds functionality)

How Has This Been Tested?

  • tox -e py312-test-instrumentation-openai-v2-0
  • tox -e py312-test-instrumentation-openai-v2-1

Does This PR Require a Core Repo Change?

  • No.

Checklist:

See contributing.md for styleguide, changelog guidelines, and more.

  • Followed the style guidelines of this project
  • Changelogs have been updated
  • Unit tests have been added
  • Documentation has been updated

@alizenhom alizenhom requested a review from gyliu513 November 9, 2024 11:56
@alizenhom alizenhom force-pushed the support-async-openai-instrumentation branch from d3f2ad9 to 0dacda8 Compare November 9, 2024 12:05
Copy link
Contributor

@codefromthecrypt codefromthecrypt left a comment

Choose a reason for hiding this comment

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

(non-binding approve)

Looks good with a suggestion on changelog, and assuming the recordings are corrected to the formatting of the others.

codefromthecrypt added a commit to codefromthecrypt/opentelemetry-python-contrib that referenced this pull request Nov 11, 2024
… yaml fixture

Follow-up to open-telemetry#2945
See open-telemetry#2984 (comment)

Signed-off-by: Adrian Cole <adrian.cole@elastic.co>
@gyliu513
Copy link
Member

/lgtm

@alizenhom alizenhom requested a review from xrmx November 13, 2024 12:30
@lzchen lzchen merged commit a6e4a0c into open-telemetry:main Nov 14, 2024
566 checks passed
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.

8 participants