From 4026bb2c7299d552a470220bf5455e0035505ac3 Mon Sep 17 00:00:00 2001 From: Riccardo Magliocchetti Date: Fri, 13 Sep 2024 11:38:32 +0200 Subject: [PATCH] opentelemetry-instrumentation-aiohttp-client: stop using pkg_resources --- .../tests/test_aiohttp_client_integration.py | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/instrumentation/opentelemetry-instrumentation-aiohttp-client/tests/test_aiohttp_client_integration.py b/instrumentation/opentelemetry-instrumentation-aiohttp-client/tests/test_aiohttp_client_integration.py index 8474bd436f..162ce3df3a 100644 --- a/instrumentation/opentelemetry-instrumentation-aiohttp-client/tests/test_aiohttp_client_integration.py +++ b/instrumentation/opentelemetry-instrumentation-aiohttp-client/tests/test_aiohttp_client_integration.py @@ -24,7 +24,6 @@ import aiohttp.test_utils import yarl from http_server_mock import HttpServerMock -from pkg_resources import iter_entry_points from opentelemetry import trace as trace_api from opentelemetry.instrumentation import aiohttp_client @@ -47,6 +46,7 @@ from opentelemetry.semconv.trace import SpanAttributes from opentelemetry.test.test_base import TestBase from opentelemetry.trace import Span, StatusCode +from opentelemetry.util._importlib_metadata import entry_points def run_with_test_server( @@ -886,9 +886,7 @@ def response_hook( class TestLoadingAioHttpInstrumentor(unittest.TestCase): def test_loading_instrumentor(self): - entry_points = iter_entry_points( - "opentelemetry_instrumentor", "aiohttp-client" - ) + eps = entry_points("opentelemetry_instrumentor", "aiohttp-client") - instrumentor = next(entry_points).load()() + instrumentor = next(eps).load()() self.assertIsInstance(instrumentor, AioHttpClientInstrumentor)