Skip to content

Conversation

DylanRussell
Copy link

@DylanRussell DylanRussell commented Jul 9, 2025

Description

Move openai instrumentation from the deprecated events API to the logs API.

Type of change

Please delete options that are not relevant.

  • [x ] Bug fix (non-breaking change which fixes an issue)

How Has This Been Tested?

I've updated the existing unit tests to all pass.

Does This PR Require a Core Repo Change?

  • Yes. - Link to PR:
  • [ x] No.

Checklist:

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

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

@DylanRussell
Copy link
Author

Tests passing now

@DylanRussell
Copy link
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

@@ -812,7 +809,7 @@ def chat_completion_multiple_tools_streaming(


def assert_message_in_logs(log, event_name, expected_content, parent_span):
assert log.log_record.attributes[EventAttributes.EVENT_NAME] == event_name
Copy link
Contributor

Choose a reason for hiding this comment

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

Should we keep it for backward compat?

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.

6 participants