Skip to content

Commit 085c5d6

Browse files
committed
backport(google-genai): loosen instrumented version restriction
This is a backport of open-telemetry/opentelemetry-python-genai#21 to the v0.7b0 release branch.
1 parent 5f915e7 commit 085c5d6

7 files changed

Lines changed: 11 additions & 7 deletions

File tree

instrumentation-genai/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
| --------------- | ------------------ | --------------- | -------------- |
44
| [opentelemetry-instrumentation-anthropic](./opentelemetry-instrumentation-anthropic) | anthropic >= 0.16.0 | No | development
55
| [opentelemetry-instrumentation-claude-agent-sdk](./opentelemetry-instrumentation-claude-agent-sdk) | claude-agent-sdk >= 0.1.14 | No | development
6-
| [opentelemetry-instrumentation-google-genai](./opentelemetry-instrumentation-google-genai) | google-genai >= 1.0.0 | No | development
6+
| [opentelemetry-instrumentation-google-genai](./opentelemetry-instrumentation-google-genai) | google-genai >= 1.32.0, <3 | No | development
77
| [opentelemetry-instrumentation-langchain](./opentelemetry-instrumentation-langchain) | langchain >= 0.3.21 | No | development
88
| [opentelemetry-instrumentation-openai-agents-v2](./opentelemetry-instrumentation-openai-agents-v2) | openai-agents >= 0.3.3 | No | development
99
| [opentelemetry-instrumentation-openai-v2](./opentelemetry-instrumentation-openai-v2) | openai >= 1.26.0 | Yes | development

instrumentation-genai/opentelemetry-instrumentation-google-genai/CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,10 @@ All notable changes to this project will be documented in this file.
55
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
66
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
77

8+
## [Unreleased]
9+
10+
- Relax version constraint of `google-genai` to allow v2 of that library to be used with the instrumentation library.
11+
812
## Version 0.7b0 (2026-02-20)
913
- Fix bug in how tokens are counted when using the streaming `generateContent` method. ([#4152](https://github.com/open-telemetry/opentelemetry-python-contrib/pull/4152)).
1014
- Add `gen_ai.tool.definitions` attribute to `gen_ai.client.inference.operation.details` log event ([#4142](https://github.com/open-telemetry/opentelemetry-python-contrib/pull/4142)).

instrumentation-genai/opentelemetry-instrumentation-google-genai/pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ dependencies = [
4646
]
4747

4848
[project.optional-dependencies]
49-
instruments = ["google-genai >= 1.32.0"]
49+
instruments = ["google-genai >= 1.32.0, <3"]
5050

5151
[project.entry-points.opentelemetry_instrumentor]
5252
google-genai = "opentelemetry.instrumentation.google_genai:GoogleGenAiSdkInstrumentor"

instrumentation-genai/opentelemetry-instrumentation-google-genai/src/opentelemetry/instrumentation/google_genai/instrumentor.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ def __init__(
4444
# Inherited, abstract function from 'BaseInstrumentor'. Even though 'self' is
4545
# not used in the definition, a method is required per the API contract.
4646
def instrumentation_dependencies(self) -> Collection[str]: # pylint: disable=no-self-use
47-
return ["google-genai>=1.0.0,<2"]
47+
return ["google-genai>=1.32.0,<3"]
4848

4949
def _instrument(self, **kwargs: Any):
5050
tracer_provider = (

instrumentation-genai/opentelemetry-instrumentation-google-genai/src/opentelemetry/instrumentation/google_genai/package.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,4 +12,4 @@
1212
# See the License for the specific language governing permissions and
1313
# limitations under the License.
1414

15-
_instruments = ("google-genai >= 1.0.0",)
15+
_instruments = ("google-genai >= 1.32.0, <3",)

instrumentation-genai/opentelemetry-instrumentation-google-genai/tests/requirements.latest.txt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -40,8 +40,8 @@ pytest==7.4.4
4040
pytest-asyncio==0.21.0
4141
pytest-vcr==1.0.2
4242

43-
google-auth==2.38.0
44-
google-genai==1.32.0
43+
google-auth==2.53.0
44+
google-genai==2.4.0
4545

4646
# Install locally from the folder. This path is relative to the
4747
# root directory, given invocation from "tox" at root level.

uv.lock

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)