diff --git a/.changelog/4601.added b/.changelog/4601.added new file mode 100644 index 0000000000..c56dc512ad --- /dev/null +++ b/.changelog/4601.added @@ -0,0 +1 @@ +`opentelemetry-instrumentation-botocore`: loosen aiobotocore version constraints to allow for 3.x diff --git a/instrumentation/README.md b/instrumentation/README.md index ebbb8c3ac4..5073667d41 100644 --- a/instrumentation/README.md +++ b/instrumentation/README.md @@ -12,7 +12,7 @@ | [opentelemetry-instrumentation-asyncpg](./opentelemetry-instrumentation-asyncpg) | asyncpg >= 0.12.0 | No | development | [opentelemetry-instrumentation-aws-lambda](./opentelemetry-instrumentation-aws-lambda) | aws_lambda | No | development | [opentelemetry-instrumentation-boto3sqs](./opentelemetry-instrumentation-boto3sqs) | boto3 ~= 1.0 | No | development -| [opentelemetry-instrumentation-botocore](./opentelemetry-instrumentation-botocore) | botocore~=1.0,aiobotocore~=2.0 | No | development +| [opentelemetry-instrumentation-botocore](./opentelemetry-instrumentation-botocore) | botocore~=1.0,aiobotocore>=2.0,<4.0 | No | development | [opentelemetry-instrumentation-cassandra](./opentelemetry-instrumentation-cassandra) | cassandra-driver ~= 3.25,scylla-driver ~= 3.25 | No | development | [opentelemetry-instrumentation-celery](./opentelemetry-instrumentation-celery) | celery >= 4.0, < 6.0 | No | development | [opentelemetry-instrumentation-click](./opentelemetry-instrumentation-click) | click >= 8.1.3, < 9.0.0 | No | development diff --git a/instrumentation/opentelemetry-instrumentation-botocore/pyproject.toml b/instrumentation/opentelemetry-instrumentation-botocore/pyproject.toml index 5dd212a31b..4f0f626be2 100644 --- a/instrumentation/opentelemetry-instrumentation-botocore/pyproject.toml +++ b/instrumentation/opentelemetry-instrumentation-botocore/pyproject.toml @@ -36,7 +36,7 @@ dependencies = [ instruments = [] instruments-any = [ "botocore ~= 1.0", - "aiobotocore ~= 2.0", + "aiobotocore >= 2.0, < 4.0" ] [project.entry-points.opentelemetry_instrumentor] diff --git a/instrumentation/opentelemetry-instrumentation-botocore/src/opentelemetry/instrumentation/botocore/package.py b/instrumentation/opentelemetry-instrumentation-botocore/src/opentelemetry/instrumentation/botocore/package.py index 02d1a20164..0209694956 100644 --- a/instrumentation/opentelemetry-instrumentation-botocore/src/opentelemetry/instrumentation/botocore/package.py +++ b/instrumentation/opentelemetry-instrumentation-botocore/src/opentelemetry/instrumentation/botocore/package.py @@ -2,7 +2,7 @@ # SPDX-License-Identifier: Apache-2.0 _instruments_botocore = ("botocore~=1.0",) -_instruments_aiobotocore = ("aiobotocore~=2.0",) +_instruments_aiobotocore = ("aiobotocore>=2.0,<4.0",) _instruments = () _instruments_any = (*_instruments_botocore, *_instruments_aiobotocore) diff --git a/instrumentation/opentelemetry-instrumentation-botocore/test-requirements-3.txt b/instrumentation/opentelemetry-instrumentation-botocore/test-requirements-3.txt index ce8031eb3d..bf8f36c464 100644 --- a/instrumentation/opentelemetry-instrumentation-botocore/test-requirements-3.txt +++ b/instrumentation/opentelemetry-instrumentation-botocore/test-requirements-3.txt @@ -1,8 +1,8 @@ asgiref==3.8.1 aws-xray-sdk==2.12.1 -boto3==1.35.16 -botocore==1.35.16 -aiobotocore==2.15.0 +boto3==1.43.0 +botocore==1.43.0 +aiobotocore==3.7.0 certifi==2024.7.4 cffi==1.17.0 charset-normalizer==3.3.2 @@ -26,10 +26,10 @@ pytz==2024.1 PyYAML==6.0.1 requests==2.33.1 responses==0.25.0 -s3transfer==0.10.0 +s3transfer==0.17.0 six==1.16.0 tomli==2.0.1 -typing_extensions==4.12.2 +typing_extensions==4.15.0 urllib3==1.26.19 Werkzeug==3.0.6 wrapt==1.16.0 diff --git a/instrumentation/opentelemetry-instrumentation-botocore/tests/test_botocore_instrumentation.py b/instrumentation/opentelemetry-instrumentation-botocore/tests/test_botocore_instrumentation.py index 405789b33b..de5909e85c 100644 --- a/instrumentation/opentelemetry-instrumentation-botocore/tests/test_botocore_instrumentation.py +++ b/instrumentation/opentelemetry-instrumentation-botocore/tests/test_botocore_instrumentation.py @@ -4,6 +4,7 @@ import os from importlib.metadata import EntryPoint from unittest.mock import ANY, Mock, call, patch +from urllib.parse import urlparse import botocore.session from botocore.exceptions import ParamValidationError @@ -342,7 +343,7 @@ def test_sts_client(self): span = self.assert_only_span() expected = self._default_span_attributes("STS", "GetCallerIdentity") expected["aws.request_id"] = ANY - expected[SERVER_ADDRESS] = "sts.amazonaws.com" + expected[SERVER_ADDRESS] = urlparse(sts.meta.endpoint_url).hostname # check for exact attribute set to make sure not to leak any sts secrets self.assertEqual(expected, dict(span.attributes)) diff --git a/opentelemetry-instrumentation/src/opentelemetry/instrumentation/bootstrap_gen.py b/opentelemetry-instrumentation/src/opentelemetry/instrumentation/bootstrap_gen.py index 7f38e43c96..5073fa0870 100644 --- a/opentelemetry-instrumentation/src/opentelemetry/instrumentation/bootstrap_gen.py +++ b/opentelemetry-instrumentation/src/opentelemetry/instrumentation/bootstrap_gen.py @@ -54,7 +54,7 @@ "instrumentation": "opentelemetry-instrumentation-botocore==0.63b0.dev", }, { - "library": "aiobotocore ~= 2.0", + "library": "aiobotocore >= 2.0, < 4.0", "instrumentation": "opentelemetry-instrumentation-botocore==0.63b0.dev", }, { diff --git a/uv.lock b/uv.lock index 209c3e1952..2180088631 100644 --- a/uv.lock +++ b/uv.lock @@ -3149,7 +3149,7 @@ instruments-any = [ [package.metadata] requires-dist = [ - { name = "aiobotocore", marker = "extra == 'instruments-any'", specifier = "~=2.0" }, + { name = "aiobotocore", marker = "extra == 'instruments-any'", specifier = ">=2.0,<4.0" }, { name = "botocore", marker = "extra == 'instruments-any'", specifier = "~=1.0" }, { name = "opentelemetry-api", git = "https://github.com/open-telemetry/opentelemetry-python?subdirectory=opentelemetry-api&branch=main" }, { name = "opentelemetry-instrumentation", editable = "opentelemetry-instrumentation" },