From a279336c2a43f140f60925bf1ff5a2d2c07fd91b Mon Sep 17 00:00:00 2001 From: Nimrod Shlagman Date: Sun, 4 Dec 2022 13:13:10 +0200 Subject: [PATCH 01/11] fix aiopg version --- .../opentelemetry-instrumentation-aiopg/pyproject.toml | 2 +- .../src/opentelemetry/instrumentation/bootstrap_gen.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/instrumentation/opentelemetry-instrumentation-aiopg/pyproject.toml b/instrumentation/opentelemetry-instrumentation-aiopg/pyproject.toml index 8fb7d27cfd..da0709670c 100644 --- a/instrumentation/opentelemetry-instrumentation-aiopg/pyproject.toml +++ b/instrumentation/opentelemetry-instrumentation-aiopg/pyproject.toml @@ -33,7 +33,7 @@ dependencies = [ [project.optional-dependencies] instruments = [ - "aiopg >= 0.13.0, < 1.3.0", + "aiopg >= 0.13.0, <= 1.4.0", ] test = [ "opentelemetry-instrumentation-aiopg[instruments]", diff --git a/opentelemetry-instrumentation/src/opentelemetry/instrumentation/bootstrap_gen.py b/opentelemetry-instrumentation/src/opentelemetry/instrumentation/bootstrap_gen.py index e3564ba189..5e56f107e2 100644 --- a/opentelemetry-instrumentation/src/opentelemetry/instrumentation/bootstrap_gen.py +++ b/opentelemetry-instrumentation/src/opentelemetry/instrumentation/bootstrap_gen.py @@ -25,7 +25,7 @@ "instrumentation": "opentelemetry-instrumentation-aiohttp-client==0.36b0.dev", }, "aiopg": { - "library": "aiopg >= 0.13.0, < 1.3.0", + "library": "aiopg >= 0.13.0, <= 1.4.0", "instrumentation": "opentelemetry-instrumentation-aiopg==0.36b0.dev", }, "asgiref": { From aba8912b9d070e793e440f758098e23ce635a2a2 Mon Sep 17 00:00:00 2001 From: Nimrod Shlagman Date: Sun, 4 Dec 2022 15:20:45 +0200 Subject: [PATCH 02/11] detach aiopg test from its version --- .../tests/test_aiopg_integration.py | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/instrumentation/opentelemetry-instrumentation-aiopg/tests/test_aiopg_integration.py b/instrumentation/opentelemetry-instrumentation-aiopg/tests/test_aiopg_integration.py index 3917d277f7..0432037452 100644 --- a/instrumentation/opentelemetry-instrumentation-aiopg/tests/test_aiopg_integration.py +++ b/instrumentation/opentelemetry-instrumentation-aiopg/tests/test_aiopg_integration.py @@ -19,7 +19,6 @@ import aiopg from aiopg.utils import ( # pylint: disable=no-name-in-module _ContextManager, - _PoolAcquireContextManager, ) import opentelemetry.instrumentation.aiopg @@ -611,3 +610,16 @@ async def connect(self, *args, **kwargs): async def create_pool(self, *args, **kwargs): self.create_pool_call_count += 1 return AiopgPoolMock() + + +class _PoolAcquireContextManager(_ContextManager): + __slots__ = ("_coro", "_obj", "_pool") + + def __init__(self, coro, pool): + super().__init__(coro) + self._pool = pool + + async def __aexit__(self, exc_type, exc, tb): + await self._pool.release(self._obj) + self._pool = None + self._obj = None From 9da5572f4bda5941d8f3efbe74c9dfefae511084 Mon Sep 17 00:00:00 2001 From: Nimrod Shlagman Date: Sun, 4 Dec 2022 16:36:04 +0200 Subject: [PATCH 03/11] use poolCtxManager without aiopg.utils --- .../aiopg/aiopg_integration.py | 24 ++++++++++++++++++- .../instrumentation/aiopg/package.py | 2 +- .../instrumentation/aiopg/wrappers.py | 6 ++--- .../tests/test_aiopg_integration.py | 18 ++------------ 4 files changed, 28 insertions(+), 22 deletions(-) diff --git a/instrumentation/opentelemetry-instrumentation-aiopg/src/opentelemetry/instrumentation/aiopg/aiopg_integration.py b/instrumentation/opentelemetry-instrumentation-aiopg/src/opentelemetry/instrumentation/aiopg/aiopg_integration.py index d140c18838..1e29512c90 100644 --- a/instrumentation/opentelemetry-instrumentation-aiopg/src/opentelemetry/instrumentation/aiopg/aiopg_integration.py +++ b/instrumentation/opentelemetry-instrumentation-aiopg/src/opentelemetry/instrumentation/aiopg/aiopg_integration.py @@ -1,7 +1,7 @@ import typing import wrapt -from aiopg.utils import _ContextManager, _PoolAcquireContextManager +from aiopg.utils import _ContextManager from opentelemetry.instrumentation.dbapi import ( CursorTracer, @@ -150,3 +150,25 @@ async def callproc(self, *args, **kwargs): return result return AsyncCursorTracerProxy(cursor, *args, **kwargs) + + +class _PoolContextManager(_ContextManager): + __slots__ = () + + async def __aexit__(self, exc_type, exc, tb): + self._obj.close() + await self._obj.wait_closed() + self._obj = None + + +class _PoolAcquireContextManager(_ContextManager): + __slots__ = ("_coro", "_obj", "_pool") + + def __init__(self, coro, pool): + super().__init__(coro) + self._pool = pool + + async def __aexit__(self, exc_type, exc, tb): + await self._pool.release(self._obj) + self._pool = None + self._obj = None diff --git a/instrumentation/opentelemetry-instrumentation-aiopg/src/opentelemetry/instrumentation/aiopg/package.py b/instrumentation/opentelemetry-instrumentation-aiopg/src/opentelemetry/instrumentation/aiopg/package.py index 660a8577c7..23c280285a 100644 --- a/instrumentation/opentelemetry-instrumentation-aiopg/src/opentelemetry/instrumentation/aiopg/package.py +++ b/instrumentation/opentelemetry-instrumentation-aiopg/src/opentelemetry/instrumentation/aiopg/package.py @@ -13,4 +13,4 @@ # limitations under the License. -_instruments = ("aiopg >= 0.13.0, < 1.3.0",) +_instruments = ("aiopg >= 0.13.0, <= 1.4.0",) diff --git a/instrumentation/opentelemetry-instrumentation-aiopg/src/opentelemetry/instrumentation/aiopg/wrappers.py b/instrumentation/opentelemetry-instrumentation-aiopg/src/opentelemetry/instrumentation/aiopg/wrappers.py index f786772c49..d62291ca2f 100644 --- a/instrumentation/opentelemetry-instrumentation-aiopg/src/opentelemetry/instrumentation/aiopg/wrappers.py +++ b/instrumentation/opentelemetry-instrumentation-aiopg/src/opentelemetry/instrumentation/aiopg/wrappers.py @@ -34,14 +34,12 @@ import aiopg import wrapt -from aiopg.utils import ( # pylint: disable=no-name-in-module - _ContextManager, - _PoolContextManager, -) +from aiopg.utils import _ContextManager # pylint: disable=no-name-in-module from opentelemetry.instrumentation.aiopg.aiopg_integration import ( AiopgIntegration, AsyncProxyObject, + _PoolContextManager, get_traced_connection_proxy, ) from opentelemetry.instrumentation.aiopg.version import __version__ diff --git a/instrumentation/opentelemetry-instrumentation-aiopg/tests/test_aiopg_integration.py b/instrumentation/opentelemetry-instrumentation-aiopg/tests/test_aiopg_integration.py index 0432037452..5b0db12eb6 100644 --- a/instrumentation/opentelemetry-instrumentation-aiopg/tests/test_aiopg_integration.py +++ b/instrumentation/opentelemetry-instrumentation-aiopg/tests/test_aiopg_integration.py @@ -17,15 +17,14 @@ from unittest.mock import MagicMock import aiopg -from aiopg.utils import ( # pylint: disable=no-name-in-module - _ContextManager, -) +from aiopg.utils import _ContextManager # pylint: disable=no-name-in-module import opentelemetry.instrumentation.aiopg from opentelemetry import trace as trace_api from opentelemetry.instrumentation.aiopg import AiopgInstrumentor, wrappers from opentelemetry.instrumentation.aiopg.aiopg_integration import ( AiopgIntegration, + _PoolAcquireContextManager, ) from opentelemetry.sdk import resources from opentelemetry.semconv.trace import SpanAttributes @@ -610,16 +609,3 @@ async def connect(self, *args, **kwargs): async def create_pool(self, *args, **kwargs): self.create_pool_call_count += 1 return AiopgPoolMock() - - -class _PoolAcquireContextManager(_ContextManager): - __slots__ = ("_coro", "_obj", "_pool") - - def __init__(self, coro, pool): - super().__init__(coro) - self._pool = pool - - async def __aexit__(self, exc_type, exc, tb): - await self._pool.release(self._obj) - self._pool = None - self._obj = None From ff72695ac77491df53aa60cb32f8eb201e976a89 Mon Sep 17 00:00:00 2001 From: Nimrod Shlagman Date: Mon, 5 Dec 2022 10:20:28 +0200 Subject: [PATCH 04/11] add tox generate --- instrumentation/README.md | 2 +- .../aiopg/aiopg_integration.py | 56 ++++++++++++++++++- .../instrumentation/aiopg/wrappers.py | 2 +- .../tests/test_aiopg_integration.py | 1 + 4 files changed, 58 insertions(+), 3 deletions(-) diff --git a/instrumentation/README.md b/instrumentation/README.md index d5ef42954c..1c1f71883d 100644 --- a/instrumentation/README.md +++ b/instrumentation/README.md @@ -3,7 +3,7 @@ | --------------- | ------------------ | --------------- | | [opentelemetry-instrumentation-aio-pika](./opentelemetry-instrumentation-aio-pika) | aio_pika ~= 7.2.0 | No | [opentelemetry-instrumentation-aiohttp-client](./opentelemetry-instrumentation-aiohttp-client) | aiohttp ~= 3.0 | No -| [opentelemetry-instrumentation-aiopg](./opentelemetry-instrumentation-aiopg) | aiopg >= 0.13.0, < 1.3.0 | No +| [opentelemetry-instrumentation-aiopg](./opentelemetry-instrumentation-aiopg) | aiopg >= 0.13.0, <= 1.4.0 | No | [opentelemetry-instrumentation-asgi](./opentelemetry-instrumentation-asgi) | asgiref ~= 3.0 | No | [opentelemetry-instrumentation-asyncpg](./opentelemetry-instrumentation-asyncpg) | asyncpg >= 0.12.0 | No | [opentelemetry-instrumentation-aws-lambda](./opentelemetry-instrumentation-aws-lambda) | aws_lambda | No diff --git a/instrumentation/opentelemetry-instrumentation-aiopg/src/opentelemetry/instrumentation/aiopg/aiopg_integration.py b/instrumentation/opentelemetry-instrumentation-aiopg/src/opentelemetry/instrumentation/aiopg/aiopg_integration.py index 1e29512c90..3b36bc1ff2 100644 --- a/instrumentation/opentelemetry-instrumentation-aiopg/src/opentelemetry/instrumentation/aiopg/aiopg_integration.py +++ b/instrumentation/opentelemetry-instrumentation-aiopg/src/opentelemetry/instrumentation/aiopg/aiopg_integration.py @@ -1,12 +1,13 @@ +import asyncio import typing import wrapt -from aiopg.utils import _ContextManager from opentelemetry.instrumentation.dbapi import ( CursorTracer, DatabaseApiIntegration, ) +from collections.abc import Coroutine from opentelemetry.trace import SpanKind @@ -152,6 +153,59 @@ async def callproc(self, *args, **kwargs): return AsyncCursorTracerProxy(cursor, *args, **kwargs) +class _ContextManager(Coroutine): + __slots__ = ("_coro", "_obj") + + def __init__(self, coro): + self._coro = coro + self._obj = None + + def send(self, value): + return self._coro.send(value) + + def throw(self, typ, val=None, tb=None): + if val is None: + return self._coro.throw(typ) + if tb is None: + return self._coro.throw(typ, val) + return self._coro.throw(typ, val, tb) + + def close(self): + return self._coro.close() + + @property + def gi_frame(self): + return self._coro.gi_frame + + @property + def gi_running(self): + return self._coro.gi_running + + @property + def gi_code(self): + return self._coro.gi_code + + def __next__(self): + return self.send(None) + + def __await__(self): + resp = self._coro.__await__() + return resp + + async def __aenter__(self): + self._obj = await self._coro + return self._obj + + async def __aexit__(self, exc_type, exc, tb): + try: + if asyncio.iscoroutinefunction(self._obj.close): + await self._obj.close() + else: + self._obj.close() + finally: + self._obj = None + + class _PoolContextManager(_ContextManager): __slots__ = () diff --git a/instrumentation/opentelemetry-instrumentation-aiopg/src/opentelemetry/instrumentation/aiopg/wrappers.py b/instrumentation/opentelemetry-instrumentation-aiopg/src/opentelemetry/instrumentation/aiopg/wrappers.py index d62291ca2f..61574d5b25 100644 --- a/instrumentation/opentelemetry-instrumentation-aiopg/src/opentelemetry/instrumentation/aiopg/wrappers.py +++ b/instrumentation/opentelemetry-instrumentation-aiopg/src/opentelemetry/instrumentation/aiopg/wrappers.py @@ -34,12 +34,12 @@ import aiopg import wrapt -from aiopg.utils import _ContextManager # pylint: disable=no-name-in-module from opentelemetry.instrumentation.aiopg.aiopg_integration import ( AiopgIntegration, AsyncProxyObject, _PoolContextManager, + _ContextManager, get_traced_connection_proxy, ) from opentelemetry.instrumentation.aiopg.version import __version__ diff --git a/instrumentation/opentelemetry-instrumentation-aiopg/tests/test_aiopg_integration.py b/instrumentation/opentelemetry-instrumentation-aiopg/tests/test_aiopg_integration.py index 5b0db12eb6..1fb04da071 100644 --- a/instrumentation/opentelemetry-instrumentation-aiopg/tests/test_aiopg_integration.py +++ b/instrumentation/opentelemetry-instrumentation-aiopg/tests/test_aiopg_integration.py @@ -24,6 +24,7 @@ from opentelemetry.instrumentation.aiopg import AiopgInstrumentor, wrappers from opentelemetry.instrumentation.aiopg.aiopg_integration import ( AiopgIntegration, + _ContextManager, _PoolAcquireContextManager, ) from opentelemetry.sdk import resources From 2dc4c2c412be4e4793c0c7c7aa3d12ff27ed4d1d Mon Sep 17 00:00:00 2001 From: Nimrod Shlagman Date: Mon, 5 Dec 2022 12:12:16 +0200 Subject: [PATCH 05/11] lint fix --- .../opentelemetry/instrumentation/aiopg/aiopg_integration.py | 2 +- .../src/opentelemetry/instrumentation/aiopg/wrappers.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/instrumentation/opentelemetry-instrumentation-aiopg/src/opentelemetry/instrumentation/aiopg/aiopg_integration.py b/instrumentation/opentelemetry-instrumentation-aiopg/src/opentelemetry/instrumentation/aiopg/aiopg_integration.py index 3b36bc1ff2..61c2b0a303 100644 --- a/instrumentation/opentelemetry-instrumentation-aiopg/src/opentelemetry/instrumentation/aiopg/aiopg_integration.py +++ b/instrumentation/opentelemetry-instrumentation-aiopg/src/opentelemetry/instrumentation/aiopg/aiopg_integration.py @@ -1,5 +1,6 @@ import asyncio import typing +from collections.abc import Coroutine import wrapt @@ -7,7 +8,6 @@ CursorTracer, DatabaseApiIntegration, ) -from collections.abc import Coroutine from opentelemetry.trace import SpanKind diff --git a/instrumentation/opentelemetry-instrumentation-aiopg/src/opentelemetry/instrumentation/aiopg/wrappers.py b/instrumentation/opentelemetry-instrumentation-aiopg/src/opentelemetry/instrumentation/aiopg/wrappers.py index 61574d5b25..c4252615b8 100644 --- a/instrumentation/opentelemetry-instrumentation-aiopg/src/opentelemetry/instrumentation/aiopg/wrappers.py +++ b/instrumentation/opentelemetry-instrumentation-aiopg/src/opentelemetry/instrumentation/aiopg/wrappers.py @@ -38,8 +38,8 @@ from opentelemetry.instrumentation.aiopg.aiopg_integration import ( AiopgIntegration, AsyncProxyObject, - _PoolContextManager, _ContextManager, + _PoolContextManager, get_traced_connection_proxy, ) from opentelemetry.instrumentation.aiopg.version import __version__ From 7fcdd6399f32ec487002d9bd149ddb85cbca9f95 Mon Sep 17 00:00:00 2001 From: Nimrod Shlagman Date: Mon, 5 Dec 2022 12:40:32 +0200 Subject: [PATCH 06/11] rm unused import --- .../tests/test_aiopg_integration.py | 1 - 1 file changed, 1 deletion(-) diff --git a/instrumentation/opentelemetry-instrumentation-aiopg/tests/test_aiopg_integration.py b/instrumentation/opentelemetry-instrumentation-aiopg/tests/test_aiopg_integration.py index 1fb04da071..b5a248f488 100644 --- a/instrumentation/opentelemetry-instrumentation-aiopg/tests/test_aiopg_integration.py +++ b/instrumentation/opentelemetry-instrumentation-aiopg/tests/test_aiopg_integration.py @@ -17,7 +17,6 @@ from unittest.mock import MagicMock import aiopg -from aiopg.utils import _ContextManager # pylint: disable=no-name-in-module import opentelemetry.instrumentation.aiopg from opentelemetry import trace as trace_api From 300f28075d28f0b8b5095c990721e418ef7a16bd Mon Sep 17 00:00:00 2001 From: Nimrod Shlagman Date: Mon, 5 Dec 2022 15:57:19 +0200 Subject: [PATCH 07/11] lint fix --- .../opentelemetry/instrumentation/aiopg/aiopg_integration.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/instrumentation/opentelemetry-instrumentation-aiopg/src/opentelemetry/instrumentation/aiopg/aiopg_integration.py b/instrumentation/opentelemetry-instrumentation-aiopg/src/opentelemetry/instrumentation/aiopg/aiopg_integration.py index 61c2b0a303..bc3006b843 100644 --- a/instrumentation/opentelemetry-instrumentation-aiopg/src/opentelemetry/instrumentation/aiopg/aiopg_integration.py +++ b/instrumentation/opentelemetry-instrumentation-aiopg/src/opentelemetry/instrumentation/aiopg/aiopg_integration.py @@ -196,7 +196,7 @@ async def __aenter__(self): self._obj = await self._coro return self._obj - async def __aexit__(self, exc_type, exc, tb): + async def __aexit__(self, exc_type, exc, t_b): try: if asyncio.iscoroutinefunction(self._obj.close): await self._obj.close() From f02e70c5dc94f0c28f01b2bb9f425a8f91ff2194 Mon Sep 17 00:00:00 2001 From: Nimrod Shlagman Date: Mon, 5 Dec 2022 16:44:10 +0200 Subject: [PATCH 08/11] add changelog entry --- CHANGELOG.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 360b821440..8303db7d7a 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -31,6 +31,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ### Fixed +- Fix aiopg instrumentation to work with aiopg <= 1.4.0 + ([#1473](https://github.com/open-telemetry/opentelemetry-python-contrib/pull/1473)) - Fix bug in Urllib instrumentation - add status code to span attributes only if the status code is not None. ([#1430](https://github.com/open-telemetry/opentelemetry-python-contrib/pull/1430)) - `opentelemetry-instrumentation-aiohttp-client` Allow overriding of status in response hook. From a7622045842bbc1782c87ff24f016157305146a8 Mon Sep 17 00:00:00 2001 From: Nimrod Shlagman Date: Sun, 11 Dec 2022 11:19:06 +0200 Subject: [PATCH 09/11] increase version support --- instrumentation/README.md | 2 +- .../opentelemetry-instrumentation-aiopg/pyproject.toml | 2 +- .../src/opentelemetry/instrumentation/aiopg/package.py | 2 +- .../src/opentelemetry/instrumentation/bootstrap_gen.py | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/instrumentation/README.md b/instrumentation/README.md index da448e1a81..31bd80d401 100644 --- a/instrumentation/README.md +++ b/instrumentation/README.md @@ -3,7 +3,7 @@ | --------------- | ------------------ | --------------- | | [opentelemetry-instrumentation-aio-pika](./opentelemetry-instrumentation-aio-pika) | aio_pika ~= 7.2.0 | No | [opentelemetry-instrumentation-aiohttp-client](./opentelemetry-instrumentation-aiohttp-client) | aiohttp ~= 3.0 | No -| [opentelemetry-instrumentation-aiopg](./opentelemetry-instrumentation-aiopg) | aiopg >= 0.13.0, <= 1.4.0 | No +| [opentelemetry-instrumentation-aiopg](./opentelemetry-instrumentation-aiopg) | aiopg >= 0.13.0, <= 2.0.0 | No | [opentelemetry-instrumentation-asgi](./opentelemetry-instrumentation-asgi) | asgiref ~= 3.0 | No | [opentelemetry-instrumentation-asyncpg](./opentelemetry-instrumentation-asyncpg) | asyncpg >= 0.12.0 | No | [opentelemetry-instrumentation-aws-lambda](./opentelemetry-instrumentation-aws-lambda) | aws_lambda | No diff --git a/instrumentation/opentelemetry-instrumentation-aiopg/pyproject.toml b/instrumentation/opentelemetry-instrumentation-aiopg/pyproject.toml index d968234b41..4ad44d7013 100644 --- a/instrumentation/opentelemetry-instrumentation-aiopg/pyproject.toml +++ b/instrumentation/opentelemetry-instrumentation-aiopg/pyproject.toml @@ -33,7 +33,7 @@ dependencies = [ [project.optional-dependencies] instruments = [ - "aiopg >= 0.13.0, <= 1.4.0", + "aiopg >= 0.13.0, <= 2.0.0", ] test = [ "opentelemetry-instrumentation-aiopg[instruments]", diff --git a/instrumentation/opentelemetry-instrumentation-aiopg/src/opentelemetry/instrumentation/aiopg/package.py b/instrumentation/opentelemetry-instrumentation-aiopg/src/opentelemetry/instrumentation/aiopg/package.py index 23c280285a..f959f8fd43 100644 --- a/instrumentation/opentelemetry-instrumentation-aiopg/src/opentelemetry/instrumentation/aiopg/package.py +++ b/instrumentation/opentelemetry-instrumentation-aiopg/src/opentelemetry/instrumentation/aiopg/package.py @@ -13,4 +13,4 @@ # limitations under the License. -_instruments = ("aiopg >= 0.13.0, <= 1.4.0",) +_instruments = ("aiopg >= 0.13.0, <= 2.0.0",) diff --git a/opentelemetry-instrumentation/src/opentelemetry/instrumentation/bootstrap_gen.py b/opentelemetry-instrumentation/src/opentelemetry/instrumentation/bootstrap_gen.py index e82d13daaf..049ab20cac 100644 --- a/opentelemetry-instrumentation/src/opentelemetry/instrumentation/bootstrap_gen.py +++ b/opentelemetry-instrumentation/src/opentelemetry/instrumentation/bootstrap_gen.py @@ -25,7 +25,7 @@ "instrumentation": "opentelemetry-instrumentation-aiohttp-client==0.37b0.dev", }, "aiopg": { - "library": "aiopg >= 0.13.0, <= 1.4.0", + "library": "aiopg >= 0.13.0, <=2.0.0", "instrumentation": "opentelemetry-instrumentation-aiopg==0.36b0.dev", }, "asgiref": { From 5b5d7076808930f4cfb0e6f7c14ce331224c0f5f Mon Sep 17 00:00:00 2001 From: Nimrod Shlagman Date: Sun, 11 Dec 2022 11:31:04 +0200 Subject: [PATCH 10/11] generate code fix --- .../src/opentelemetry/instrumentation/bootstrap_gen.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/opentelemetry-instrumentation/src/opentelemetry/instrumentation/bootstrap_gen.py b/opentelemetry-instrumentation/src/opentelemetry/instrumentation/bootstrap_gen.py index 049ab20cac..2e3f3d9d49 100644 --- a/opentelemetry-instrumentation/src/opentelemetry/instrumentation/bootstrap_gen.py +++ b/opentelemetry-instrumentation/src/opentelemetry/instrumentation/bootstrap_gen.py @@ -25,8 +25,8 @@ "instrumentation": "opentelemetry-instrumentation-aiohttp-client==0.37b0.dev", }, "aiopg": { - "library": "aiopg >= 0.13.0, <=2.0.0", - "instrumentation": "opentelemetry-instrumentation-aiopg==0.36b0.dev", + "library": "aiopg >= 0.13.0, <= 2.0.0", + "instrumentation": "opentelemetry-instrumentation-aiopg==0.37b0.dev", }, "asgiref": { "library": "asgiref ~= 3.0", From 7319ae058c0eb19eb0857313bcaf94ba05610f2e Mon Sep 17 00:00:00 2001 From: Nimrod Shlagman Date: Sun, 18 Dec 2022 11:30:10 +0200 Subject: [PATCH 11/11] limit aiopg to < 2.0.0 --- CHANGELOG.md | 7 +++++-- instrumentation/README.md | 2 +- .../opentelemetry-instrumentation-aiopg/pyproject.toml | 2 +- .../src/opentelemetry/instrumentation/aiopg/package.py | 2 +- .../src/opentelemetry/instrumentation/bootstrap_gen.py | 2 +- 5 files changed, 9 insertions(+), 6 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index a92bfbd4a3..1b8ad9fc75 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -7,6 +7,11 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ## Unreleased +## Fixed + +- Fix aiopg instrumentation to work with aiopg < 2.0.0 + ([#1473](https://github.com/open-telemetry/opentelemetry-python-contrib/pull/1473)) + ## Version 1.15.0/0.36b0 (2022-12-10) - Add uninstrument test for sqlalchemy @@ -37,8 +42,6 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ### Fixed -- Fix aiopg instrumentation to work with aiopg <= 1.4.0 - ([#1473](https://github.com/open-telemetry/opentelemetry-python-contrib/pull/1473)) - Fix bug in Urllib instrumentation - add status code to span attributes only if the status code is not None. ([#1430](https://github.com/open-telemetry/opentelemetry-python-contrib/pull/1430)) - `opentelemetry-instrumentation-aiohttp-client` Allow overriding of status in response hook. diff --git a/instrumentation/README.md b/instrumentation/README.md index 31bd80d401..98ebb4c728 100644 --- a/instrumentation/README.md +++ b/instrumentation/README.md @@ -3,7 +3,7 @@ | --------------- | ------------------ | --------------- | | [opentelemetry-instrumentation-aio-pika](./opentelemetry-instrumentation-aio-pika) | aio_pika ~= 7.2.0 | No | [opentelemetry-instrumentation-aiohttp-client](./opentelemetry-instrumentation-aiohttp-client) | aiohttp ~= 3.0 | No -| [opentelemetry-instrumentation-aiopg](./opentelemetry-instrumentation-aiopg) | aiopg >= 0.13.0, <= 2.0.0 | No +| [opentelemetry-instrumentation-aiopg](./opentelemetry-instrumentation-aiopg) | aiopg >= 0.13.0, < 2.0.0 | No | [opentelemetry-instrumentation-asgi](./opentelemetry-instrumentation-asgi) | asgiref ~= 3.0 | No | [opentelemetry-instrumentation-asyncpg](./opentelemetry-instrumentation-asyncpg) | asyncpg >= 0.12.0 | No | [opentelemetry-instrumentation-aws-lambda](./opentelemetry-instrumentation-aws-lambda) | aws_lambda | No diff --git a/instrumentation/opentelemetry-instrumentation-aiopg/pyproject.toml b/instrumentation/opentelemetry-instrumentation-aiopg/pyproject.toml index 4ad44d7013..b2326d8586 100644 --- a/instrumentation/opentelemetry-instrumentation-aiopg/pyproject.toml +++ b/instrumentation/opentelemetry-instrumentation-aiopg/pyproject.toml @@ -33,7 +33,7 @@ dependencies = [ [project.optional-dependencies] instruments = [ - "aiopg >= 0.13.0, <= 2.0.0", + "aiopg >= 0.13.0, < 2.0.0", ] test = [ "opentelemetry-instrumentation-aiopg[instruments]", diff --git a/instrumentation/opentelemetry-instrumentation-aiopg/src/opentelemetry/instrumentation/aiopg/package.py b/instrumentation/opentelemetry-instrumentation-aiopg/src/opentelemetry/instrumentation/aiopg/package.py index f959f8fd43..75aa9bedb8 100644 --- a/instrumentation/opentelemetry-instrumentation-aiopg/src/opentelemetry/instrumentation/aiopg/package.py +++ b/instrumentation/opentelemetry-instrumentation-aiopg/src/opentelemetry/instrumentation/aiopg/package.py @@ -13,4 +13,4 @@ # limitations under the License. -_instruments = ("aiopg >= 0.13.0, <= 2.0.0",) +_instruments = ("aiopg >= 0.13.0, < 2.0.0",) diff --git a/opentelemetry-instrumentation/src/opentelemetry/instrumentation/bootstrap_gen.py b/opentelemetry-instrumentation/src/opentelemetry/instrumentation/bootstrap_gen.py index 2e3f3d9d49..36fda70ab1 100644 --- a/opentelemetry-instrumentation/src/opentelemetry/instrumentation/bootstrap_gen.py +++ b/opentelemetry-instrumentation/src/opentelemetry/instrumentation/bootstrap_gen.py @@ -25,7 +25,7 @@ "instrumentation": "opentelemetry-instrumentation-aiohttp-client==0.37b0.dev", }, "aiopg": { - "library": "aiopg >= 0.13.0, <= 2.0.0", + "library": "aiopg >= 0.13.0, < 2.0.0", "instrumentation": "opentelemetry-instrumentation-aiopg==0.37b0.dev", }, "asgiref": {