opentelemetry-python-contrib icon indicating copy to clipboard operation
opentelemetry-python-contrib copied to clipboard

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

Open michaelsafyan opened this issue 8 months ago • 0 comments
trafficstars

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

  • [X] 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?

  • [X] No.

Checklist:

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

michaelsafyan avatar Mar 19 '25 20:03 michaelsafyan