diff --git a/CHANGELOG.md b/CHANGELOG.md index 2527bac55e..2fe295b37c 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -9,6 +9,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 - `opentelemetry-instrumentation-aws-lambda` Bugfix: AWS Lambda event source key incorrect for SNS in instrumentation library. ([#2612](https://github.com/open-telemetry/opentelemetry-python-contrib/pull/2612)) +- `opentelemetry-instrumentation-system-metrics` Permit to use psutil 6.0+. + ([#2630](https://github.com/open-telemetry/opentelemetry-python-contrib/pull/2630)) ### Added @@ -46,7 +48,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ([#2300](https://github.com/open-telemetry/opentelemetry-python-contrib/pull/2300)) - Rename AwsLambdaInstrumentor span attributes `faas.id` to `cloud.resource_id`, `faas.execution` to `faas.invocation_id` ([#2372](https://github.com/open-telemetry/opentelemetry-python-contrib/pull/2372)) -- Drop support for instrumenting elasticsearch client < 6` +- Drop support for instrumenting elasticsearch client < 6 ([#2422](https://github.com/open-telemetry/opentelemetry-python-contrib/pull/2422)) - `opentelemetry-instrumentation-wsgi` Add `http.method` to `span.name` ([#2425](https://github.com/open-telemetry/opentelemetry-python-contrib/pull/2425)) diff --git a/instrumentation/opentelemetry-instrumentation-pymysql/tests/test_pymysql_integration.py b/instrumentation/opentelemetry-instrumentation-pymysql/tests/test_pymysql_integration.py index 587ebc1b53..6f8af5d8df 100644 --- a/instrumentation/opentelemetry-instrumentation-pymysql/tests/test_pymysql_integration.py +++ b/instrumentation/opentelemetry-instrumentation-pymysql/tests/test_pymysql_integration.py @@ -17,6 +17,7 @@ import pymysql import opentelemetry.instrumentation.pymysql +from opentelemetry import trace as trace_api from opentelemetry.instrumentation.pymysql import PyMySQLInstrumentor from opentelemetry.sdk import resources from opentelemetry.test.test_base import TestBase @@ -78,6 +79,20 @@ def test_custom_tracer_provider(self, mock_connect): self.assertIs(span.resource, resource) + @mock.patch("pymysql.connect") + # pylint: disable=unused-argument + def test_no_op_tracer_provider(self, mock_connect): + PyMySQLInstrumentor().instrument( + tracer_provider=trace_api.NoOpTracerProvider() + ) + cnx = pymysql.connect(database="test") + cursor = cnx.cursor() + query = "SELECT * FROM test" + cursor.execute(query) + + spans_list = self.memory_exporter.get_finished_spans() + self.assertEqual(len(spans_list), 0) + @mock.patch("pymysql.connect") # pylint: disable=unused-argument def test_instrument_connection(self, mock_connect): diff --git a/instrumentation/opentelemetry-instrumentation-system-metrics/pyproject.toml b/instrumentation/opentelemetry-instrumentation-system-metrics/pyproject.toml index 07ba2faa20..8518ddc8db 100644 --- a/instrumentation/opentelemetry-instrumentation-system-metrics/pyproject.toml +++ b/instrumentation/opentelemetry-instrumentation-system-metrics/pyproject.toml @@ -27,7 +27,7 @@ classifiers = [ dependencies = [ "opentelemetry-instrumentation == 0.47b0.dev", "opentelemetry-api ~= 1.11", - "psutil ~= 5.9", + "psutil >= 5.9.0, < 7", ] [project.optional-dependencies] diff --git a/instrumentation/opentelemetry-instrumentation-system-metrics/test-requirements.txt b/instrumentation/opentelemetry-instrumentation-system-metrics/test-requirements.txt index ddb98399cf..13573c65bd 100644 --- a/instrumentation/opentelemetry-instrumentation-system-metrics/test-requirements.txt +++ b/instrumentation/opentelemetry-instrumentation-system-metrics/test-requirements.txt @@ -4,7 +4,7 @@ importlib-metadata==6.11.0 iniconfig==2.0.0 packaging==24.0 pluggy==1.5.0 -psutil==5.9.8 +psutil==6.0.0 py-cpuinfo==9.0.0 pytest==7.4.4 pytest-benchmark==4.0.0