Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
29 commits
Select commit Hold shift + click to select a range
e5d0ddc
Add support for wrapt 2.x
blarghmatey Feb 13, 2026
477f5b9
Restructure wrapt test requirements
blarghmatey Feb 17, 2026
253820d
chore: Resolve conflicts and add Wrapt 3 as upper bound
blarghmatey Feb 20, 2026
de6e76f
Add wrapt 1.x/2.x test matrix for all ObjectProxy-using instrumentations
blarghmatey Feb 20, 2026
4b85975
Fix CI failures: ruff formatting and lint wrapt version pin
blarghmatey Feb 20, 2026
54e0a4b
Fix remaining CI failures: unused imports and uv.lock
blarghmatey Feb 20, 2026
cc1a9a6
Fix aiopg lint wrapt pin, uv.lock format, and ruff blank lines
blarghmatey Feb 20, 2026
9f7412f
Fix pylint E0611: disable no-name-in-module for BaseObjectProxy compa…
blarghmatey Feb 20, 2026
1799454
Fix asyncpg test: use BaseObjectProxy compat shim for wrapt 2.x
blarghmatey Feb 20, 2026
c4988c4
Address PR review comments: add wrapt 2.0.0+ comments and fix CHANGELOG
blarghmatey Mar 5, 2026
4a88554
Apply suggestions from code review
blarghmatey Mar 6, 2026
0ae757c
chore: Update changelog and workflows
blarghmatey Mar 6, 2026
a9e8e4a
Apply suggestions from code review
blarghmatey Mar 6, 2026
8232079
fix: Update workflows again
blarghmatey Mar 6, 2026
40fdef2
Apply suggestions from code review
blarghmatey Mar 6, 2026
2a51d7d
Remove Deprecated version pins from test-requirements and tox.ini
blarghmatey Mar 6, 2026
c93c4dc
Remove stale .orig file leftover from rebase
blarghmatey Mar 6, 2026
4316e3e
Move lint env wrapt pins from tox.ini into test-requirements files
blarghmatey Mar 6, 2026
f8d23eb
Merge branch 'main' into wrapt-2.0-support
blarghmatey Mar 8, 2026
ab54d2e
Apply suggestions from code review
xrmx Mar 9, 2026
70342a7
Update instrumentation/opentelemetry-instrumentation-botocore/test-re…
xrmx Mar 9, 2026
03cba58
Update instrumentation/opentelemetry-instrumentation-grpc/test-requir…
xrmx Mar 9, 2026
8ff257e
Update instrumentation/opentelemetry-instrumentation-dbapi/test-requi…
xrmx Mar 9, 2026
49f85c3
Update instrumentation/opentelemetry-instrumentation-aiopg/test-requi…
xrmx Mar 9, 2026
0908b58
Merge branch 'main' into wrapt-2.0-support
blarghmatey Mar 9, 2026
e330524
Address latest PR feedback: botocore compat shim, exact wrapt version…
blarghmatey Mar 9, 2026
35e71eb
Merge branch 'main' into wrapt-2.0-support
xrmx Mar 10, 2026
4c04cbf
fix: add pylint disable=no-member for __wrapped__ and abstract-method…
blarghmatey Mar 11, 2026
ce23074
Merge branch 'main' into wrapt-2.0-support
blarghmatey Mar 11, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
432 changes: 396 additions & 36 deletions .github/workflows/core_contrib_test_0.yml

Large diffs are not rendered by default.

1,350 changes: 675 additions & 675 deletions .github/workflows/test_0.yml

Large diffs are not rendered by default.

2,204 changes: 1,102 additions & 1,102 deletions .github/workflows/test_1.yml

Large diffs are not rendered by default.

2,686 changes: 1,799 additions & 887 deletions .github/workflows/test_2.yml

Large diffs are not rendered by default.

413 changes: 413 additions & 0 deletions .github/workflows/test_3.yml

Large diffs are not rendered by default.

