1554 Commits

Author SHA1 Message Date
396aad9c24 celery: remove deprecated import of ContextManager from typing (#3145)
* celery: remove deprecated import of ContextManager from typing

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

* add type checking

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

* ruff

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

---------

Signed-off-by: emdneto <9735060+emdneto@users.noreply.github.com>
2024-12-24 13:55:33 +00:00
375eb6f2cc psycopg: bump versions in test-requirements to support py313 (#3147)
Signed-off-by: emdneto <9735060+emdneto@users.noreply.github.com>
Co-authored-by: Riccardo Magliocchetti <riccardo.magliocchetti@gmail.com>
2024-12-24 13:47:18 +00:00
b03bf0037f asyncpg: bump version in test-requirements (#3146)
Signed-off-by: emdneto <9735060+emdneto@users.noreply.github.com>
2024-12-23 17:47:09 +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
1092344918 Add docstring for instrument_connection() and tests for database drivers (#3108) 2024-12-20 12:24:46 -08:00
54cbf59aae Update package metadata adding "Repository" to project urls (#3119)
Add "Repository" label to project urls pointing to the
opentelemetry-python repo root url.

Having within project urls one entry with the same value for all
packages released by the project will help tools for automatic
dependency management to suggest coherent upgrades for related packages.
2024-12-19 10:15:58 +00:00
52ff7bdd4b feat: Update opentelemetry-instrumentation-confluent-kafka to support confluent-kafka <=2.7.0 (#3100) 2024-12-17 12:33:39 -08:00
6fcaa0a104 Add type hints to Redis (#3110) 2024-12-17 10:40:40 -08:00
cc62d1f05e prepare semconv utilities to support database stability opt-in (#3111) 2024-12-17 09:58:04 -08:00
d155540038 httpx: update type hints to RequestInfo/ResponseInfo (#3105) 2024-12-17 09:43:22 -08:00
37e05aff86 Move starlette's py.typed to the right place (#3103) 2024-12-13 14:53:17 +01:00
490580d6f3 Update version to 1.30.0.dev/0.51b0.dev (#3092) 2024-12-12 11:17:53 +00:00
d2a51b95e5 docs: move AwsLambdaInstrumentor().instrument() to after the lambda function (#3085)
Co-authored-by: Emídio Neto <9735060+emdneto@users.noreply.github.com>
2024-12-11 16:02:37 +01:00
eb03dac1f0 NoOpTracerProvider test case for botocore instrumentation (#3091)
Co-authored-by: Emídio Neto <9735060+emdneto@users.noreply.github.com>
2024-12-11 13:35:50 +00:00
830231092d Update sqlite3 instrumentor doc about explicit cursors (#3088)
* Update sqlite3 instrumentor doc about explicit cursors

* Changelog

---------

Co-authored-by: Riccardo Magliocchetti <riccardo.magliocchetti@gmail.com>
2024-12-11 11:59:21 +00:00
e32aac7b18 Improve SQLite3 example (#3083)
Co-authored-by: Riccardo Magliocchetti <riccardo.magliocchetti@gmail.com>
2024-12-11 11:25:01 +00:00
ecf5529f99 opentelemetry-instrumentation-django: bump to 4.2.17 in test requirements (#3077)
Co-authored-by: Emídio Neto <9735060+emdneto@users.noreply.github.com>
2024-12-09 17:08:17 +00:00
c530f0d98f instrumentation: Bump Werkzeug to 3.0.6 (#3078)
Co-authored-by: Emídio Neto <9735060+emdneto@users.noreply.github.com>
2024-12-09 14:46:44 +01:00
eb394c0b21 opentelemetry-instrumentation-tornado: bump tornado in test requirements (#3079) 2024-12-09 14:31:31 +01:00
6c92f387aa Fix doc formatting issues (#3062)
Co-authored-by: Emídio Neto <9735060+emdneto@users.noreply.github.com>
2024-12-05 13:53:21 +01:00
f393546d4a Add type hints to SQLite3 (#3057)
* Add type hints to SQLite3

* Apply suggestions from code review

* Update instrumentation/opentelemetry-instrumentation-sqlite3/src/opentelemetry/instrumentation/sqlite3/package.py

* This is a type alias, pylint is dumb

---------

Co-authored-by: Emídio Neto <9735060+emdneto@users.noreply.github.com>
Co-authored-by: Aaron Abbott <aaronabbott@google.com>
2024-12-04 14:14:12 +00:00
76170313f1 Fix instrumentation of SQLAlchemy when using sqlalchemy.engine_from_config (#2816)
* wrap sqlalchemy.engine.create.create_engine

sqlalchemy.engine_from_config directly calls create_engine imported from that path; if we don't
wrap that copy of the `create_engine` call then engines created via engine_from_config are not
instrumented.

* add changelog entry

* Update CHANGELOG.md

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

* Update instrumentation/opentelemetry-instrumentation-sqlalchemy/tests/test_sqlalchemy.py

Co-authored-by: Tammy Baylis <96076570+tammy-baylis-swi@users.noreply.github.com>

* make some monkey-patching conditional on the version of SQLAlchemy

* lint

* fix changelog

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

* Update CHANGELOG.md

---------

Signed-off-by: emdneto <9735060+emdneto@users.noreply.github.com>
Co-authored-by: Emídio Neto <9735060+emdneto@users.noreply.github.com>
Co-authored-by: Leighton Chen <lechen@microsoft.com>
Co-authored-by: Shalev Roda <65566801+shalevr@users.noreply.github.com>
Co-authored-by: Tammy Baylis <96076570+tammy-baylis-swi@users.noreply.github.com>
Co-authored-by: Riccardo Magliocchetti <riccardo.magliocchetti@gmail.com>
2024-12-04 10:13:07 +02:00
b6541f0bad Remove references to disposed SQLAlchemy engines from instrumentation singleton (#3053)
* Remove references to SQLAlchemy engines which are disposed of

EngineTracer in SQLAlchemy keeps weak references to a traced engine forever which
can cause a noticeable memory leak if engines are constantly getting creating.

* Updated changelog

---------

Co-authored-by: Emídio Neto <9735060+emdneto@users.noreply.github.com>
Co-authored-by: Riccardo Magliocchetti <riccardo.magliocchetti@gmail.com>
2024-12-03 09:31:08 +00:00
668cb75f24 docs: add missing autodoc for click and aiohttp-server (#3060)
* add missing docs for click and aiohttp-server

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

* fix click readme

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

* add nitpick

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

---------

Signed-off-by: emdneto <9735060+emdneto@users.noreply.github.com>
Co-authored-by: Riccardo Magliocchetti <riccardo.magliocchetti@gmail.com>
2024-12-03 09:19:43 +00:00
0da62aa532 Add type hints to Starlette instrumentation (#3045)
* Add type hints to Starlette instrumentation

* format

* Add changelog

* Add changelog

* Remove pyright ignore

---------

Co-authored-by: Riccardo Magliocchetti <riccardo.magliocchetti@gmail.com>
Co-authored-by: Emídio Neto <9735060+emdneto@users.noreply.github.com>
2024-12-02 22:28:45 -05: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
16ebf2519b starlette: Replace _meter_provider by meter_provider on _instrument (#3048)
* starlette: Replace `_meter_provider` by `meter_provider` on `_instrument`

* Add PR on the changelog

---------

Co-authored-by: Riccardo Magliocchetti <riccardo.magliocchetti@gmail.com>
2024-11-26 21:46:47 +00:00
5c5fc732fb Replace assertEqualSpanInstrumentationInfo with assertEqualSpanInstrumentationScope (#3037)
* Replace assertInstInfo with assertInstScope

* Update Changelog

* Fix order of other changelog entries
2024-11-22 09:32:04 +01:00
d9e14487b2 opentelemetry-instrumentation-system-metrics: fix typo in metrics configs (#3025) 2024-11-21 14:12:51 -08:00
116f98df72 opentelemetry-instrumentation-httpx: drop unused private classes (#3036) 2024-11-21 08:52:22 -08:00
7b1554bddc Add PyMySQL instrumentor support for sqlcommenting (#2942)
* WIP

* Add _DB_DRIVER_ALIASES

* Add mysql_client_version to sqlcomment

* lint

* Fix existing tests

* lint test

* Add PyMySQL dbapi commenter case

* Add test

* Add test

* Add test

* Add tests

* Changelog

* calculate_commenter_data at init of DatabaseApiIntegration

* try-except if NoneType module

* Add pymysql sqlcomment support

* Add unit tests

* Update docstring

* Changelog

* pymysql instrument_connection specifies connect_module

* lint

* Add tests

* Fix doc

---------

Co-authored-by: Riccardo Magliocchetti <riccardo.magliocchetti@gmail.com>
2024-11-21 16:21:12 +00:00
beff723389 Add mysqlclient instrumentor support for sqlcommenting (#2941)
* WIP

* Add _DB_DRIVER_ALIASES

* Add mysql_client_version to sqlcomment

* lint

* Fix existing tests

* lint test

* Add PyMySQL dbapi commenter case

* Add test

* Add test

* Add test

* Add tests

* Changelog

* calculate_commenter_data at init of DatabaseApiIntegration

* Add mysqlclient sqlcomment support

* Fix typo

* try-except if NoneType module

* Add unit test

* CHangelog

* mysqlclient instrument_connection with connect_module

* add tests

* more tests

* more tests 2

* lint

* Redesign tests

* Rm unnecessary mocks
2024-11-21 10:37:08 -05:00
4e992dd60a DB-API instrument_connection accepts optional connect_module (#3027)
* DbApi instrument_connection accepts optional connect_module

* Changelog

* Add test

* Adjust tests
2024-11-20 14:44:56 -05:00
19a59e4be7 fix(httpx): check if mount transport is None before wrap (#3022) 2024-11-19 11:40:06 -08:00
1c820ea96e SQLAlchemy instrumentor populates span after sqlcomment creation, not before (#2937) 2024-11-19 09:30:26 -08:00
53b87145b3 DB-API instrumentor populates span after sqlcomment creation, not before (#2935) 2024-11-19 09:13:31 -08:00
a29ad8a6a3 Fix link to confluent_kafka docs (#3024) 2024-11-19 09:26:10 +01:00
803bb322ba opentelemetry-instrumentation-httpx: make instrument_client a staticmethod again (#3003)
* opentelemetry-instrumentation-httpx: make instrument_client a staticmethod again

* ADd changelog

* Can be a classmethod

---------

Co-authored-by: Leighton Chen <lechen@microsoft.com>
2024-11-14 19:08:03 +01:00
1d6968b672 fix: teach instrument version constraint for sqlalchemy (#2971) 2024-11-07 15:39:16 -08:00
1d8286c08a Update tests to work with SQLAlchemy 2 (#2976) 2024-11-07 15:18:05 -08:00
ca4d5170d0 fix: remove opentelemetry-instrumentation-test package from bootstrap_gen (#2969) 2024-11-07 11:18:51 -08:00
226258e457 Update version to 1.29.0.dev/0.50b0.dev (#2954) 2024-11-05 14:22:03 -08:00
8cfbca2293 opentelemetry-instrumentation-system-metrics: don't report open file descriptors on windows (#2946)
* opentelemetry-instrumentation-system-metrics: don't report files descriptors on windows

* Run manually added tox env tests on windows too

* Add jobs for botocore and system-metrics on windows

* Skip open file descriptor test on windows

---------

Co-authored-by: Tammy Baylis <96076570+tammy-baylis-swi@users.noreply.github.com>
2024-11-05 09:39:29 +01: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
a940fc4a65 Add DB-API instrumentor support for MySQL driver sqlcommenting (#2897) 2024-10-30 10:46:11 -07:00
f6b68d0c02 httpx: rewrite patching to use wrapt instead of subclassing client (#2909)
httpx: rewrote patching to use wrapt instead of subclassing client

Porting of httpx instrumentation to patch async transport methods instead of substituting the client. That is because the current approach will instrument httpx by instantianting another client with a custom transport class and this will race with code already subclassing. This one uses wrapt to patch the default httpx transport classes.

---------

Co-authored-by: Emídio Neto <9735060+emdneto@users.noreply.github.com>
2024-10-29 20:33:35 +00:00
7cbe58691a opentelemetry-instrumentation-celery: don't detach a None token (#2927) 2024-10-28 09:40:25 -07:00