Skip to content

Commit 2d04bf8

Browse files
authored
Merge branch 'main' into Change-metrics-tests-to-work-with-test_base
2 parents 32e940b + 74a8b90 commit 2d04bf8

File tree

134 files changed

+703
-452
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

134 files changed

+703
-452
lines changed

Diff for: .github/workflows/backport.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ jobs:
2828
env:
2929
NUMBER: ${{ github.event.inputs.number }}
3030
# not using secrets.GITHUB_TOKEN since pull requests from that token do not run workflows
31-
GITHUB_TOKEN: ${{ secrets.BOT_TOKEN }}
31+
GITHUB_TOKEN: ${{ secrets.OPENTELEMETRYBOT_GITHUB_TOKEN }}
3232
run: |
3333
commit=$(gh pr view $NUMBER --json mergeCommit --jq .mergeCommit.oid)
3434
title=$(gh pr view $NUMBER --json title --jq .title)

Diff for: .github/workflows/prepare-patch-release.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ jobs:
6969
- name: Create pull request
7070
env:
7171
# not using secrets.GITHUB_TOKEN since pull requests from that token do not run workflows
72-
GITHUB_TOKEN: ${{ secrets.BOT_TOKEN }}
72+
GITHUB_TOKEN: ${{ secrets.OPENTELEMETRYBOT_GITHUB_TOKEN }}
7373
run: |
7474
message="Prepare release ${STABLE_VERSION}/${UNSTABLE_VERSION}"
7575
branch="opentelemetrybot/prepare-release-${STABLE_VERSION}-${UNSTABLE_VERSION}"

Diff for: .github/workflows/prepare-release-branch.yml

+2-2
Original file line numberDiff line numberDiff line change
@@ -96,7 +96,7 @@ jobs:
9696
- name: Create pull request against the release branch
9797
env:
9898
# not using secrets.GITHUB_TOKEN since pull requests from that token do not run workflows
99-
GITHUB_TOKEN: ${{ secrets.BOT_TOKEN }}
99+
GITHUB_TOKEN: ${{ secrets.OPENTELEMETRYBOT_GITHUB_TOKEN }}
100100
run: |
101101
message="Prepare release ${STABLE_VERSION}/${UNSTABLE_VERSION}"
102102
branch="opentelemetrybot/prepare-release-${STABLE_VERSION}-${UNSTABLE_VERSION}"
@@ -181,7 +181,7 @@ jobs:
181181
- name: Create pull request against main
182182
env:
183183
# not using secrets.GITHUB_TOKEN since pull requests from that token do not run workflows
184-
GITHUB_TOKEN: ${{ secrets.BOT_TOKEN }}
184+
GITHUB_TOKEN: ${{ secrets.OPENTELEMETRYBOT_GITHUB_TOKEN }}
185185
run: |
186186
message="Update version to ${STABLE_NEXT_VERSION}/${UNSTABLE_NEXT_VERSION}"
187187
body="Update version to \`${STABLE_NEXT_VERSION}/${UNSTABLE_NEXT_VERSION}\`."

Diff for: .github/workflows/release.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -184,7 +184,7 @@ jobs:
184184
- name: Create pull request against main
185185
env:
186186
# not using secrets.GITHUB_TOKEN since pull requests from that token do not run workflows
187-
GITHUB_TOKEN: ${{ secrets.BOT_TOKEN }}
187+
GITHUB_TOKEN: ${{ secrets.OPENTELEMETRYBOT_GITHUB_TOKEN }}
188188
run: |
189189
message="Copy change log updates from $GITHUB_REF_NAME"
190190
body="Copy log updates from \`$GITHUB_REF_NAME\`."

Diff for: CHANGELOG.md

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

1010
### Added
1111

