Skip to content

fix(deps): Require otel google-genai instrumentor >=0.7b1 for genai 2.x#6102

Closed
Jacksunwei wants to merge 1 commit into
mainfrom
fix/otel-genai-instrumentor-floor
Closed

fix(deps): Require otel google-genai instrumentor >=0.7b1 for genai 2.x#6102
Jacksunwei wants to merge 1 commit into
mainfrom
fix/otel-genai-instrumentor-floor

Conversation

@Jacksunwei

Copy link
Copy Markdown
Collaborator

Summary

Bump the floor on opentelemetry-instrumentation-google-genai from >=0.6b0 / >=0.3b0 to >=0.7b1 in both the otel-gcp and test extras, so it is compatible with the pinned google-genai>=2.8,<3.

Problem

opentelemetry-instrumentation-google-genai versions before 0.7b1 hardcode a runtime gate in instrumentation_dependencies():

return ["google-genai>=1.0.0,<2"]

This <2 cap is not in the package metadata (which only declares google-genai>=1.0.0), so dependency resolvers happily install e.g. 0.7b0 alongside google-genai 2.8.0. The conflict only surfaces at runtime: instrumentor.instrument() detects the violation, logs a DependencyConflict, and silently no-opsModels.generate_content is never wrapped, so genai telemetry is disabled entirely with no hard error.

This was caught by tests/unittests/telemetry/test_functional.py::test_instrumented_with_opentelemetry_instrumentation_google_genai, which fails with assert False when a pre-0.7b1 instrumentor is resolved (the post-instrument() assertion that the SDK reports as instrumented).

Fix

0.7b1 widens the gate to google-genai>=1.0.0,<3, which 2.8.0 satisfies. The existing floors allowed resolvers to land on a broken version; raising both to >=0.7b1 makes the requirement consistent with the genai 2.8 pin and fail-safe.

Impact

  • Restores google-genai OTel instrumentation for users on genai 2.x with the otel-gcp extra.
  • Prevents the test suite from resolving a broken instrumentor.

Test plan

  • uv.lock already resolved to 0.7b1; no lockfile change needed (only the specifier floor moved).
  • tests/unittests/telemetry/test_functional.py: 6 passed (previously 1 failed: test_instrumented_...).
  • pre-commit (pyproject-fmt) passes.

opentelemetry-instrumentation-google-genai versions before 0.7b1
hardcode an instrumentation_dependencies() gate of "google-genai<2".
Since ADK pins google-genai>=2.8,<3, those older instrumentor versions
silently no-op on instrument() (logging a DependencyConflict) and never
wrap Models.generate_content, disabling genai telemetry entirely.

0.7b1 widened the gate to "<3", making it compatible with genai 2.x.
The existing floors (>=0.6b0 / >=0.3b0) allowed resolvers to land on a
broken version; bump both the otel-gcp and test extras to >=0.7b1 so the
requirement is consistent with the genai 2.8 pin and fail-safe.

Change-Id: I9d7b4d32c7126c9fe0974e3f9d403e46ba85124e
@adk-bot adk-bot added the tracing [Component] This issue is related to OpenTelemetry tracing label Jun 13, 2026
@Jacksunwei Jacksunwei self-assigned this Jun 13, 2026
copybara-service Bot pushed a commit that referenced this pull request Jun 13, 2026
Merge #6102

## Summary

Bump the floor on `opentelemetry-instrumentation-google-genai` from `>=0.6b0` / `>=0.3b0` to `>=0.7b1` in both the `otel-gcp` and `test` extras, so it is compatible with the pinned `google-genai>=2.8,<3`.

## Problem

`opentelemetry-instrumentation-google-genai` versions before `0.7b1` hardcode a runtime gate in `instrumentation_dependencies()`:

```python
return ["google-genai>=1.0.0,<2"]
```

This `<2` cap is **not** in the package metadata (which only declares `google-genai>=1.0.0`), so dependency resolvers happily install e.g. `0.7b0` alongside `google-genai 2.8.0`. The conflict only surfaces at runtime: `instrumentor.instrument()` detects the violation, logs a `DependencyConflict`, and **silently no-ops** — `Models.generate_content` is never wrapped, so genai telemetry is disabled entirely with no hard error.

This was caught by `tests/unittests/telemetry/test_functional.py::test_instrumented_with_opentelemetry_instrumentation_google_genai`, which fails with `assert False` when a pre-`0.7b1` instrumentor is resolved (the post-`instrument()` assertion that the SDK reports as instrumented).

## Fix

`0.7b1` widens the gate to `google-genai>=1.0.0,<3`, which `2.8.0` satisfies. The existing floors allowed resolvers to land on a broken version; raising both to `>=0.7b1` makes the requirement consistent with the genai 2.8 pin and fail-safe.

## Impact

- Restores google-genai OTel instrumentation for users on genai 2.x with the `otel-gcp` extra.
- Prevents the test suite from resolving a broken instrumentor.

## Test plan

- [x] `uv.lock` already resolved to `0.7b1`; no lockfile change needed (only the specifier floor moved).
- [x] `tests/unittests/telemetry/test_functional.py`: 6 passed (previously 1 failed: `test_instrumented_...`).
- [x] pre-commit (`pyproject-fmt`) passes.

Co-authored-by: Wei Sun (Jack) <weisun@google.com>
COPYBARA_INTEGRATE_REVIEW=#6102 from google:fix/otel-genai-instrumentor-floor 8e2154f
PiperOrigin-RevId: 931465846
@adk-bot

adk-bot commented Jun 13, 2026

Copy link
Copy Markdown
Collaborator

Thank you @Jacksunwei for your contribution! 🎉

Your changes have been successfully imported and merged via Copybara in commit 2b8c80c.

Closing this PR as the changes are now in the main branch.

@adk-bot adk-bot added the merged [Status] This PR is merged label Jun 13, 2026
@adk-bot adk-bot closed this Jun 13, 2026
@Jacksunwei Jacksunwei deleted the fix/otel-genai-instrumentor-floor branch June 13, 2026 05:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

merged [Status] This PR is merged tracing [Component] This issue is related to OpenTelemetry tracing

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants