Datasets:
Download instances/observability-opentelemetry-python-5266/gold/contrib.patch from CrossSWE/CrossSWE-Bench: direct link, hf CLI and curl.
- Browser
- Download file 3.85 kB
-
https://huggingface.co/datasets/CrossSWE/CrossSWE-Bench/resolve/main/instances/observability-opentelemetry-python-5266/gold/contrib.patch
- Command line
-
hf download hf://datasets/CrossSWE/CrossSWE-Bench/instances/observability-opentelemetry-python-5266/gold/contrib.patch
-
curl -L -o contrib.patch https://huggingface.co/datasets/CrossSWE/CrossSWE-Bench/resolve/main/instances/observability-opentelemetry-python-5266/gold/contrib.patch
3.85 kB
| diff --git a/instrumentation/opentelemetry-instrumentation-botocore/test-requirements-2.txt b/instrumentation/opentelemetry-instrumentation-botocore/test-requirements-2.txt | |
| index 033ba6734..eb7207e84 100644 | |
| --- a/instrumentation/opentelemetry-instrumentation-botocore/test-requirements-2.txt | |
| +++ b/instrumentation/opentelemetry-instrumentation-botocore/test-requirements-2.txt | |
| aws-xray-sdk==2.12.1 | |
| boto3==1.29.4 | |
| botocore==1.32.4 | |
| aiobotocore==2.8.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 ce8031eb3..b6932cf8d 100644 | |
| --- a/instrumentation/opentelemetry-instrumentation-botocore/test-requirements-3.txt | |
| +++ b/instrumentation/opentelemetry-instrumentation-botocore/test-requirements-3.txt | |
| aws-xray-sdk==2.12.1 | |
| boto3==1.35.16 | |
| botocore==1.35.16 | |
| aiobotocore==2.15.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 | |
| diff --git a/instrumentation/opentelemetry-instrumentation-httpx/tests/test_httpx_integration.py b/instrumentation/opentelemetry-instrumentation-httpx/tests/test_httpx_integration.py | |
| index 684dbbf39..ee669e6c1 100644 | |
| --- a/instrumentation/opentelemetry-instrumentation-httpx/tests/test_httpx_integration.py | |
| +++ b/instrumentation/opentelemetry-instrumentation-httpx/tests/test_httpx_integration.py | |
| 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]]), | |
| ) | |
| 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 5b1b4cd52..826e7d1d0 100644 | |
| --- a/instrumentation/opentelemetry-instrumentation-logging/src/opentelemetry/instrumentation/logging/handler.py | |
| +++ b/instrumentation/opentelemetry-instrumentation-logging/src/opentelemetry/instrumentation/logging/handler.py | |
| import threading | |
| 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, | |
| from opentelemetry._logs import ( | |
| 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 | |
| class LoggingHandler(logging.Handler): | |
| 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 | |
| } | |