12+
- Add connection attributes to sqlalchemy connect span
13+
([#1608](https://github.com/open-telemetry/opentelemetry-python-contrib/pull/1608))
14+
15+
### Fixed
16+
17+
- Fix Flask instrumentation to only close the span if it was created by the same thread.
18+
([#1654](https://github.com/open-telemetry/opentelemetry-python-contrib/pull/1654))
19+
20+
## Version 1.16.0/0.37b0 (2023-02-17)
21+
22+
### Added
23+
24+
- Support `aio_pika` 9.x (([#1670](https://github.com/open-telemetry/opentelemetry-python-contrib/pull/1670])
1225
- `opentelemetry-instrumentation-redis` Add `sanitize_query` config option to allow query sanitization. ([#1572](https://github.com/open-telemetry/opentelemetry-python-contrib/pull/1572))
13-
- `opentelemetry-instrumentation-elasticsearch` Add optional db.statement query sanitization.
26+
- `opentelemetry-instrumentation-elasticsearch` Add optional db.statement query sanitization.
1427
([#1598](https://github.com/open-telemetry/opentelemetry-python-contrib/pull/1598))
1528
- `opentelemetry-instrumentation-celery` Record exceptions as events on the span.
1629
([#1573](https://github.com/open-telemetry/opentelemetry-python-contrib/pull/1573))
@@ -46,6 +59,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
4659
([#1435](https://github.com/open-telemetry/opentelemetry-python-contrib/pull/1435))
4760
- mongo db - fix db statement capturing
4861
([#1512](https://github.com/open-telemetry/opentelemetry-python-contrib/pull/1512))
62+
- Add commit method for ConfluentKafkaInstrumentor's ProxiedConsumer
63+
([#1656](https://github.com/open-telemetry/opentelemetry-python-contrib/pull/1656))
4964

5065
## Version 1.15.0/0.36b0 (2022-12-10)
5166

Diff for: _template/version.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -12,4 +12,4 @@
1212
# See the License for the specific language governing permissions and
1313
# limitations under the License.
1414

15-
__version__ = "0.37b0.dev"
15+
__version__ = "0.38b0.dev"

Diff for: docs-requirements.txt

+2
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,9 @@ aiopg>=0.13.0,<1.3.0
2424
asyncpg>=0.12.0
2525
boto~=2.0
2626
botocore~=1.0
27+
boto3~=1.0
2728
celery>=4.0
29+
confluent-kafka>= 1.8.2,< 2.0.0
2830
elasticsearch>=2.0,<9.0
2931
flask~=2.0
3032
falcon~=2.0

Diff for: docs/conf.py

+8-19
Original file line numberDiff line numberDiff line change
@@ -126,25 +126,14 @@ def getlistcfg(strval):
126126
]
127127

128128

129-
if "class_references" in mcfg:
130-
class_references = getlistcfg(mcfg["class_references"])
131-
for class_reference in class_references:
132-
nitpick_ignore.append(
133-
(
134-
"py:class",
135-
class_reference,
136-
)
137-
)
138-
139-
if "anys" in mcfg:
140-
anys = getlistcfg(mcfg["anys"])
141-
for _any in anys:
142-
nitpick_ignore.append(
143-
(
144-
"any",
145-
_any,
146-
)
147-
)
129+
ignore_categories = ["py-class", "py-func", "py-exc", "py-obj", "any"]
130+
131+
for category in ignore_categories:
132+
if category in mcfg:
133+
items = getlistcfg(mcfg[category])
134+
for item in items:
135+
nitpick_ignore.append((category.replace("-", ":"), item))
136+
148137

149138
# Add any paths that contain templates here, relative to this directory.
150139
templates_path = ["_templates"]

Diff for: docs/instrumentation/boto3sqs/boto3sqs.rst

+6
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
.. include:: ../../../instrumentation/opentelemetry-instrumentation-boto3sqs/README.rst
2+
3+
.. automodule:: opentelemetry.instrumentation.boto3sqs
4+
:members:
5+
:undoc-members:
6+
:show-inheritance:
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
.. include:: ../../../instrumentation/opentelemetry-instrumentation-confluent-kafka/README.rst
2+
3+
.. automodule:: opentelemetry.instrumentation.confluent_kafka
4+
:members:
5+
:undoc-members:
6+
:show-inheritance:
7+
:noindex:

Diff for: docs/nitpick-exceptions.ini

+31-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
[default]
2-
class_references=
2+
py-class=
33
; TODO: Understand why sphinx is not able to find this local class
44
opentelemetry.propagators.textmap.CarrierT
55
opentelemetry.propagators.textmap.Setter
@@ -11,6 +11,9 @@ class_references=
1111
opentelemetry.propagators.textmap.Getter
1212
; - AWSXRayPropagator
1313
opentelemetry.sdk.trace.id_generator.IdGenerator
14+
opentelemetry.instrumentation.confluent_kafka.ProxiedProducer
15+
opentelemetry.instrumentation.confluent_kafka.ProxiedConsumer
16+
opentelemetry.instrumentation.instrumentor.BaseInstrumentor
1417
; - AwsXRayIdGenerator
1518
TextMapPropagator
1619
CarrierT
@@ -26,8 +29,16 @@ class_references=
2629
httpx.AsyncByteStream
2730
httpx.Response
2831
yarl.URL
32+
cimpl.Producer
33+
cimpl.Consumer
34+
func
35+
Message
36+
TopicPartition
37+
callable
38+
Consumer
39+
confluent_kafka.Message
2940

30-
anys=
41+
any=
3142
; API
3243
opentelemetry.propagators.textmap.TextMapPropagator.fields
3344
; - AWSXRayPropagator
@@ -44,3 +55,21 @@ anys=
4455
; - instrumentation.*
4556
Setter
4657
httpx
58+
instrument
59+
__iter__
60+
list.__iter__
61+
__getitem__
62+
list.__getitem__
63+
SQS.ReceiveMessage
64+
65+
py-obj=
66+
opentelemetry.propagators.textmap.CarrierT
67+
68+
py-func=
69+
poll
70+
flush
71+
Message.error
72+
73+
py-exc=
74+
KafkaException
75+
KafkaError

Diff for: eachdist.ini

+2-2
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ sortfirst=
1616
ext/*
1717

1818
[stable]
19-
version=1.16.0.dev
19+
version=1.17.0.dev
2020

2121
packages=
2222
opentelemetry-sdk
@@ -34,7 +34,7 @@ packages=
3434
opentelemetry-api
3535

3636
[prerelease]
37-
version=0.37b0.dev
37+
version=0.38b0.dev
3838

3939
packages=
4040
all

Diff for: exporter/opentelemetry-exporter-prometheus-remote-write/src/opentelemetry/exporter/prometheus_remote_write/version.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -12,4 +12,4 @@
1212
# See the License for the specific language governing permissions and
1313
# limitations under the License.
1414

15-
__version__ = "0.37b0.dev"
15+
__version__ = "0.38b0.dev"

Diff for: exporter/opentelemetry-exporter-richconsole/pyproject.toml

+1-1
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ classifiers = [
2727
dependencies = [
2828
"opentelemetry-api ~= 1.12",
2929
"opentelemetry-sdk ~= 1.12",
30-
"opentelemetry-semantic-conventions == 0.37b0.dev",
30+
"opentelemetry-semantic-conventions == 0.38b0.dev",
3131
"rich>=10.0.0",
3232
]
3333

Diff for: exporter/opentelemetry-exporter-richconsole/src/opentelemetry/exporter/richconsole/version.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -12,4 +12,4 @@
1212
# See the License for the specific language governing permissions and
1313
# limitations under the License.
1414

15-
__version__ = "0.37b0.dev"
15+
__version__ = "0.38b0.dev"

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

+2-2
Original file line numberDiff line numberDiff line change
@@ -31,11 +31,11 @@ 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]",
38-
"opentelemetry-test-utils == 0.37b0.dev",
38+
"opentelemetry-test-utils == 0.38b0.dev",
3939
"pytest",
4040
"wrapt >= 1.0.0, < 2.0.0",
4141
]

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/src/opentelemetry/instrumentation/aio_pika/version.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -12,4 +12,4 @@
1212
# See the License for the specific language governing permissions and
1313
# limitations under the License.
1414

15-
__version__ = "0.37b0.dev"
15+
__version__ = "0.38b0.dev"

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,

Diff for: instrumentation/opentelemetry-instrumentation-aiohttp-client/pyproject.toml

+3-3
Original file line numberDiff line numberDiff line change
@@ -26,9 +26,9 @@ classifiers = [
2626
]
2727
dependencies = [
2828
"opentelemetry-api ~= 1.12",
29-
"opentelemetry-instrumentation == 0.37b0.dev",
30-
"opentelemetry-semantic-conventions == 0.37b0.dev",
31-
"opentelemetry-util-http == 0.37b0.dev",
29+
"opentelemetry-instrumentation == 0.38b0.dev",
30+
"opentelemetry-semantic-conventions == 0.38b0.dev",
31+
"opentelemetry-util-http == 0.38b0.dev",
3232
"wrapt >= 1.0.0, < 2.0.0",
3333
]
3434

Diff for: instrumentation/opentelemetry-instrumentation-aiohttp-client/src/opentelemetry/instrumentation/aiohttp_client/version.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -12,4 +12,4 @@
1212
# See the License for the specific language governing permissions and
1313
# limitations under the License.
1414

15-
__version__ = "0.37b0.dev"
15+
__version__ = "0.38b0.dev"

Diff for: instrumentation/opentelemetry-instrumentation-aiohttp-client/tests/test_aiohttp_client_integration.py

+13
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@
2626
from pkg_resources import iter_entry_points
2727

2828
from opentelemetry import context
29+
from opentelemetry import trace as trace_api
2930
from opentelemetry.instrumentation import aiohttp_client
3031
from opentelemetry.instrumentation.aiohttp_client import (
3132
AioHttpClientInstrumentor,
@@ -434,6 +435,18 @@ async def create_session(server: aiohttp.test_utils.TestServer):
434435
run_with_test_server(create_session, self.URL, self.default_handler)
435436
self.assert_spans(1)
436437

438+
def test_no_op_tracer_provider(self):
439+
AioHttpClientInstrumentor().uninstrument()
440+
AioHttpClientInstrumentor().instrument(
441+
tracer_provider=trace_api.NoOpTracerProvider()
442+
)
443+
444+
run_with_test_server(
445+
self.get_default_request(), self.URL, self.default_handler
446+
)
447+
spans_list = self.memory_exporter.get_finished_spans()
448+
self.assertEqual(len(spans_list), 0)
449+
437450
def test_uninstrument(self):
438451
AioHttpClientInstrumentor().uninstrument()
439452
run_with_test_server(

0 commit comments

Comments
 (0)