From 593f86fd043ace5e20d52df415b687f37229b484 Mon Sep 17 00:00:00 2001 From: shwejan raj <83217783+shwejanraj@users.noreply.github.com> Date: Sat, 22 Jun 2024 00:55:01 +0530 Subject: [PATCH 1/3] Adds NoOpTracerProvider test case for pymysql instrumentation (#2581) --- .../tests/test_pymysql_integration.py | 15 +++++++++++++++ 1 file changed, 15 insertions(+) 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): From 919b2c295f68963e2581d9a0d214fa18a2bf7059 Mon Sep 17 00:00:00 2001 From: Riccardo Magliocchetti Date: Sat, 22 Jun 2024 11:44:55 +0200 Subject: [PATCH 2/3] CHANGELOG: remove spurious backtick (#2628) Co-authored-by: Shalev Roda <65566801+shalevr@users.noreply.github.com> --- CHANGELOG.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index d4fbe906aa..d2b2c930b6 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -44,7 +44,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)) From 3d758a973c015f6b994e221d22a9b7e29b62adb7 Mon Sep 17 00:00:00 2001 From: Riccardo Magliocchetti Date: Mon, 24 Jun 2024 18:31:04 +0200 Subject: [PATCH 3/3] instrumentation/system-metrics: permit to use psutil 6.0 (#2630) --- CHANGELOG.md | 2 ++ .../opentelemetry-instrumentation-system-metrics/pyproject.toml | 2 +- .../test-requirements.txt | 2 +- 3 files changed, 4 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index d2b2c930b6..5ddb3f488b 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 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