Update openai instrumentation to use Logs API instead of the deprecated events API#3628
Merged
Conversation
Contributor
Author
|
Tests passing now |
Contributor
Author
|
ACtually before this goes in I think we need to update the SDK Logger to attach the resource to the LogRecord like the SDK EventLogger does: https://github.com/open-telemetry/opentelemetry-python/blob/main/opentelemetry-sdk/src/opentelemetry/sdk/_logs/_internal/__init__.py#L654-L764 |
Contributor
Author
|
Ok in the latest upstream version resource is now attached by the logger in We can go forward with this PR. |
xrmx
reviewed
Oct 8, 2025
xrmx
reviewed
Oct 8, 2025
emdneto
reviewed
Oct 9, 2025
emdneto
reviewed
Oct 9, 2025
xrmx
reviewed
Oct 10, 2025
xrmx
approved these changes
Oct 10, 2025
…thon-contrib into fix_openai
sightseeker
added a commit
to sightseeker/opentelemetry-python-contrib
that referenced
this pull request
Mar 11, 2026
…ated events API (open-telemetry#3628) * Initial Commit removing deprecated events stuff from openai * Fix tests * Add changelog * Fix requirment version, update changelog * Update dependency versions to capture latest change.. * Upgrade test dependencies * Add changelog * Respond to commnets and update examples * Change >= to ~= --------- Co-authored-by: Riccardo Magliocchetti <riccardo.magliocchetti@gmail.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
Move
openaiinstrumentation from the deprecated events API to the logs API. Also update all gen ai code examples to stop using events.Type of change
Please delete options that are not relevant.
How Has This Been Tested?
I've updated the existing unit tests to all pass.
Does This PR Require a Core Repo Change?
Checklist:
See contributing.md for styleguide, changelog guidelines, and more.