From 02ebb13a7cbe42e5898288daeff9e81a2787b5f0 Mon Sep 17 00:00:00 2001 From: jayeshhire Date: Mon, 6 Apr 2026 23:12:25 +0530 Subject: [PATCH 1/4] Enabled flake8-print plugin rules for ruff linter --- .../src/opentelemetry/instrumentation/boto3sqs/__init__.py | 2 +- pyproject.toml | 5 +++++ 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/instrumentation/opentelemetry-instrumentation-boto3sqs/src/opentelemetry/instrumentation/boto3sqs/__init__.py b/instrumentation/opentelemetry-instrumentation-boto3sqs/src/opentelemetry/instrumentation/boto3sqs/__init__.py index 028009afd6..7b5541d429 100644 --- a/instrumentation/opentelemetry-instrumentation-boto3sqs/src/opentelemetry/instrumentation/boto3sqs/__init__.py +++ b/instrumentation/opentelemetry-instrumentation-boto3sqs/src/opentelemetry/instrumentation/boto3sqs/__init__.py @@ -188,7 +188,7 @@ def _safe_end_processing_span(receipt_handle: str) -> None: @staticmethod def _extract_queue_name_from_url(queue_url: str) -> str: # A Queue name cannot have the `/` char, therefore we can return the part after the last / - return queue_url.split("/")[-1] + return queue_url.rsplit("/", maxsplit=1)[-1] def _create_processing_span( self, diff --git a/pyproject.toml b/pyproject.toml index c877d5f038..ded659fb23 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -171,6 +171,7 @@ select = [ "PLE", # pylint error "Q", # flake8-quotes "A", # flake8-builtins + "T20", # flake8-print ] ignore = [ "E501", # line-too-long @@ -178,6 +179,10 @@ ignore = [ [tool.ruff.lint.per-file-ignores] "docs/**/*.*" = ["A001"] +"scripts/*" = ["T20"] +"**/tests/*" = ["T20"] +"**/examples/*" = ["T20"] +"opentelemetry-instrumentation/src/opentelemetry/instrumentation/bootstrap.py" = ["T20"] [tool.ruff.lint.isort] detect-same-package = false # to not consider instrumentation packages as first-party From 5b953e5749e35aeb0f92739e128b94b29bea5f3a Mon Sep 17 00:00:00 2001 From: jayeshhire Date: Mon, 6 Apr 2026 23:23:11 +0530 Subject: [PATCH 2/4] Changes added to CHANGELOG.md --- CHANGELOG.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index d9e48cd6df..bc12d2e357 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -13,6 +13,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ### Added +- - Enabled the flake8-print plugin rules for ruff linter. These rules throw warnings over the use of `print` and `pprint` statements. +([4399](https://github.com/open-telemetry/opentelemetry-python-contrib/pull/4399)) - `opentelemetry-instrumentation-asgi`: Respect `suppress_http_instrumentation` context in ASGI middleware to skip server span creation when HTTP instrumentation is suppressed ([#4375](https://github.com/open-telemetry/opentelemetry-python-contrib/pull/4375)) - `opentelemetry-instrumentation-confluent-kafka`: Loosen confluent-kafka upper bound to <3.0.0 From 99e47ba5ff532f5b2a53eaa7bbc766992c70e9f3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Em=C3=ADdio=20Neto?= <9735060+emdneto@users.noreply.github.com> Date: Tue, 7 Apr 2026 12:22:29 -0300 Subject: [PATCH 3/4] Update CHANGELOG.md --- CHANGELOG.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index bc12d2e357..9268ea2546 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -14,7 +14,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ### Added - - Enabled the flake8-print plugin rules for ruff linter. These rules throw warnings over the use of `print` and `pprint` statements. -([4399](https://github.com/open-telemetry/opentelemetry-python-contrib/pull/4399)) +([#4399](https://github.com/open-telemetry/opentelemetry-python-contrib/pull/4399)) - `opentelemetry-instrumentation-asgi`: Respect `suppress_http_instrumentation` context in ASGI middleware to skip server span creation when HTTP instrumentation is suppressed ([#4375](https://github.com/open-telemetry/opentelemetry-python-contrib/pull/4375)) - `opentelemetry-instrumentation-confluent-kafka`: Loosen confluent-kafka upper bound to <3.0.0 From a7fd6d83c75a2075cec18134d9c0d735383e663b Mon Sep 17 00:00:00 2001 From: jayeshhire Date: Tue, 7 Apr 2026 21:28:30 +0530 Subject: [PATCH 4/4] ignored PLC0207 rule as it is defeating the purpose of the split function here. --- .../src/opentelemetry/instrumentation/boto3sqs/__init__.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/instrumentation/opentelemetry-instrumentation-boto3sqs/src/opentelemetry/instrumentation/boto3sqs/__init__.py b/instrumentation/opentelemetry-instrumentation-boto3sqs/src/opentelemetry/instrumentation/boto3sqs/__init__.py index 7b5541d429..c86285ae03 100644 --- a/instrumentation/opentelemetry-instrumentation-boto3sqs/src/opentelemetry/instrumentation/boto3sqs/__init__.py +++ b/instrumentation/opentelemetry-instrumentation-boto3sqs/src/opentelemetry/instrumentation/boto3sqs/__init__.py @@ -188,7 +188,7 @@ def _safe_end_processing_span(receipt_handle: str) -> None: @staticmethod def _extract_queue_name_from_url(queue_url: str) -> str: # A Queue name cannot have the `/` char, therefore we can return the part after the last / - return queue_url.rsplit("/", maxsplit=1)[-1] + return queue_url.rsplit("/")[-1] # noqa: PLC0207 def _create_processing_span( self,