Skip to content

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

Merged
aabmass merged 45 commits intoopen-telemetry:mainfrom
michaelsafyan:google_genai_attribute_improvements
Apr 23, 2025
Merged

Include more request configuration options into the span attributes for the Google GenAI SDK instrumentation#3374
aabmass merged 45 commits intoopen-telemetry:mainfrom
michaelsafyan:google_genai_attribute_improvements

Conversation

@michaelsafyan
Copy link
Copy Markdown
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
Copy Markdown
Contributor Author

Friendly ping. Is it possible to get this reviewed?

@michaelsafyan
Copy link
Copy Markdown
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.

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.