Commit Graph

2273 Commits

Author SHA1 Message Date
Pete Hodgson 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
Emídio Neto 9e83e25441
test two requirements files for docs and rtd (#3039) 2024-12-03 10:03:23 -08:00
Rytis Bagdziunas 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
Emídio Neto 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
Marcelo Trylesinski 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
Liudmila Molkova 142b86c1bf
OpenAI instrumentation docs fixes (#2988)
* Add openai docs config and improve readme

* up

* Add manual sample, add no-content tests

* update headers

* lint

* use grpc endpoint in openai samples, add extra env vars to readme

* move distro fix to another PR

* nits

* Ignore examples for pylint

* Update .pylintrc

* ignroe lint for example

* Fix README docs

* Update openai.rst

* Update conf.py

* Update docs-requirements.txt

* docs

---------

Co-authored-by: Leighton Chen <lechen@microsoft.com>
Co-authored-by: Riccardo Magliocchetti <riccardo.magliocchetti@gmail.com>
2024-12-02 10:23:11 +01:00
Emídio Neto 8656a06f88
try update misc workflows to py311 (#3055)
Signed-off-by: emdneto <9735060+emdneto@users.noreply.github.com>
Co-authored-by: Riccardo Magliocchetti <riccardo.magliocchetti@gmail.com>
2024-11-28 17:07:52 +00:00
Riccardo Magliocchetti af8d0930ca
opentelemetry-instrumentation-openai-v2: pin httpx dependency (#3056)
As 0.28.0 broke compat with old openai client.
2024-11-28 13:40:15 -03:00
Riccardo Magliocchetti 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
Marcelo Trylesinski 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
Emídio Neto 97d1514b65
fix missing contrib_repo_sha in workflow (#3049)
Signed-off-by: emdneto <9735060+emdneto@users.noreply.github.com>
2024-11-26 15:03:42 +01:00
Emídio Neto 41bd34f6e1
infra: configure generate-workflows to generate core-contrib-tests (#3035)
* test call workflow

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

* fix name

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-11-26 12:16:45 +00:00
Liudmila Molkova 1737ee6940
Use OTLP log exporter by default in otel-distro (#3042)
* Use OTLP log exporter by default in otel-distro

* changelog

* sort imports
2024-11-26 09:43:11 +01:00
Tammy Baylis 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
Riccardo Magliocchetti d9e14487b2
opentelemetry-instrumentation-system-metrics: fix typo in metrics configs (#3025) 2024-11-21 14:12:51 -08:00
Riccardo Magliocchetti 116f98df72
opentelemetry-instrumentation-httpx: drop unused private classes (#3036) 2024-11-21 08:52:22 -08:00
Tammy Baylis 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
Tammy Baylis 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
Tammy Baylis 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
Adrian Cole d0cbf8e1a5
Correct formatting of CHANGELOG (#3029)
Signed-off-by: Adrian Cole <adrian.cole@elastic.co>
Co-authored-by: Riccardo Magliocchetti <riccardo.magliocchetti@gmail.com>
2024-11-20 12:54:06 +00:00
Leighton Chen 0032e68161
Update RELEASING.md (#3001) 2024-11-20 10:01:12 +01:00
Adrian Cole ae13079df8
Add OpenAI example (#3006) 2024-11-19 22:48:27 -08:00
Emídio Neto 19a59e4be7
fix(httpx): check if mount transport is None before wrap (#3022) 2024-11-19 11:40:06 -08:00
Tammy Baylis 1c820ea96e
SQLAlchemy instrumentor populates span after sqlcomment creation, not before (#2937) 2024-11-19 09:30:26 -08:00
Tammy Baylis 53b87145b3
DB-API instrumentor populates span after sqlcomment creation, not before (#2935) 2024-11-19 09:13:31 -08:00
Anton Pirker a29ad8a6a3
Fix link to confluent_kafka docs (#3024) 2024-11-19 09:26:10 +01:00
Aaron Abbott 23f67eb77b
Cherry pick eachdist.py changes to main from release/v1.28.x-0.49bx branch (#3018)
* Fix prepare patch release workflow (#3013)

* Fix eachdist.py patch release to respect "all" and "excluded" (#3016)
2024-11-18 12:29:35 -05:00
Riccardo Magliocchetti 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
Leighton Chen c32cc7a3e2
Remove updating CHANGELOG step in release workflow (#3000) 2024-11-14 09:52:32 -08:00
Ali Waleed a6e4a0ca43
Add Support for `Async` openai instrumentation (#2984) 2024-11-14 08:53:27 -08:00
Leighton Chen e3ba54b95c
Add openai instrumentation to opentelemetry-bootstrap (#2996) 2024-11-12 15:13:42 -08:00
Adrian Cole 89a0b28a09
opentelemetry-instrumentation-openai-v2: scrub cookie from tests (#2993) 2024-11-12 13:01:49 -08:00
Leighton Chen c28f7c978e
re-add testpypi publish step (#2991) 2024-11-12 09:18:09 -08:00
Liudmila Molkova b6a6f75834
publish to pypi (#2980) (#2987) 2024-11-11 11:02:20 -08:00
Tammy Baylis 66a6780721
Add generate-workflows usage to CONTRIBUTING (#2977) 2024-11-11 10:53:42 -08:00
Adrian Cole bf8e2814ea
opentelemetry-instrumentation-openai-v2: add codefromthecrypt and fix yaml fixture (#2989) 2024-11-11 08:12:26 -08:00
OpenTelemetry Bot 4606cf2c10
Copy changelog updates from package-release/opentelemetry-instrumentation-openai-v2/v2.0bx (#2982) 2024-11-07 17:03:39 -08:00
Guangya Liu 46b14662f8
adding gyliu513 as genai reviewer (#2972) 2024-11-07 16:07:33 -08:00
Emídio Neto 1d6968b672
fix: teach instrument version constraint for sqlalchemy (#2971) 2024-11-07 15:39:16 -08:00
Tammy Baylis 1d8286c08a
Update tests to work with SQLAlchemy 2 (#2976) 2024-11-07 15:18:05 -08:00
Emídio Neto ca4d5170d0
fix: remove opentelemetry-instrumentation-test package from bootstrap_gen (#2969) 2024-11-07 11:18:51 -08:00
Nir Gazit 4a5bf9bd7e
add nirga to GenAI component owners (#2962) 2024-11-07 10:59:17 -08:00
Liudmila Molkova 499548ebbb
Test packages that are released individually with lowest versions they support (#2961) 2024-11-07 10:47:19 -08:00
Riccardo Magliocchetti 77613da396
Drop selective enabled for windows and regenerate workflows (#2964) 2024-11-06 17:36:33 +01:00
OpenTelemetry Bot 226258e457
Update version to 1.29.0.dev/0.50b0.dev (#2954) 2024-11-05 14:22:03 -08:00
OpenTelemetry Bot 6c88f01f0c
Update opentelemetry-instrumentation-openai-v2 version to v2.1b0 (#2960) 2024-11-05 13:28:54 -08:00
Liudmila Molkova d341ef5062
prepare before preparing release (#2958) 2024-11-05 12:30:58 -08:00
Riccardo Magliocchetti acffef957d
opentelemetry-instrumentation: stick to latest semantic conventions package (#2952)
To match the instrumentations.

Will hopefully fix pip not able to handle the situation:

  opentelemetry-instrumentation 0.49b0 depends on opentelemetry-semantic-conventions>=0.48b0
  opentelemetry-instrumentation-dbapi 0.49b0 depends on opentelemetry-semantic-conventions==0.49b0
2024-11-05 14:20:03 +01:00
Riccardo Magliocchetti 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
Adrian Cole d6a59e4bdf
opentelemetry-instrumentation-openai-v2: format test data for readability (#2945)
* opentelemetry-instrumentation-openai-v2: format test data as YAML literal block scalar for readability

Signed-off-by: Adrian Cole <adrian.cole@elastic.co>

* ruff

Signed-off-by: Adrian Cole <adrian.cole@elastic.co>

* Update instrumentation/opentelemetry-instrumentation-openai-v2/tests/conftest.py

Co-authored-by: Riccardo Magliocchetti <riccardo.magliocchetti@gmail.com>

---------

Signed-off-by: Adrian Cole <adrian.cole@elastic.co>
Co-authored-by: Riccardo Magliocchetti <riccardo.magliocchetti@gmail.com>
2024-11-05 09:21:59 +01:00