[chore] Replace '-0' and '-1' with semantically meaningful suffixes. Other minor fixes in 'instrumentation-genai' test structure.#3268
Merged
xrmx merged 5 commits intoopen-telemetry:mainfrom Feb 19, 2025
Conversation
2 tasks
Contributor
Author
|
Note: the feedback on that PR that I'm referring to is this: |
Contributor
Author
|
CC: @aabmass |
aabmass
approved these changes
Feb 13, 2025
Member
aabmass
left a comment
There was a problem hiding this comment.
Thanks! I'd like one more review from other maintainers.
Contributor
|
I think in a diff like this best to use two words and be consistent both in tox and also the requirements names. So, "latest" makes sense, so in both places. For the floor version I suggest using "floor" or similar and also both places. Basically, I think that whatever the two words chosen this PR passes when there are 2 not 4 phrases for the two intents, verified that diffs match renames My 2p |
emdneto
reviewed
Feb 14, 2025
michaelsafyan
added a commit
to michaelsafyan/open-telemetry.opentelemetry-python-contrib
that referenced
this pull request
Feb 18, 2025
emdneto
approved these changes
Feb 18, 2025
xrmx
approved these changes
Feb 19, 2025
Contributor
xrmx
left a comment
There was a problem hiding this comment.
Not a fan of adding copyright headers to requirements files but LGTM
Contributor
|
Updating repo settings to have the proper jobs required to pass |
aabmass
added a commit
that referenced
this pull request
Feb 27, 2025
…om/googleapis/python-genai) (#3256) * Begin instrumentation of GenAI SDK. * Snapshot current state. * Created minimal tests and got first test to pass. * Added test for span attributes. * Ensure that token counts work. * Add more tests. * Make it easy to turn off instrumentation for streaming and async to allow for rapid iteration. * Add licenses and fill out main README.rst. * Add a changelog file. * Fill out 'requirements.txt' and 'README.rst' for the manual instrumentation example. * Add missing exporter dependency for the manual instrumentation example. * Fill out rest of the zero-code example. * Add minimal tests for async, streaming cases. * Update sync test to use indirection on top of 'client.models.generate_content' to simplify test reuse. * Fix ruff check issues. * Add subproject to top-level project build mechanism. * Simplify invocation of pylint. * Fix 'make test' command and lint issues. * Add '.dev' suffix to version per feedback on pull request #3256 * Fix README.rst files for the examples. * Add specific versions for the examples. * Revamp 'make test' to not require local 'tox.ini' configuration. * Extend separators per review comment. Co-authored-by: Riccardo Magliocchetti <riccardo.magliocchetti@gmail.com> * Fix version conflict caused by non-hermetic requirements. * Fix typo on the comment line. * Add test for the use of the 'vertex_ai' system, and improve how this system is determined. * Factor out testing logic to enable sharing with the async code. * Addressed minor lint issues. * Make it clearer that nonstreaming_base is a helper module that is not invoked directly. * Integrate feedback from related pull request #3268. * Update workflows with 'tox -e generate-workflows'. * Improve data model and add some rudimentary type checking. * Accept only 'true' for a true value to align with other code. * Update the scope name used. * Add **kwargs to patched methods to prevent future breakage due to the addition of future keyword arguments. * Remove redundant list conversion in call to "sorted". Co-authored-by: Aaron Abbott <aaronabbott@google.com> * Reformat with 'tox -e ruff'. * Fix failing lint workflow. * Fix failing lint workflow. * Exclude Google GenAI instrumentation from the bootstrap code for now. * Minor improvements to the tooling shell files. * Fix typo flagged by codespell spellchecker. * Increase alignment with broader repo practices. * Add more TODOs and documentation to clarify the intended work scope. * Remove unneeded accessor from OTelWrapper. * Add more comments to the tests. * Reformat with ruff. * Change 'desireable' to 'desirable' per codespell spellchecker. * Make tests pass without pythonpath * Fix new lint errors showing up after change * Revert "Fix new lint errors showing up after change" This reverts commit 567adc6. pylint ignore instead * Add TODO item required/requested from code review. Co-authored-by: Aaron Abbott <aaronabbott@google.com> * Simplify changelog per PR feedback. * Remove square brackets from model name in span name per PR feedback. * Misc test cleanup. Now that scripts are invoked solely through pytest via tox, remove main functions and hash bang lines. * Improve quality of event logging. * Update operation name to use a constant for consistency. * Reformat with ruff. * Exclude opentelemetry-instrumentation-google-genai from root uv workspace Until #3300 is fixed. --------- Co-authored-by: Riccardo Magliocchetti <riccardo.magliocchetti@gmail.com> Co-authored-by: Aaron Abbott <aaronabbott@google.com>
aabmass
added a commit
that referenced
this pull request
Mar 3, 2025
…trumentation (#3298) * Begin instrumentation of GenAI SDK. * Snapshot current state. * Created minimal tests and got first test to pass. * Added test for span attributes. * Ensure that token counts work. * Add more tests. * Make it easy to turn off instrumentation for streaming and async to allow for rapid iteration. * Add licenses and fill out main README.rst. * Add a changelog file. * Fill out 'requirements.txt' and 'README.rst' for the manual instrumentation example. * Add missing exporter dependency for the manual instrumentation example. * Fill out rest of the zero-code example. * Add minimal tests for async, streaming cases. * Update sync test to use indirection on top of 'client.models.generate_content' to simplify test reuse. * Fix ruff check issues. * Add subproject to top-level project build mechanism. * Simplify invocation of pylint. * Fix 'make test' command and lint issues. * Add '.dev' suffix to version per feedback on pull request #3256 * Fix README.rst files for the examples. * Add specific versions for the examples. * Revamp 'make test' to not require local 'tox.ini' configuration. * Extend separators per review comment. Co-authored-by: Riccardo Magliocchetti <riccardo.magliocchetti@gmail.com> * Fix version conflict caused by non-hermetic requirements. * Fix typo on the comment line. * Add test for the use of the 'vertex_ai' system, and improve how this system is determined. * Factor out testing logic to enable sharing with the async code. * Addressed minor lint issues. * Make it clearer that nonstreaming_base is a helper module that is not invoked directly. * Integrate feedback from related pull request #3268. * Update workflows with 'tox -e generate-workflows'. * Improve data model and add some rudimentary type checking. * Accept only 'true' for a true value to align with other code. * Update the scope name used. * Add **kwargs to patched methods to prevent future breakage due to the addition of future keyword arguments. * Remove redundant list conversion in call to "sorted". Co-authored-by: Aaron Abbott <aaronabbott@google.com> * Reformat with 'tox -e ruff'. * Fix failing lint workflow. * Fix failing lint workflow. * Exclude Google GenAI instrumentation from the bootstrap code for now. * Minor improvements to the tooling shell files. * Fix typo flagged by codespell spellchecker. * Increase alignment with broader repo practices. * Add more TODOs and documentation to clarify the intended work scope. * Remove unneeded accessor from OTelWrapper. * Add more comments to the tests. * Reformat with ruff. * Change 'desireable' to 'desirable' per codespell spellchecker. * Make tests pass without pythonpath * Fix new lint errors showing up after change * Revert "Fix new lint errors showing up after change" This reverts commit 567adc6. pylint ignore instead * Add TODO item required/requested from code review. Co-authored-by: Aaron Abbott <aaronabbott@google.com> * Simplify changelog per PR feedback. * Remove square brackets from model name in span name per PR feedback. * Checkpoint current state. * Misc test cleanup. Now that scripts are invoked solely through pytest via tox, remove main functions and hash bang lines. * Improve quality of event logging. * Implement streaming support in RequestsMocker, get tests passing again. * Add test with multiple responses. * Remove support for async and streaming from TODOs, since this is now addressed. * Increase testing coverage for streaming. * Reformat with ruff. * Add minor version bump with changelog. * Change TODOs to bulleted list. * Update per PR feedback Co-authored-by: Aaron Abbott <aaronabbott@google.com> * Restructure streaming async logic to begin execution earlier. * Reformat with ruff. * Disable pylint check for catching broad exception. Should be allowed given exception is re-raised. * Simplify async streaming solution per PR comment. --------- Co-authored-by: Riccardo Magliocchetti <riccardo.magliocchetti@gmail.com> Co-authored-by: Aaron Abbott <aaronabbott@google.com>
6 tasks
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.
Description
This is a follow up item from feedback on:
In particular, the new code proposed here breaks with the existing pattern of adding
-0and-1suffixes in thetox.inifile in favor of more intuitive-old-depsand-recent-depssuffixes, encoding the intended meaning.It was requested on that PR to send a separate PR to make similar updates to the other cases.
This updates the existing
instrumentation-genaipackages to follow a similar pattern. It likewise updates the naming and location of the correspondingrequirements.txtfiles to similarly reflect their meaning. And it adds documentation comments to therequirements.txtfiles that parallel those in that pull request.Type of change
Minor internal structuring, build improvement.
How Has This Been Tested?
Ran
toxto verify that things still build. In particular, ran the following commands:tox -l | grep openai | xargs -n 1 tox -etox -l | grep vertexai | xargs -n 1 tox -eI verified that both
recent-depsandold-depsvariants of each pass for at least one version of Python, verifying that this modification did not induce any breakages in the general build mechanism.Does This PR Require a Core Repo Change?
No
Checklist:
I believe that all checklist items that apply have been followed.