Skip to content

feat(google-genai): add instrumentation to supplied tool call functions #3446

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 Apr 25, 2025

Description

Enhances the google-genai instrumentation library by automatically adding instrumentation to supplied tool call functions. The instrumentation logic causes supplied tool call functions to emit both spans and log events.

Type of change

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

How Has This Been Tested?

  • Unit tests

Does This PR Require a Core Repo Change?

  • No.

Checklist:

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

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

@michaelsafyan michaelsafyan marked this pull request as ready for review May 5, 2025 19:43
@michaelsafyan
Copy link
Contributor Author

Updated the logic here to record the information only on span attributes and not in log events per feedback out-of-band.

@michaelsafyan michaelsafyan requested a review from aabmass May 19, 2025 16:18
…ai/src/opentelemetry/instrumentation/google_genai/tool_call_wrapper.py
@aabmass aabmass enabled auto-merge (squash) May 19, 2025 18:05
@aabmass aabmass merged commit dbdff31 into open-telemetry:main May 19, 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.

9 participants