🚀 Feature: Instrument the new google genai library
Which component is this feature for?
Google Generative AI Instrumentation
🔖 Feature description
We need a separate package, perhaps opentelemetry-instrumentation-genai to instrument google's newer google-genai SDK.
- https://pypi.org/project/google-genai/
- https://discuss.ai.google.dev/t/google-generativeai-vs-python-genai/53873/
🎤 Why is this feature needed ?
As per discussion link [2] above, the library will eventually replace the older lower-level APIs.
✌️ How do you aim to achieve this?
By creating a separate instrumentation library
🔄️ Additional Information
No response
👀 Have you spent some time to check if this feature request has been raised before?
- [x] I checked and didn't find similar issue
Are you willing to submit PR?
None
@nirga actually I am willing to submit a PR, but have no time to do this now. So I am happy if somebody else in the community picks this up.
Also, how does this align with #2456? Should the new library already send just events or should we start with attributes for now?
@dinmukhamedm for #2456 the goal is to start sending both events and attributes to align with approved otel semantic conventions while easing migration. In the long term, we might have a mechanism in the SDK to translate events -> attributes. That way, the instrumentations themselves can be aligned with semantic conventions (emitting events) while the SDK keeps the way we work today (which is better IMO 😅 ).
I am also in need of this!
Note that there is an instrumentation for the Google Gen AI SDK in the Open Telemetry Python Contrib repo:
https://github.com/open-telemetry/opentelemetry-python-contrib/tree/main/instrumentation-genai/opentelemetry-instrumentation-google-genai
Closing in favour of existing instrumentation that wraps some methods and the contrib implementation that works with log events