From efb934bae5a5e1aa28f844976051f88145898a33 Mon Sep 17 00:00:00 2001 From: Dylan Russell Date: Tue, 2 Jun 2026 17:48:41 +0000 Subject: [PATCH 1/3] Few fixes --- .../test-requirements-2.txt | 1 + .../test-requirements-3.txt | 1 + .../tests/test_httpx_integration.py | 4 ++-- .../src/opentelemetry/instrumentation/logging/handler.py | 4 ++-- 4 files changed, 6 insertions(+), 4 deletions(-) diff --git a/instrumentation/opentelemetry-instrumentation-botocore/test-requirements-2.txt b/instrumentation/opentelemetry-instrumentation-botocore/test-requirements-2.txt index 033ba6734f..834533ddbd 100644 --- a/instrumentation/opentelemetry-instrumentation-botocore/test-requirements-2.txt +++ b/instrumentation/opentelemetry-instrumentation-botocore/test-requirements-2.txt @@ -3,6 +3,7 @@ aws-xray-sdk==2.12.1 boto3==1.29.4 botocore==1.32.4 aiobotocore==2.8.0 +aiohttp<3.9.0 certifi==2024.7.4 cffi==1.17.0 charset-normalizer==3.3.2 diff --git a/instrumentation/opentelemetry-instrumentation-botocore/test-requirements-3.txt b/instrumentation/opentelemetry-instrumentation-botocore/test-requirements-3.txt index ce8031eb3d..af1598fd59 100644 --- a/instrumentation/opentelemetry-instrumentation-botocore/test-requirements-3.txt +++ b/instrumentation/opentelemetry-instrumentation-botocore/test-requirements-3.txt @@ -3,6 +3,7 @@ aws-xray-sdk==2.12.1 boto3==1.35.16 botocore==1.35.16 aiobotocore==2.15.0 +aiohttp<3.10.0 certifi==2024.7.4 cffi==1.17.0 charset-normalizer==3.3.2 diff --git a/instrumentation/opentelemetry-instrumentation-httpx/tests/test_httpx_integration.py b/instrumentation/opentelemetry-instrumentation-httpx/tests/test_httpx_integration.py index 684dbbf39b..ee669e6c1b 100644 --- a/instrumentation/opentelemetry-instrumentation-httpx/tests/test_httpx_integration.py +++ b/instrumentation/opentelemetry-instrumentation-httpx/tests/test_httpx_integration.py @@ -99,7 +99,7 @@ def _response_hook(span, request: "RequestInfo", response: "ResponseInfo"): assert _is_url_tuple(request) or isinstance(request.url, httpx.URL) span.set_attribute( HTTP_RESPONSE_BODY, - b"".join(response[2]), + "".join([part.decode() for part in response[2]]), ) @@ -109,7 +109,7 @@ async def _async_response_hook( assert _is_url_tuple(request) or isinstance(request.url, httpx.URL) span.set_attribute( HTTP_RESPONSE_BODY, - b"".join([part async for part in response[2]]), + "".join([part.decode() async for part in response[2]]), ) diff --git a/instrumentation/opentelemetry-instrumentation-logging/src/opentelemetry/instrumentation/logging/handler.py b/instrumentation/opentelemetry-instrumentation-logging/src/opentelemetry/instrumentation/logging/handler.py index 5b1b4cd52e..77a774b41d 100644 --- a/instrumentation/opentelemetry-instrumentation-logging/src/opentelemetry/instrumentation/logging/handler.py +++ b/instrumentation/opentelemetry-instrumentation-logging/src/opentelemetry/instrumentation/logging/handler.py @@ -22,7 +22,7 @@ from opentelemetry.context import get_current from opentelemetry.semconv._incubating.attributes import code_attributes from opentelemetry.semconv.attributes import exception_attributes -from opentelemetry.util.types import _ExtendedAttributes +from opentelemetry.util.types import AnyValue _internal_logger = logging.getLogger(__name__ + ".internal") _internal_logger.propagate = False @@ -132,7 +132,7 @@ def __init__( def _get_attributes( self, record: logging.LogRecord - ) -> _ExtendedAttributes: + ) -> Mapping[str, AnyValue]: attributes = { k: v for k, v in vars(record).items() if k not in _RESERVED_ATTRS } From d1dd4502aa1fd125803b465b24be097ca0797636 Mon Sep 17 00:00:00 2001 From: Dylan Russell Date: Tue, 2 Jun 2026 18:10:09 +0000 Subject: [PATCH 2/3] Fix broken test and missing import --- .../test-requirements-2.txt | 2 +- .../src/opentelemetry/instrumentation/logging/handler.py | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/instrumentation/opentelemetry-instrumentation-botocore/test-requirements-2.txt b/instrumentation/opentelemetry-instrumentation-botocore/test-requirements-2.txt index 834533ddbd..493cb1d99e 100644 --- a/instrumentation/opentelemetry-instrumentation-botocore/test-requirements-2.txt +++ b/instrumentation/opentelemetry-instrumentation-botocore/test-requirements-2.txt @@ -3,7 +3,7 @@ aws-xray-sdk==2.12.1 boto3==1.29.4 botocore==1.32.4 aiobotocore==2.8.0 -aiohttp<3.9.0 +aiohttp<3.10.0 certifi==2024.7.4 cffi==1.17.0 charset-normalizer==3.3.2 diff --git a/instrumentation/opentelemetry-instrumentation-logging/src/opentelemetry/instrumentation/logging/handler.py b/instrumentation/opentelemetry-instrumentation-logging/src/opentelemetry/instrumentation/logging/handler.py index 77a774b41d..826e7d1d07 100644 --- a/instrumentation/opentelemetry-instrumentation-logging/src/opentelemetry/instrumentation/logging/handler.py +++ b/instrumentation/opentelemetry-instrumentation-logging/src/opentelemetry/instrumentation/logging/handler.py @@ -9,7 +9,7 @@ import traceback from contextvars import ContextVar from time import time_ns -from typing import Callable +from typing import Callable, Mapping from opentelemetry._logs import ( LoggerProvider, @@ -132,7 +132,7 @@ def __init__( def _get_attributes( self, record: logging.LogRecord - ) -> Mapping[str, AnyValue]: + ) -> Mapping[str, AnyValue]: attributes = { k: v for k, v in vars(record).items() if k not in _RESERVED_ATTRS } From 8190c7dd78dfd6bb4a585ee7c57aa1a072572dc8 Mon Sep 17 00:00:00 2001 From: Dylan Russell Date: Tue, 2 Jun 2026 18:17:13 +0000 Subject: [PATCH 3/3] Address comment --- .../test-requirements-2.txt | 2 +- .../test-requirements-3.txt | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/instrumentation/opentelemetry-instrumentation-botocore/test-requirements-2.txt b/instrumentation/opentelemetry-instrumentation-botocore/test-requirements-2.txt index 493cb1d99e..eb7207e84b 100644 --- a/instrumentation/opentelemetry-instrumentation-botocore/test-requirements-2.txt +++ b/instrumentation/opentelemetry-instrumentation-botocore/test-requirements-2.txt @@ -3,7 +3,7 @@ aws-xray-sdk==2.12.1 boto3==1.29.4 botocore==1.32.4 aiobotocore==2.8.0 -aiohttp<3.10.0 +aiohttp==3.9.1 #TODO: https://github.com/open-telemetry/opentelemetry-python-contrib/issues/4645 - fix issue with aiohttp in a better way. certifi==2024.7.4 cffi==1.17.0 charset-normalizer==3.3.2 diff --git a/instrumentation/opentelemetry-instrumentation-botocore/test-requirements-3.txt b/instrumentation/opentelemetry-instrumentation-botocore/test-requirements-3.txt index af1598fd59..b6932cf8df 100644 --- a/instrumentation/opentelemetry-instrumentation-botocore/test-requirements-3.txt +++ b/instrumentation/opentelemetry-instrumentation-botocore/test-requirements-3.txt @@ -3,7 +3,7 @@ aws-xray-sdk==2.12.1 boto3==1.35.16 botocore==1.35.16 aiobotocore==2.15.0 -aiohttp<3.10.0 +aiohttp==3.9.3 #TODO: https://github.com/open-telemetry/opentelemetry-python-contrib/issues/4645 - fix issue with aiohttp in a better way. certifi==2024.7.4 cffi==1.17.0 charset-normalizer==3.3.2