4 changes: 3 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,13 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
> Use [this search for a list of all CHANGELOG.md files in this repo](https://github.com/search?q=repo%3Aopen-telemetry%2Fopentelemetry-python-contrib+path%3A**%2FCHANGELOG.md&type=code).

## Unreleased
Comment thread
blarghmatey marked this conversation as resolved.

### Added

- `opentelemetry-instrumentation-confluent-kafka`: Loosen confluent-kafka upper bound to <3.0.0
([#4289](https://github.com/open-telemetry/opentelemetry-python-contrib/pull/4289))
- `opentelemetry-instrumentation`: Add support for wrapt 2.x
([#4203](https://github.com/open-telemetry/opentelemetry-python-contrib/pull/4203))

### Fixed

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ classifiers = [
dependencies = [
"opentelemetry-api ~= 1.5",
"opentelemetry-instrumentation == 0.62b0.dev",
"wrapt >= 1.0.0, < 2.0.0",
Comment thread
blarghmatey marked this conversation as resolved.
"wrapt >= 1.0.0, < 3.0.0",
]

[project.optional-dependencies]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ dependencies = [
"opentelemetry-instrumentation == 0.62b0.dev",
"opentelemetry-semantic-conventions == 0.62b0.dev",
"opentelemetry-util-http == 0.62b0.dev",
"wrapt >= 1.0.0, < 2.0.0",
"wrapt >= 1.0.0, < 3.0.0",
]

[project.optional-dependencies]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ dependencies = [
"opentelemetry-instrumentation == 0.62b0.dev",
"opentelemetry-semantic-conventions == 0.62b0.dev",
"opentelemetry-util-http == 0.62b0.dev",
"wrapt >= 1.0.0, < 2.0.0",
"wrapt >= 1.0.0, < 3.0.0",
]

[project.optional-dependencies]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ dependencies = [
"opentelemetry-api ~= 1.12",
"opentelemetry-instrumentation == 0.62b0.dev",
"opentelemetry-instrumentation-dbapi == 0.62b0.dev",
"wrapt >= 1.0.0, < 2.0.0",
"wrapt >= 1.0.0, < 3.0.0",
]

[project.optional-dependencies]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
from opentelemetry.trace import SpanKind


# pylint: disable=abstract-method
# pylint: disable=abstract-method,no-member
class AsyncProxyObject(wrapt.ObjectProxy):
def __aiter__(self):
return self.__wrapped__.__aiter__()
Expand Down Expand Up @@ -54,7 +54,7 @@ async def wrapped_pool(self, create_pool_method, args, kwargs):
def get_traced_connection_proxy(
connection, db_api_integration, *args, **kwargs
):
# pylint: disable=abstract-method
# pylint: disable=abstract-method,no-member
class TracedConnectionProxy(AsyncProxyObject):
# pylint: disable=unused-argument
def __init__(self, connection, *args, **kwargs):
Expand All @@ -73,7 +73,7 @@ async def _cursor(self, *args, **kwargs):


def get_traced_pool_proxy(pool, db_api_integration, *args, **kwargs):
# pylint: disable=abstract-method
# pylint: disable=abstract-method,no-member
class TracedPoolProxy(AsyncProxyObject):
# pylint: disable=unused-argument
def __init__(self, pool, *args, **kwargs):
Expand Down Expand Up @@ -125,7 +125,7 @@ async def traced_execution(
def get_traced_cursor_proxy(cursor, db_api_integration, *args, **kwargs):
_traced_cursor = AsyncCursorTracer(db_api_integration)

# pylint: disable=abstract-method
# pylint: disable=abstract-method,no-member
class AsyncCursorTracerProxy(AsyncProxyObject):
# pylint: disable=unused-argument
def __init__(self, cursor, *args, **kwargs):
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
-r test-requirements.txt
wrapt==1.17.3
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
-r test-requirements.txt
wrapt==2.1.2
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
aiopg==1.4.0
asgiref==3.8.1
async-timeout==4.0.3
Deprecated==1.2.14
Comment thread
blarghmatey marked this conversation as resolved.
iniconfig==2.0.0
packaging==24.0
pluggy==1.5.0
Expand All @@ -10,7 +9,6 @@ py-cpuinfo==9.0.0
pytest==7.4.4
tomli==2.0.1
typing_extensions==4.12.2
wrapt==1.16.0
zipp==3.19.2
-e opentelemetry-instrumentation
-e instrumentation/opentelemetry-instrumentation-dbapi
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -472,7 +472,7 @@ def test_instrument_connection(self):
connection2 = wrappers.instrument_connection(
self.tracer, connection, "-"
)
self.assertIs(connection2.__wrapped__, connection)
self.assertIs(connection2.__wrapped__, connection) # pylint: disable=no-member

def test_uninstrument_connection(self):
connection = mock.Mock()
Expand All @@ -482,7 +482,7 @@ def test_uninstrument_connection(self):
connection2 = wrappers.instrument_connection(
self.tracer, connection, "-"
)
self.assertIs(connection2.__wrapped__, connection)
self.assertIs(connection2.__wrapped__, connection) # pylint: disable=no-member

connection3 = wrappers.uninstrument_connection(connection2)
self.assertIs(connection3, connection)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ dependencies = [
"opentelemetry-api ~= 1.14",
"opentelemetry-instrumentation == 0.62b0.dev",
"opentelemetry-semantic-conventions == 0.62b0.dev",
"wrapt >= 1.0.0, < 2.0.0",
"wrapt >= 1.0.0, < 3.0.0",
]

[project.optional-dependencies]
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
-r test-requirements.txt
wrapt==1.17.3
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
-r test-requirements.txt
wrapt==2.1.2
Original file line number Diff line number Diff line change
@@ -1,15 +1,13 @@
asgiref==3.8.1
async-timeout==4.0.3
asyncpg==0.30.0
Deprecated==1.2.14
iniconfig==2.0.0
packaging==24.0
pluggy==1.5.0
py-cpuinfo==9.0.0
pytest==7.4.4
tomli==2.0.1
typing_extensions==4.12.2
wrapt==1.16.0
zipp==3.19.2
-e opentelemetry-instrumentation
-e instrumentation/opentelemetry-instrumentation-asyncpg
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,12 @@

import pytest
from asyncpg import Connection, Record, cursor
from wrapt import ObjectProxy

try:
# wrapt 2.0.0+
from wrapt import BaseObjectProxy # pylint: disable=no-name-in-module
except ImportError:
from wrapt import ObjectProxy as BaseObjectProxy

from opentelemetry import trace as trace_api
from opentelemetry.instrumentation.asyncpg import AsyncPGInstrumentor
Expand Down Expand Up @@ -50,7 +55,7 @@ def assert_wrapped(assert_fnc):
for method_name in methods:
method = getattr(cls, method_name, None)
assert_fnc(
isinstance(method, ObjectProxy),
isinstance(method, BaseObjectProxy),
f"{method} isinstance {type(method)}",
)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ dependencies = [
"opentelemetry-api ~= 1.12",
"opentelemetry-instrumentation == 0.62b0.dev",
"opentelemetry-semantic-conventions == 0.62b0.dev",
"wrapt >= 1.0.0, < 2.0.0",
"wrapt >= 1.0.0, < 3.0.0",
]

[project.optional-dependencies]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ dependencies = [
"opentelemetry-instrumentation == 0.62b0.dev",
"opentelemetry-semantic-conventions == 0.62b0.dev",
"opentelemetry-propagator-aws-xray ~= 1.0",
"wrapt >= 1.0.0, < 3.0.0",
]

[project.optional-dependencies]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,12 @@
from typing import Any, Callable, Dict, Iterator, Sequence, Union

from botocore.eventstream import EventStream, EventStreamError
from wrapt import ObjectProxy

try:
# wrapt 2.0.0+
from wrapt import BaseObjectProxy # pylint: disable=no-name-in-module
except ImportError:
from wrapt import ObjectProxy as BaseObjectProxy

from opentelemetry._logs import LogRecord
from opentelemetry.context import get_current
Expand All @@ -37,7 +42,7 @@


# pylint: disable=abstract-method
class ConverseStreamWrapper(ObjectProxy):
class ConverseStreamWrapper(BaseObjectProxy):
"""Wrapper for botocore.eventstream.EventStream"""

def __init__(
Expand All @@ -61,7 +66,7 @@ def __init__(

def __iter__(self):
try:
for event in self.__wrapped__:
for event in self.__wrapped__: # pylint: disable=no-member
self._process_event(event)
yield event
except EventStreamError as exc:
Expand Down Expand Up @@ -143,7 +148,7 @@ def _process_event(self, event):
return

def close(self):
self.__wrapped__.close()
self.__wrapped__.close() # pylint: disable=no-member
# Treat the stream as done to ensure the span end.
self._complete_stream(self._response)

Expand All @@ -157,7 +162,7 @@ def _handle_stream_error(self, exc):


# pylint: disable=abstract-method
class InvokeModelWithResponseStreamWrapper(ObjectProxy):
class InvokeModelWithResponseStreamWrapper(BaseObjectProxy):
"""Wrapper for botocore.eventstream.EventStream"""

def __init__(
Expand All @@ -183,7 +188,7 @@ def __init__(
self._ended = False

def close(self):
self.__wrapped__.close()
self.__wrapped__.close() # pylint: disable=no-member
# Treat the stream as done to ensure the span end.
self._stream_done_callback(self._response, self._ended)

Expand All @@ -197,7 +202,7 @@ def _handle_stream_error(self, exc):

def __iter__(self):
try:
for event in self.__wrapped__:
for event in self.__wrapped__: # pylint: disable=no-member
self._process_event(event)
yield event
except EventStreamError as exc:
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
-r test-requirements-0.txt
wrapt==1.17.3
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
-r test-requirements-0.txt
wrapt==2.1.2
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ certifi==2024.7.4
cffi==1.17.0
charset-normalizer==3.3.2
cryptography==43.0.1
Deprecated==1.2.14
docker==7.0.0
idna==3.7
iniconfig==2.0.0
Expand All @@ -31,7 +30,6 @@ tomli==2.0.1
typing_extensions==4.12.2
urllib3==1.26.19
Werkzeug==3.0.6
wrapt==1.16.0
xmltodict==0.13.0
zipp==3.19.2
-e opentelemetry-instrumentation
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
-r test-requirements-1.txt
wrapt==1.17.3
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
-r test-requirements-1.txt
wrapt==2.1.2
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ certifi==2024.7.4
cffi==1.17.0
charset-normalizer==3.3.2
cryptography==43.0.1
Deprecated==1.2.14
docker==7.0.0
idna==3.7
iniconfig==2.0.0
Expand All @@ -31,7 +30,6 @@ tomli==2.0.1
typing_extensions==4.12.2
urllib3==1.26.19
Werkzeug==3.0.6
wrapt==1.16.0
xmltodict==0.13.0
zipp==3.19.2
-e opentelemetry-instrumentation
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ dependencies = [
"opentelemetry-api ~= 1.12",
"opentelemetry-instrumentation == 0.62b0.dev",
"opentelemetry-semantic-conventions == 0.62b0.dev",
"wrapt >= 1.0.0, < 2.0.0",
"wrapt >= 1.0.0, < 3.0.0",
]

[project.optional-dependencies]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ dependencies = [
"opentelemetry-api ~= 1.12",
"opentelemetry-instrumentation == 0.62b0.dev",
"opentelemetry-semantic-conventions == 0.62b0.dev",
"wrapt >= 1.0.0, < 2.0.0",
"wrapt >= 1.0.0, < 3.0.0",
]

[project.optional-dependencies]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ classifiers = [
dependencies = [
"opentelemetry-instrumentation == 0.62b0.dev",
"opentelemetry-api ~= 1.12",
"wrapt >= 1.0.0, < 2.0.0",
"wrapt >= 1.0.0, < 3.0.0",
]

[project.optional-dependencies]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ dependencies = [
"opentelemetry-api ~= 1.12",
"opentelemetry-instrumentation == 0.62b0.dev",
"opentelemetry-semantic-conventions == 0.62b0.dev",
"wrapt >= 1.0.0, < 2.0.0",
"wrapt >= 1.0.0, < 3.0.0",
]

[project.optional-dependencies]
Expand Down
Loading
Loading