* instrumentation: rename experimental to development in README
To match the current semantic conventions naming.
* Update generate_instrumentation_readme.py
* Update README.md
* Run generate
* Update the README too
Instead of expecting an entry in a specific bucket, just sum all of them
and assert we have the correct number of entries.
Co-authored-by: Shalev Roda <65566801+shalevr@users.noreply.github.com>
* 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 567adc62a706035ad8ac5e29316c7a6f8d4c7909.
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>
* 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 567adc62a706035ad8ac5e29316c7a6f8d4c7909.
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 https://github.com/open-telemetry/opentelemetry-python-contrib/issues/3300 is fixed.
---------
Co-authored-by: Riccardo Magliocchetti <riccardo.magliocchetti@gmail.com>
Co-authored-by: Aaron Abbott <aaronabbott@google.com>
* Update doc for OpenAI Instrumentation to support DeepSeek
* Update with Adrian's comments
Co-authored-by: Adrian Cole <64215+codefromthecrypt@users.noreply.github.com>
* rollback the blankspace remove
---------
Co-authored-by: Adrian Cole <64215+codefromthecrypt@users.noreply.github.com>
Co-authored-by: Shalev Roda <65566801+shalevr@users.noreply.github.com>
* scripts/generate_instrumentation_bootstrap: don't force genai instrumentations versions
Since genai instrumentations are released on their own we cannot have a
fixed required version on this side.
While at it add vertexai to the list of excluded packages since:
- it has not been released yet
- the name is already claimed by openllmetry
* Regenerate bootstrap_gen
* Please spellcheck
---------
Co-authored-by: Leighton Chen <lechen@microsoft.com>
* opentelemetry-instrumentation-system-metrics: add process metrics
Add process metrics as of 1.30.0 semconv to the system metrics instrumentation.
We still keep around the old process.runtime metrics because the semconv
suggest to not break current users. Still discourage their use in the
doc and state explicitly they are deprecated.
* Add Changelog
* Please pylint
* Apply suggestions from code review
* Remove print
* Remove process.count and fix system metrics enumeration in tests
* Cleanup metrics presence assertions
* Don't touch system metrics descriptions
* Add default for num_cpu in case it returns None to avoid division error
* Use UV to install all needed packages locally
* Add opentelemetry-test-utils
* Add asgi and fastapi
* Add more projects, since it helped me
* add urllib
* Add system metrics
* Add dbapi and sqlite3
* Add sqlalchemy
* add pyramid
* Add pymongo
* Add jinja2
* add lock file
* add falcon as well
* Add uv lock to the pre-commit
* Update uv.lock
* Update lockfile
* remove xray test dependencies
* Add otel-sdk to xray
* Update uv version
* Drop xray from the list of packages
---------
Co-authored-by: Emídio Neto <9735060+emdneto@users.noreply.github.com>
Follow-up on the apparently abbandonned https://github.com/open-telemetry/opentelemetry-python-contrib/pull/2114.
The asyncpg instrumentation attempts to fall back on using the database
name as the span name in case the first argument to the instrumented
method is falsey.
This has probably never worked since asyncpg defines the `_params`
attribute as an instance of `ConnectionParams`
(https://github.com/MagicStack/asyncpg/blob/master/asyncpg/connection.py#L62)
which is a NamedTuple instance and thus don't define `get`. The proper
way of safely accessing properties on a NamedTuple is using `getattr`.
The only case that I've actually found which triggers this branch is if
the supplied query is an empty string. This is something that causes an
`AttributeError` for `Connection.execute` but is fine for `fetch()`,
`fetchval()`, `fetchrow()` and `executemany()`.
The tests have been expanded to check these cases. Also, more status
code validation has been added where it was missing.
Co-authored-by: Riccardo Magliocchetti <riccardo.magliocchetti@gmail.com>
* Create per-extension tracers if there's an extension available
* botocore: add user events for bedrock
* Remove pass of AWS env vars from tox.ini
* Remove handling for other types of messages
* Please pylint
* Add changelog
* Update CHANGELOG.md
Co-authored-by: Adrian Cole <64215+codefromthecrypt@users.noreply.github.com>
---------
Co-authored-by: Adrian Cole <64215+codefromthecrypt@users.noreply.github.com>
* Add Vertex gen AI response span attributes
* Vertex response gen_ai.choice events
* Add todo comment
* Update _map_finish_reason() and use it in span attribute as well
* ruff