-
Notifications
You must be signed in to change notification settings - Fork 798
Open
Labels
Description
What problem do you want to solve?
It would be ideal to have automatic instrumentation for the github.com/googleapis/python-genai
(PyPi: google-genai
) package.
Describe the solution you'd like
A subpackage like instrumentation-genai/opentelemetry-instrumentation-vertexai
, except for google-genai
.
I have already drafted an initial PR for this that covers a portion of the API surface here:
If submitted, logical next steps would be:
- Adding support for streaming and async variants of
generate_content
- Registering the package with
opentelemetry-contrib-instrumentations
- Defining OTel SemConv for request/response information not currently defined in OTel SemConv
- Adding instrumentation/recording for these additional attributes of the request/response
- Extending the logic to also cover other methods (e.g. generating embeddings)
Describe alternatives you've considered
Work with owners of github.com/googleapis/python-genai to bake-in the instrumentation in that repository.
I have privately discussed this alternative with the owners and believe, based on that conversation, that it would be better for the time being to pursue instrumentation in the Open Telemetry Python Contrib repository, instead.
Additional Context
No response
Would you like to implement a fix?
Yes