Skip to content

Commit e5f766f

Browse files
authored
Merge branch 'main' into headers
2 parents 2ed0d94 + 5e4766e commit e5f766f

File tree

10 files changed

+20
-14
lines changed

10 files changed

+20
-14
lines changed

Diff for: CHANGELOG.md

+1
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
99

1010
### Added
1111

12+
- Support `aio_pika` 9.x (([#1670](https://github.com/open-telemetry/opentelemetry-python-contrib/pull/1670])
1213
- `opentelemetry-instrumentation-redis` Add `sanitize_query` config option to allow query sanitization. ([#1572](https://github.com/open-telemetry/opentelemetry-python-contrib/pull/1572))
1314
- `opentelemetry-instrumentation-elasticsearch` Add optional db.statement query sanitization.
1415
([#1598](https://github.com/open-telemetry/opentelemetry-python-contrib/pull/1598))

Diff for: instrumentation/README.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11

22
| Instrumentation | Supported Packages | Metrics support |
33
| --------------- | ------------------ | --------------- |
4-
| [opentelemetry-instrumentation-aio-pika](./opentelemetry-instrumentation-aio-pika) | aio_pika >= 7.2.0, < 9.0.0 | No
4+
| [opentelemetry-instrumentation-aio-pika](./opentelemetry-instrumentation-aio-pika) | aio_pika >= 7.2.0, < 10.0.0 | No
55
| [opentelemetry-instrumentation-aiohttp-client](./opentelemetry-instrumentation-aiohttp-client) | aiohttp ~= 3.0 | No
66
| [opentelemetry-instrumentation-aiopg](./opentelemetry-instrumentation-aiopg) | aiopg >= 0.13.0, < 2.0.0 | No
77
| [opentelemetry-instrumentation-asgi](./opentelemetry-instrumentation-asgi) | asgiref ~= 3.0 | No

Diff for: instrumentation/opentelemetry-instrumentation-aio-pika/pyproject.toml

+1-1
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ dependencies = [
3131

3232
[project.optional-dependencies]
3333
instruments = [
34-
"aio_pika >= 7.2.0, < 9.0.0",
34+
"aio_pika >= 7.2.0, < 10.0.0",
3535
]
3636
test = [
3737
"opentelemetry-instrumentation-aio-pika[instruments]",

Diff for: instrumentation/opentelemetry-instrumentation-aio-pika/src/opentelemetry/instrumentation/aio_pika/package.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -13,4 +13,4 @@
1313
# limitations under the License.
1414
from typing import Collection
1515

16-
_instruments: Collection[str] = ("aio_pika >= 7.2.0, < 9.0.0",)
16+
_instruments: Collection[str] = ("aio_pika >= 7.2.0, < 10.0.0",)

Diff for: instrumentation/opentelemetry-instrumentation-aio-pika/tests/consts.py

+2
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,9 @@
11
from argparse import Namespace
22

3+
from aio_pika import __version__ as aiopika_version
34
from yarl import URL
45

6+
AIOPIKA_VERSION_INFO = tuple(int(v) for v in aiopika_version.split("."))
57
MESSAGE_ID = "meesage_id"
68
CORRELATION_ID = "correlation_id"
79
MESSAGING_SYSTEM = "rabbitmq"

Diff for: instrumentation/opentelemetry-instrumentation-aio-pika/tests/test_callback_decorator.py

+4-3
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
import asyncio
1515
from unittest import TestCase, mock, skipIf
1616

17-
from aio_pika import Queue, version_info
17+
from aio_pika import Queue
1818

1919
from opentelemetry.instrumentation.aio_pika.callback_decorator import (
2020
CallbackDecorator,
@@ -23,6 +23,7 @@
2323
from opentelemetry.trace import SpanKind, get_tracer
2424

2525
from .consts import (
26+
AIOPIKA_VERSION_INFO,
2627
CHANNEL_7,
2728
CHANNEL_8,
2829
CORRELATION_ID,
@@ -36,7 +37,7 @@
3637
)
3738

3839

39-
@skipIf(version_info >= (8, 0), "Only for aio_pika 7")
40+
@skipIf(AIOPIKA_VERSION_INFO >= (8, 0), "Only for aio_pika 7")
4041
class TestInstrumentedQueueAioRmq7(TestCase):
4142
EXPECTED_ATTRIBUTES = {
4243
SpanAttributes.MESSAGING_SYSTEM: MESSAGING_SYSTEM,
@@ -76,7 +77,7 @@ def test_decorate_callback(self):
7677
callback.assert_called_once_with(MESSAGE)
7778

7879

79-
@skipIf(version_info <= (8, 0), "Only for aio_pika 8")
80+
@skipIf(AIOPIKA_VERSION_INFO <= (8, 0), "Only for aio_pika 8")
8081
class TestInstrumentedQueueAioRmq8(TestCase):
8182
EXPECTED_ATTRIBUTES = {
8283
SpanAttributes.MESSAGING_SYSTEM: MESSAGING_SYSTEM,

Diff for: instrumentation/opentelemetry-instrumentation-aio-pika/tests/test_publish_decorator.py

+4-3
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
from typing import Type
1616
from unittest import TestCase, mock, skipIf
1717

18-
from aio_pika import Exchange, RobustExchange, version_info
18+
from aio_pika import Exchange, RobustExchange
1919

2020
from opentelemetry.instrumentation.aio_pika.publish_decorator import (
2121
PublishDecorator,
@@ -24,6 +24,7 @@
2424
from opentelemetry.trace import SpanKind, get_tracer
2525

2626
from .consts import (
27+
AIOPIKA_VERSION_INFO,
2728
CHANNEL_7,
2829
CHANNEL_8,
2930
CONNECTION_7,
@@ -39,7 +40,7 @@
3940
)
4041

4142

42-
@skipIf(version_info >= (8, 0), "Only for aio_pika 7")
43+
@skipIf(AIOPIKA_VERSION_INFO >= (8, 0), "Only for aio_pika 7")
4344
class TestInstrumentedExchangeAioRmq7(TestCase):
4445
EXPECTED_ATTRIBUTES = {
4546
SpanAttributes.MESSAGING_SYSTEM: MESSAGING_SYSTEM,
@@ -92,7 +93,7 @@ def test_robust_publish(self):
9293
self._test_publish(RobustExchange)
9394

9495

95-
@skipIf(version_info <= (8, 0), "Only for aio_pika 8")
96+
@skipIf(AIOPIKA_VERSION_INFO <= (8, 0), "Only for aio_pika 8")
9697
class TestInstrumentedExchangeAioRmq8(TestCase):
9798
EXPECTED_ATTRIBUTES = {
9899
SpanAttributes.MESSAGING_SYSTEM: MESSAGING_SYSTEM,
Binary file not shown.

Diff for: opentelemetry-instrumentation/src/opentelemetry/instrumentation/bootstrap_gen.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717

1818
libraries = {
1919
"aio_pika": {
20-
"library": "aio_pika >= 7.2.0, < 9.0.0",
20+
"library": "aio_pika >= 7.2.0, < 10.0.0",
2121
"instrumentation": "opentelemetry-instrumentation-aio-pika==0.37b0.dev",
2222
},
2323
"aiohttp": {

Diff for: tox.ini

+5-4
Original file line numberDiff line numberDiff line change
@@ -207,8 +207,8 @@ envlist =
207207
pypy3-test-instrumentation-pika{0,1}
208208

209209
; opentelemetry-instrumentation-aio-pika
210-
py3{7,8,9,10,11}-test-instrumentation-aio-pika{7,8}
211-
pypy3-test-instrumentation-aio-pika{7,8}
210+
py3{7,8,9,10,11}-test-instrumentation-aio-pika{7,8,9}
211+
pypy3-test-instrumentation-aio-pika{7,8,9}
212212

213213
; opentelemetry-instrumentation-kafka-python
214214
py3{7,8,9,10,11}-test-instrumentation-kafka-python
@@ -256,6 +256,7 @@ deps =
256256
pika1: pika>=1.0.0
257257
aio-pika7: aio_pika~=7.2.0
258258
aio-pika8: aio_pika>=8.0.0,<9.0.0
259+
aio-pika9: aio_pika>=9.0.0,<10.0.0
259260
pymemcache135: pymemcache ==1.3.5
260261
pymemcache200: pymemcache >2.0.0,<3.0.0
261262
pymemcache300: pymemcache >3.0.0,<3.4.2
@@ -302,7 +303,7 @@ changedir =
302303
test-instrumentation-logging: instrumentation/opentelemetry-instrumentation-logging/tests
303304
test-instrumentation-mysql: instrumentation/opentelemetry-instrumentation-mysql/tests
304305
test-instrumentation-pika{0,1}: instrumentation/opentelemetry-instrumentation-pika/tests
305-
test-instrumentation-aio-pika{7,8}: instrumentation/opentelemetry-instrumentation-aio-pika/tests
306+
test-instrumentation-aio-pika{7,8,9}: instrumentation/opentelemetry-instrumentation-aio-pika/tests
306307
test-instrumentation-psycopg2: instrumentation/opentelemetry-instrumentation-psycopg2/tests
307308
test-instrumentation-pymemcache{135,200,300,342}: instrumentation/opentelemetry-instrumentation-pymemcache/tests
308309
test-instrumentation-pymongo: instrumentation/opentelemetry-instrumentation-pymongo/tests
@@ -344,7 +345,7 @@ commands_pre =
344345

345346
pika{0,1}: pip install {toxinidir}/instrumentation/opentelemetry-instrumentation-pika[test]
346347

347-
aio-pika{7,8}: pip install {toxinidir}/instrumentation/opentelemetry-instrumentation-aio-pika[test]
348+
aio-pika{7,8,9}: pip install {toxinidir}/instrumentation/opentelemetry-instrumentation-aio-pika[test]
348349

349350
kafka-python: pip install {toxinidir}/instrumentation/opentelemetry-instrumentation-kafka-python[test]
350351

0 commit comments

Comments
 (0)