Skip to content

Include more request configuration options into the span attributes for the Google GenAI SDK instrumentation #3374

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

Merged

Conversation

michaelsafyan
Copy link
Contributor

@michaelsafyan michaelsafyan commented Mar 19, 2025

Description

Improves the comprehensiveness and uniformity of reporting span-level attributes for Google GenAI SDK operations.

This essentially dumps all of the configuration options into span attributes, with a vendor-specific prefix. The subset of request options that are defined in OTel Semantic Conventions are then renamed to match conventions.

In service of the above, this change also:

  1. Adds a flatten_dict util used to generate the span attributes.
  2. Adds tests to more fully cover the set of attributes that are included.

Type of change

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

How Has This Been Tested?

Added more integration tests, covering the relevant changes.

Does This PR Require a Core Repo Change?

  • No.

Checklist:

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

@michaelsafyan
Copy link
Contributor Author

Friendly ping. Is it possible to get this reviewed?

@michaelsafyan
Copy link
Contributor Author

There is still conversation in SemConv PR 2125 (open-telemetry/semantic-conventions#2125) related to defining the Semantic Conventions for this change. However, I think it would be good to get this in at this time and then circle back if additional changes are required to minimize risk of merge conflicts / bit rotting.

@aabmass aabmass merged commit 369a9f2 into open-telemetry:main Apr 23, 2025
720 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.