Repository navigation
Conversation
Reuse the bounded warning cache to report rejected telemetry env values without changing any resolution or fallback. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
|
Thanks for your pull request! It looks like this may be your first contribution to a Google open source project. Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA). View this failed invocation of the CLA check for more information. For the most up to date status, view the checks section at the bottom of the pull request. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Please ensure you have read the contribution guide before creating a pull request.
Link to Issue or Description of Change
1. Link to an existing issue (if applicable):
Problem:
Unrecognized values of
ADK_TELEMETRY_SCHEMA_VERSION_OPT_INandOTEL_INSTRUMENTATION_GENAI_CAPTURE_MESSAGE_CONTENTare silently discarded. A typo is indistinguishable from telemetry that was never enabled.Solution:
Apply the bounded-warning shape already used by
_normalize_experimental_features()to both readers. One helper reuses the existing_warnings_cache(deque(maxlen=64)), keyed byenv var=value, and reports the rejected value, fallback, and accepted set. No fallback changes:1/truestill coerces toEVENT_ONLY, empty values stay silent, and documented schema aliases stay silent. No new cache, client, connection, loop, timer, or retained state.Testing Plan
Unit Tests:
pytest -q tests/unittests/telemetry/test_telemetry_context.py tests/unittests/telemetry/test_schema_version.py— 212 passed, 11 pre-existing deprecation warnings. Three new warning cases fail on base source; they cover rejected value, fallback, accepted set, once-per-value deduplication, legacy coercion, empty values, and documented schema aliases.ruff check,pyink --check,isort --check-only, andgit diff --checkpass.Manual End-to-End (E2E) Tests:
Set
ADK_TELEMETRY_SCHEMA_VERSION_OPT_IN=v1andOTEL_INSTRUMENTATION_GENAI_CAPTURE_MESSAGE_CONTENT=SPAN_AND_EVENTS, enableWARNINGlogging, and constructTelemetryConfig(). No model, credential, or network call is needed. Output:Checklist
Additional context
Full
toxmatrix not run locally: this checkout has nouv.lock, and theuv-venv-lock-runnertox plugin is unavailable. The available CPython 3.14 environment ran the same telemetry tests directly.🤖 Generated with Claude Code