375 Commits

Author SHA1 Message Date
4a21b3974b resource-dector-container: package rename to opentelemetry-resource-detector-containerid (#3536)
* resource-dector-container: package rename

Signed-off-by: emdneto <9735060+emdneto@users.noreply.github.com>

* fix ruff

Signed-off-by: emdneto <9735060+emdneto@users.noreply.github.com>

* change entrypoint

Signed-off-by: emdneto <9735060+emdneto@users.noreply.github.com>

* fix

Signed-off-by: emdneto <9735060+emdneto@users.noreply.github.com>

* fix test

Signed-off-by: emdneto <9735060+emdneto@users.noreply.github.com>

* fix for entrypoint name

Signed-off-by: emdneto <9735060+emdneto@users.noreply.github.com>

* add changelog

Signed-off-by: emdneto <9735060+emdneto@users.noreply.github.com>

---------

Signed-off-by: emdneto <9735060+emdneto@users.noreply.github.com>
2025-06-04 10:41:38 +02:00
701d65b022 feat: support batch (getmany) in aiokafka instrumentation (#3257)
* feat: support batch (getmany) in aiokafka instrumentation

* test: fix unclosed resources and typing

* test: add test_wrap_getmany

* fix: get unique topic list in batch

* fix: update typing, run pyupgrade

* fix: remove json.dumps from SERVER_ADDRESS attribute

* fix pylint

* fix: sync span_kind with spec

* add CHANGELOG entry

* remove changes not from this issue

* move types under TYPE_CHECKING

* move CHANGELOG entry to unreleased

* enable pyright for aiokafka, fix key type

* Update CHANGELOG.md

---------

Co-authored-by: Riccardo Magliocchetti <riccardo.magliocchetti@gmail.com>
Co-authored-by: Emídio Neto <9735060+emdneto@users.noreply.github.com>
2025-06-03 13:52:00 +00:00
a164d37a3c Chore: Drop support for Python 3.8 (#3399)
Python 3.8 was EoL @ 2024-10-07, our 6 month promise for support ended on 2024-04-07.

Changes:
* Updated basline refs to 3.9
* Removed 3.8 sys.version_info checks
* Fixed botocore test failure
* Applied ruff formatting
2025-05-27 17:26:02 +02:00
0ea9998c4c Add asyncclick instrumentation (#3319)
* Add asyncclick instrumentation

* Add instrumentation for asyncclick based CLI apps
* Add tox
* Add Changelog
* Update workflows

This implementation is based on the original click instrumentation work by:
- Emídio Neto <9735060+emdneto@users.noreply.github.com>
- Anuraag (Rag) Agrawal <anuraaga@gmail.com>
- Riccardo Magliocchetti <riccardo.magliocchetti@gmail.com>

* Update CHANGELOG.md

Co-authored-by: Emídio Neto <9735060+emdneto@users.noreply.github.com>

* Fix async refs in code-block example

---------

Co-authored-by: Emídio Neto <9735060+emdneto@users.noreply.github.com>
2025-03-28 12:20:29 +01:00
c6c0162cef Loosen opentelemetry-instrumentation-starlette[instruments] specifier (#3304)
* Loosen `opentelemetry-instrumentation-starlette[instruments]` specifier

* Compile locked requirements with uv

* Update comment for clarity

* Generate for python 3.8+

* Update package.py as well

* generate

* Oops, undo accidental change to starlette version

* Update uv pip compile command to remove core repo git SHAs and absolute paths
2025-03-03 20:22:57 +00:00
c09a299010 Initial version of instrumentation for the Google GenAI SDK (github.com/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 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>
2025-02-27 11:37:40 -05:00
72490eafcd Fix uv setup when using tox (#3282)
* Update core_contrib_test_0.yml

* add tox-uv.toml to ignore sources

Signed-off-by: emdneto <9735060+emdneto@users.noreply.github.com>

* revert workflows change

Signed-off-by: emdneto <9735060+emdneto@users.noreply.github.com>

* add aws xray propagator to show it works

Signed-off-by: emdneto <9735060+emdneto@users.noreply.github.com>

* add genai

Signed-off-by: emdneto <9735060+emdneto@users.noreply.github.com>

---------

Signed-off-by: emdneto <9735060+emdneto@users.noreply.github.com>
2025-02-21 16:26:46 +00:00
0cb9ba55e8 [chore] Replace '-0' and '-1' with semantically meaningful suffixes. Other minor fixes in 'instrumentation-genai' test structure. (#3268)
* Replace '-0' and '-1' with semantically meaningful suffixes.

* Act on feedback in PR 3268.

* Fix typos.
2025-02-19 16:25:07 +01:00
95873604ab botocore: add bedrock genai user events and lazy initialize tracers and event loggers (#3258)
* 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>
2025-02-13 10:08:24 +01:00
5478a0b77a Add pymssql instrumentation (#394)
* Add pymssql instrumentation

* Run tox -e generate

* tox -e generate-workflows

---------

Co-authored-by: Riccardo Magliocchetti <riccardo.magliocchetti@gmail.com>
2025-01-27 16:12:21 +01:00
ec3c51dcd1 Added Vertex AI spans for request parameters (#3192)
* Added Vertex AI spans for request parameters

* small fixes, get CI passing

* Use standard OTel tracing error handling

* move nested util

* Actually use GAPIC client since thats what we use under the hood

Also this is what LangChain uses

* Comment out seed for now

* Remove unnecessary dict.get() calls

* Typing improvements to check that we support both v1 and v1beta1

* Add more teest cases for error conditions and fix span name bug

* fix typing

* Add todos for error.type
2025-01-22 13:32:34 -05:00
3f50c08580 psycopg2-binary support (#3186)
* psycopg2-binary support

* changelog

* Update CHANGELOG.md

* Update pyproject.toml

* fix

* lint

* added test config

* Update bootstrap_gen.py

* update tox

* Update tox.ini

* regenerate workflows

* workflows

---------

Co-authored-by: Emídio Neto <9735060+emdneto@users.noreply.github.com>
Co-authored-by: Riccardo Magliocchetti <riccardo.magliocchetti@gmail.com>
2025-01-21 15:41:56 -05:00
9460773e5c Basic instrumentation for Bedrock runtime Converse api (#3161)
* botocore: add extension for bedrock runtime api

* Add tests and handle only non streaming responses

* Make it explicit we are handling only the converse operation

* Simplify test since all models behaves the same

* Add test for error case and rework things a bit

* Add converse example

* Generate workflows

* Add changelog
2025-01-20 09:56:09 +01:00
9b217bb4ff introducing tox-uv for real (#3185)
Signed-off-by: emdneto <9735060+emdneto@users.noreply.github.com>
2025-01-17 17:33:52 +01:00
9d9353d4c6 Run pyright on Vertex AI instrumentation (#3184) 2025-01-16 14:25:35 -05:00
406707b2bd Add type checker (#3116) 2025-01-13 09:20:33 -08:00
54882871b9 add official support to Python 3.13 (#3134)
* add py313 to tox

Signed-off-by: emdneto <9735060+emdneto@users.noreply.github.com>

* fix wrong identation troveclassifiers

Signed-off-by: emdneto <9735060+emdneto@users.noreply.github.com>

* fix pyramid, django

Signed-off-by: emdneto <9735060+emdneto@users.noreply.github.com>

* fix httpx

Signed-off-by: emdneto <9735060+emdneto@users.noreply.github.com>

* fix httpx, grpc and add vertex

Signed-off-by: emdneto <9735060+emdneto@users.noreply.github.com>

* generate-workflows

Signed-off-by: emdneto <9735060+emdneto@users.noreply.github.com>

* fix generate-workflows

Signed-off-by: emdneto <9735060+emdneto@users.noreply.github.com>

* fix celery and psycopg

Signed-off-by: emdneto <9735060+emdneto@users.noreply.github.com>

* add changelog

Signed-off-by: emdneto <9735060+emdneto@users.noreply.github.com>

* Update CHANGELOG.md

* Update tox.ini

---------

Signed-off-by: emdneto <9735060+emdneto@users.noreply.github.com>
Co-authored-by: Riccardo Magliocchetti <riccardo.magliocchetti@gmail.com>
2024-12-31 16:08:20 +00:00
2176e3e43e opentelemetry-instrumentation-falcon: expand supported version to v4 (#3086)
* opentelemetry-instrumentation-falcon: expand supported version to v4

Falcon v4 has a mostly identical interface to v3, and is proved to be fully compatible with `opentelemetry-instrumentation-falcon`. Loose the version check to `<5.0.0` to avoid false `DependencyConflict` alarm.

* opentelemetry-instrumentation-falcon: generate tests for v4

* opentelemetry-instrumentation-falcon: prepare tests for v4

* opentelemetry-instrumentation-falcon: add test preset for `~=3.1.2`

* docs: add changelog for Falcon v4 instrumentation

* opentelemetry-instrumentation-falcon: adjust pylint mark for v4

* _has_fixed_http_target property

Signed-off-by: emdneto <9735060+emdneto@users.noreply.github.com>

* move changelog to the correct section

Signed-off-by: emdneto <9735060+emdneto@users.noreply.github.com>

* fix test and bootstrap_gen

Signed-off-by: emdneto <9735060+emdneto@users.noreply.github.com>

---------

Signed-off-by: emdneto <9735060+emdneto@users.noreply.github.com>
Co-authored-by: emdneto <9735060+emdneto@users.noreply.github.com>
2024-12-23 17:34:48 +00:00
77708cd7dd grpc: bump grpcio version in test-requirements (#3140)
* grpc: bump grpcio version in test-requirements

Signed-off-by: emdneto <9735060+emdneto@users.noreply.github.com>

* keep 1.62.0 test

Signed-off-by: emdneto <9735060+emdneto@users.noreply.github.com>

* fix toxini

Signed-off-by: emdneto <9735060+emdneto@users.noreply.github.com>

---------

Signed-off-by: emdneto <9735060+emdneto@users.noreply.github.com>
2024-12-23 13:36:12 +01:00
73ecf39517 sqlalchemy: bump greenlet version in test requirements and use last requirement file for lint (#3139)
Signed-off-by: emdneto <9735060+emdneto@users.noreply.github.com>
Co-authored-by: Riccardo Magliocchetti <riccardo.magliocchetti@gmail.com>
2024-12-23 10:09:27 +00:00
72576f65e0 Vertex AI instrumentation boilerplate (#3123)
* Vertex AI boilerplate copied from openai-v2

* tox.ini boilerplate

* tox -e generate,generate-workflows
2024-12-21 23:45:53 +00:00
59ecd4d608 infra: improve tox for local development (#2999)
* move pip install from command to deps

Signed-off-by: emdneto <9735060+emdneto@users.noreply.github.com>

* add docker-test-requirements.txt

Signed-off-by: emdneto <9735060+emdneto@users.noreply.github.com>

* fix celery and docs

Signed-off-by: emdneto <9735060+emdneto@users.noreply.github.com>

* fix

Signed-off-by: emdneto <9735060+emdneto@users.noreply.github.com>

* fix tox.ini

Signed-off-by: emdneto <9735060+emdneto@users.noreply.github.com>

* update docs

Signed-off-by: emdneto <9735060+emdneto@users.noreply.github.com>

* Update tox.ini

---------

Signed-off-by: emdneto <9735060+emdneto@users.noreply.github.com>
Co-authored-by: Leighton Chen <lechen@microsoft.com>
2024-12-17 14:24:50 +01:00
d330ab3dd0 Add click instrumentation (#2994)
* Add instrumentation for click based CLI apps

Co-authored-by: Anuraag (Rag) Agrawal <anuraaga@gmail.com>

* Add tox

* Add Changelog

* Silence pylint

* Update tox.ini

Co-authored-by: Emídio Neto <9735060+emdneto@users.noreply.github.com>

* Update instrumentation/opentelemetry-instrumentation-click/pyproject.toml

* Add baseline version

* Adhere to new cli span semconv

* Update workflows

---------

Co-authored-by: Anuraag (Rag) Agrawal <anuraaga@gmail.com>
Co-authored-by: Emídio Neto <9735060+emdneto@users.noreply.github.com>
2024-11-27 08:38:38 +00:00
1d8286c08a Update tests to work with SQLAlchemy 2 (#2976) 2024-11-07 15:18:05 -08:00
499548ebbb Test packages that are released individually with lowest versions they support (#2961) 2024-11-07 10:47:19 -08:00
3109724f48 Add genai contributing guidance (#2944) 2024-11-04 06:18:11 -08:00
07c3324a3b OpenAI - update semantic conventions to the latest version, write logs based events instead of span events (#2925) 2024-10-30 14:07:24 -07:00
0adc58b4bf Introducing ruff as linter and formatter (basic setup) (#2921) 2024-10-23 10:54:14 -07:00
beed0aa395 Add Initial Support for Instrumenting OpenAI Python Library - Chat Completion Create (#2759) 2024-10-22 09:21:43 -07:00
e4ece57a81 Remove pkg resources (#2871) 2024-10-19 06:49:08 -07:00
d7d7e96ce5 fix: shellcheck and docker-tests in CI (#2905) 2024-10-15 12:38:03 -07:00
d52f42fb7f feat(opentelemetry-instrumentation-aiokafka): wrap getone instead of anext, add tests (#2874)
* add tests

* add to CHANGELOG

* add tests for baggage

* wrap getone instead of __anext__

* split sync and async tests (fix review)

* add dimastbk to component_owners.yml for aiokafka

* Update CHANGELOG.md

---------

Co-authored-by: Emídio Neto <9735060+emdneto@users.noreply.github.com>
Co-authored-by: Riccardo Magliocchetti <riccardo.magliocchetti@gmail.com>
2024-09-26 13:00:31 +00:00
f8bb28928c Update test requirements for work with Python 3.13 (#2887)
* Added deb to make cassandra tests work with python 3.13

* Bumped cffi to work with Python 3.13

* Fixed some test-requirements for Python 3.13

* Updated typing_extensions everywhere

---------

Co-authored-by: Emídio Neto <9735060+emdneto@users.noreply.github.com>
2024-09-26 08:52:02 +02:00
6fcfbd67b8 tests: fix docker-tests mssql (#2878)
* try new image

* try new image with new pyodbc verrsion
2024-09-23 09:44:07 +02:00
1a39ac80f8 feat: add opentelemetry-instrumentation-aiokafka (#2082) 2024-09-16 12:02:39 -07:00
40c3363e9d bump asgiref to 3.8.1 in test-requirements (#2841)
Co-authored-by: Riccardo Magliocchetti <riccardo.magliocchetti@gmail.com>
2024-09-03 13:28:53 -06:00
c238af5442 fix: fastapi auto-instrumentation by removing fastapi-slim support (#2783) 2024-08-08 08:45:00 -07:00
f0d8cb39e9 Generate workflow files with a Jinja template (#2687)
* Generate workflow files with a Jinja template

Fixes #2686

* Remove sudo from allowlist_externals

* Update workflows

* Add condition to skip generate-workflows

* Update workflows

* Update .github/workflows/generate_workflows_lib/src/generate_workflows_lib/test.yml.j2

Co-authored-by: Emídio Neto <9735060+emdneto@users.noreply.github.com>

* Update .github/workflows/generate_workflows_lib/src/generate_workflows_lib/misc.yml.j2

Co-authored-by: Emídio Neto <9735060+emdneto@users.noreply.github.com>

* Update .github/workflows/generate_workflows_lib/src/generate_workflows_lib/lint.yml.j2

Co-authored-by: Emídio Neto <9735060+emdneto@users.noreply.github.com>

* Update .github/workflows/generate_workflows_lib/src/generate_workflows_lib/contrib.yml.j2

Co-authored-by: Emídio Neto <9735060+emdneto@users.noreply.github.com>

* Update workflows

* Update workflows

---------

Co-authored-by: Emídio Neto <9735060+emdneto@users.noreply.github.com>
2024-08-06 16:27:38 -06:00
aeac52301a tox: run tests for real for fastapislim (#2771) 2024-08-05 09:45:13 -07:00
265490fc78 kafka-python Instrument temporary fork, kafka-python-ng inside kafka-python's instrumentation (#2537)
* Instrument temporary fork, kafka-python-ng inside kafka-python's instrumentation

* Make kafkapython-ng run tests
2024-08-02 12:59:17 -06:00
32e6f6da92 instrumentation/fastapi: fix fastapi-slim support (#2756) 2024-08-01 11:56:41 -07:00
dab664c06e feat(mysql): add support for mysql-connector-python v9 (#2751) 2024-07-31 10:20:08 -07:00
1c8d8ef536 added conditional calling of unary_unary etc functions in _InterceptorChannel (#2484) 2024-07-30 10:26:27 -07:00
38e4ea4a24 Teach fastapi instrumentation about fastapi-slim (#2702) 2024-07-23 09:31:33 -07:00
5a7935ff1f Deprecate sklearn instrumentation (#2708)
Fixes #2176
2024-07-16 14:20:02 -06:00
b1b9be0813 Fix lint-instrumentation-mysqlclient in tox.ini (#2691) 2024-07-10 10:20:44 -07:00
5ff46ac9d1 Move benchmarks outside of tests directory (#2670)
Fixes #2669
2024-07-09 17:17:00 -06:00
3518974d6e Fix typos in tox.ini (#2666) 2024-07-05 13:07:11 -06:00
75faaad986 Remove unnecessary dependencies (#2663)
* Remove unnecessary dependencies

Fixes #2661

* Separate runs

* Remove dev-requirements from test environment

* Try without negative if

* Remove positive if

* Remove if

* Separate benchmark-containing packages in another file

* Add missing test-requirements.txt file
2024-07-04 16:04:53 -06:00
a9247774c4 Point pylint to the package root directories (#2658)
* Point pylint to the root directories

Fixes #2657

* Use cd with instrumentations

* Do the same for the rest of the components

* Specify pylint configuration file

* Fix tox lint for sio-pika

* Fix commands for util-http and azure detector

* Fix lint for sdk-extension-aws

* Fix lint for opentelemetry-instrumentation

* Fix lint for grpc instrumentation

* Fix lint for opentelemetry-instrumentation
2024-07-03 16:22:00 -06:00