Skip to content
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

Initial version of instrumentation for the Google GenAI SDK (github.com/googleapis/python-genai) #3256

Open
wants to merge 65 commits into
base: main
Choose a base branch
from

Conversation

michaelsafyan
Copy link
Contributor

Description

Adds an opentelemetry-instrumentation-google-genai package to instrument github.com/googleapis/python-genai.

This initial version targets just Client.models.generate_content. There is partial implementation of instrumentation for the streaming and async variants of this function, but enabling it is deferred to a separate PR (we should hammer out the basics in this PR first before writing all the tests for the other cases and fully debugging those).

Does not include other methods (e.g. embedding generation, for example) in the scope. Also does not include in the scope vendor-specific properties that would be useful for this component at this time. (For example, it would be useful to record safety settings and safety ratings, but this is left out of scope for now). This is done to avoid entangling with resolving Semantic Conventions considerations as well as to keep the current work scope narrow.

We will no doubt want to build on this PR in subsequent PRs to round out the instrumentation package.

Type of change

  • New feature (non-breaking change which adds functionality)
  • This change requires a documentation update

How Has This Been Tested?

Created unit tests.

Does This PR Require a Core Repo Change?

I'm not sure what this means.

Checklist:

I could use some help with the checklist items, as I am new to this repo and the associated tooling.

@michaelsafyan
Copy link
Contributor Author

Filed corresponding feature request to be able to connect to that FR and also to lay out the broader plan beyond this initial PR:

#3260

Copy link
Member

@aabmass aabmass left a comment

Choose a reason for hiding this comment

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

There is a list of remaining todos in this PR. I'm OK to go ahead with this and loop back on stuff in there. I will take a stab at moving this to VCR.py in a future PR as well.

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.

10 participants