Skip to content

Commit 02d7f29

Browse files
authored
Merge branch 'open-telemetry:main' into metrics-instrumentation-flask
2 parents 139a1cc + ee40839 commit 02d7f29

File tree

125 files changed

+1553
-273
lines changed

Some content is hidden

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

125 files changed

+1553
-273
lines changed

.github/component_owners.yml

+3
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,8 @@
11
components:
22

3+
instrumentation/opentelemetry-instrumentation-aio-pika:
4+
- ofek1weiss
5+
36
instrumentation/opentelemetry-instrumentation-boto3sqs:
47
- oxeye-nikolay
58
- nikosokolik

.github/workflows/test.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ on:
66
- 'release/*'
77
pull_request:
88
env:
9-
CORE_REPO_SHA: d4d7c67663cc22615748d632e1c8c5799e8eacae
9+
CORE_REPO_SHA: 05d251c5d6baefe2f084e7361cb144c4fa10da96
1010

1111
jobs:
1212
build:

CHANGELOG.md

+13-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,11 @@ All notable changes to this project will be documented in this file.
55
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
66
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
77

8-
## [Unreleased](https://github.com/open-telemetry/opentelemetry-python/compare/v1.12.0rc1-0.31b0...HEAD)
8+
## [Unreleased](https://github.com/open-telemetry/opentelemetry-python/compare/v1.12.0rc2-0.32b0...HEAD)
9+
10+
## [1.12.0rc2-0.32b0](https://github.com/open-telemetry/opentelemetry-python/releases/tag/v1.12.0rc2-0.32b0) - 2022-07-01
11+
12+
913
- Pyramid: Only categorize 500s server exceptions as errors
1014
([#1037](https://github.com/open-telemetry/opentelemetry-python-contrib/issues/1037))
1115

@@ -24,6 +28,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
2428

2529

2630
### Added
31+
- `opentelemetry-instrumentation-aiohttp-client` Add support for optional custom trace_configs argument.
32+
([1079](https://github.com/open-telemetry/opentelemetry-python-contrib/pull/1079))
2733
- `opentelemetry-instrumentation-sqlalchemy` add support to instrument multiple engines
2834
([#1132](https://github.com/open-telemetry/opentelemetry-python-contrib/pull/1132))
2935
- `opentelemetry-instrumentation-logging` add log hook support
@@ -36,6 +42,12 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
3642
([#1127](https://github.com/open-telemetry/opentelemetry-python-contrib/pull/1127))
3743
- Add metric instrumentation for WSGI
3844
([#1128](https://github.com/open-telemetry/opentelemetry-python-contrib/pull/1128))
45+
- `opentelemetry-instrumentation-aio-pika` added RabbitMQ aio-pika module instrumentation.
46+
([#1095](https://github.com/open-telemetry/opentelemetry-python-contrib/pull/1095))
47+
- `opentelemetry-instrumentation-requests` Restoring metrics in requests
48+
([#1110](https://github.com/open-telemetry/opentelemetry-python-contrib/pull/1110))
49+
- Integrated sqlcommenter plugin into opentelemetry-instrumentation-django
50+
([#896](https://github.com/open-telemetry/opentelemetry-python-contrib/pull/896))
3951

4052

4153
## [1.12.0rc1-0.31b0](https://github.com/open-telemetry/opentelemetry-python/releases/tag/v1.12.0rc1-0.31b0) - 2022-05-17

_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.31b0"
15+
__version__ = "0.32b0"

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.12.0rc1
19+
version=1.12.0rc2
2020

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

3636
[prerelease]
37-
version=0.31b0
37+
version=0.32b0
3838

3939
packages=
4040
all

exporter/opentelemetry-exporter-richconsole/setup.cfg

+1-1
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ install_requires =
4343
rich>=10.0.0
4444
opentelemetry-api ~= 1.3
4545
opentelemetry-sdk ~= 1.3
46-
opentelemetry-semantic-conventions == 0.31b0
46+
opentelemetry-semantic-conventions == 0.32b0
4747

4848
[options.packages.find]
4949
where = src

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.31b0"
15+
__version__ = "0.32b0"

instrumentation/README.md

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

22
| Instrumentation | Supported Packages | Metrics support |
33
| --------------- | ------------------ | --------------- |
4+
| [opentelemetry-instrumentation-aio-pika](./opentelemetry-instrumentation-aio-pika) | aio_pika ~= 7.2.0 | No
45
| [opentelemetry-instrumentation-aiohttp-client](./opentelemetry-instrumentation-aiohttp-client) | aiohttp ~= 3.0 | No
56
| [opentelemetry-instrumentation-aiopg](./opentelemetry-instrumentation-aiopg) | aiopg >= 0.13.0, < 1.3.0 | No
67
| [opentelemetry-instrumentation-asgi](./opentelemetry-instrumentation-asgi) | asgiref ~= 3.0 | No
@@ -31,7 +32,7 @@
3132
| [opentelemetry-instrumentation-pyramid](./opentelemetry-instrumentation-pyramid) | pyramid >= 1.7 | No
3233
| [opentelemetry-instrumentation-redis](./opentelemetry-instrumentation-redis) | redis >= 2.6 | No
3334
| [opentelemetry-instrumentation-remoulade](./opentelemetry-instrumentation-remoulade) | remoulade >= 0.50 | No
34-
| [opentelemetry-instrumentation-requests](./opentelemetry-instrumentation-requests) | requests ~= 2.0 | No
35+
| [opentelemetry-instrumentation-requests](./opentelemetry-instrumentation-requests) | requests ~= 2.0 | Yes
3536
| [opentelemetry-instrumentation-sklearn](./opentelemetry-instrumentation-sklearn) | scikit-learn ~= 0.24.0 | No
3637
| [opentelemetry-instrumentation-sqlalchemy](./opentelemetry-instrumentation-sqlalchemy) | sqlalchemy | No
3738
| [opentelemetry-instrumentation-sqlite3](./opentelemetry-instrumentation-sqlite3) | sqlite3 | No
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
OpenTelemetry Aio-pika Instrumentation
2+
======================================
3+
4+
|pypi|
5+
6+
.. |pypi| image:: https://badge.fury.io/py/opentelemetry-instrumentation-aio-pika.svg
7+
:target: https://pypi.org/project/opentelemetry-instrumentation-aio-pika/
8+
9+
This library allows tracing requests made by the Aio-pika library.
10+
11+
Installation
12+
------------
13+
14+
::
15+
16+
pip install opentelemetry-instrumentation-aio-pika
17+
18+
References
19+
----------
20+
21+
* `OpenTelemetry Aio-pika instrumentation <https://opentelemetry-python-contrib.readthedocs.io/en/latest/instrumentation/aio-pika/aio-pika.html>`_
22+
* `OpenTelemetry Project <https://opentelemetry.io/>`_
23+
* `OpenTelemetry Python Examples <https://github.com/open-telemetry/opentelemetry-python/tree/main/docs/examples>`_
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,58 @@
1+
# Copyright The OpenTelemetry Authors
2+
#
3+
# Licensed under the Apache License, Version 2.0 (the "License");
4+
# you may not use this file except in compliance with the License.
5+
# You may obtain a copy of the License at
6+
#
7+
# http://www.apache.org/licenses/LICENSE-2.0
8+
#
9+
# Unless required by applicable law or agreed to in writing, software
10+
# distributed under the License is distributed on an "AS IS" BASIS,
11+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12+
# See the License for the specific language governing permissions and
13+
# limitations under the License.
14+
#
15+
[metadata]
16+
name = opentelemetry-instrumentation-aio-pika
17+
description = OpenTelemetry Aio-pika instrumentation
18+
long_description = file: README.rst
19+
long_description_content_type = text/x-rst
20+
author = OpenTelemetry Authors
21+
author_email = [email protected]
22+
url = https://github.com/open-telemetry/opentelemetry-python-contrib/instrumentation/opentelemetry-instrumentation-aio-pika
23+
platforms = any
24+
license = Apache-2.0
25+
classifiers =
26+
Development Status :: 4 - Beta
27+
Intended Audience :: Developers
28+
License :: OSI Approved :: Apache Software License
29+
Programming Language :: Python
30+
Programming Language :: Python :: 3
31+
Programming Language :: Python :: 3.6
32+
Programming Language :: Python :: 3.7
33+
Programming Language :: Python :: 3.8
34+
Programming Language :: Python :: 3.9
35+
Programming Language :: Python :: 3.10
36+
37+
[options]
38+
python_requires = >=3.6
39+
package_dir=
40+
=src
41+
packages=find_namespace:
42+
43+
install_requires =
44+
opentelemetry-api ~= 1.5
45+
wrapt >= 1.0.0, < 2.0.0
46+
47+
[options.extras_require]
48+
test =
49+
pytest
50+
wrapt >= 1.0.0, < 2.0.0
51+
opentelemetry-test-utils == 0.32b0
52+
53+
[options.packages.find]
54+
where = src
55+
56+
[options.entry_points]
57+
opentelemetry_instrumentor =
58+
aio-pika = opentelemetry.instrumentation.aio_pika:AioPikaInstrumentor
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,99 @@
1+
# Copyright The OpenTelemetry Authors
2+
#
3+
# Licensed under the Apache License, Version 2.0 (the "License");
4+
# you may not use this file except in compliance with the License.
5+
# You may obtain a copy of the License at
6+
#
7+
# http://www.apache.org/licenses/LICENSE-2.0
8+
#
9+
# Unless required by applicable law or agreed to in writing, software
10+
# distributed under the License is distributed on an "AS IS" BASIS,
11+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12+
# See the License for the specific language governing permissions and
13+
# limitations under the License.
14+
15+
16+
# DO NOT EDIT. THIS FILE WAS AUTOGENERATED FROM templates/instrumentation_setup.py.txt.
17+
# RUN `python scripts/generate_setup.py` TO REGENERATE.
18+
19+
20+
import distutils.cmd
21+
import json
22+
import os
23+
from configparser import ConfigParser
24+
25+
import setuptools
26+
27+
config = ConfigParser()
28+
config.read("setup.cfg")
29+
30+
# We provide extras_require parameter to setuptools.setup later which
31+
# overwrites the extras_require section from setup.cfg. To support extras_require
32+
# section in setup.cfg, we load it here and merge it with the extras_require param.
33+
extras_require = {}
34+
if "options.extras_require" in config:
35+
for key, value in config["options.extras_require"].items():
36+
extras_require[key] = [v for v in value.split("\n") if v.strip()]
37+
38+
BASE_DIR = os.path.dirname(__file__)
39+
PACKAGE_INFO = {}
40+
41+
VERSION_FILENAME = os.path.join(
42+
BASE_DIR,
43+
"src",
44+
"opentelemetry",
45+
"instrumentation",
46+
"aio_pika",
47+
"version.py",
48+
)
49+
with open(VERSION_FILENAME, encoding="utf-8") as f:
50+
exec(f.read(), PACKAGE_INFO)
51+
52+
PACKAGE_FILENAME = os.path.join(
53+
BASE_DIR,
54+
"src",
55+
"opentelemetry",
56+
"instrumentation",
57+
"aio_pika",
58+
"package.py",
59+
)
60+
with open(PACKAGE_FILENAME, encoding="utf-8") as f:
61+
exec(f.read(), PACKAGE_INFO)
62+
63+
# Mark any instruments/runtime dependencies as test dependencies as well.
64+
extras_require["instruments"] = PACKAGE_INFO["_instruments"]
65+
test_deps = extras_require.get("test", [])
66+
for dep in extras_require["instruments"]:
67+
test_deps.append(dep)
68+
69+
extras_require["test"] = test_deps
70+
71+
72+
class JSONMetadataCommand(distutils.cmd.Command):
73+
74+
description = (
75+
"print out package metadata as JSON. This is used by OpenTelemetry dev scripts to ",
76+
"auto-generate code in other places",
77+
)
78+
user_options = []
79+
80+
def initialize_options(self):
81+
pass
82+
83+
def finalize_options(self):
84+
pass
85+
86+
def run(self):
87+
metadata = {
88+
"name": config["metadata"]["name"],
89+
"version": PACKAGE_INFO["__version__"],
90+
"instruments": PACKAGE_INFO["_instruments"],
91+
}
92+
print(json.dumps(metadata))
93+
94+
95+
setuptools.setup(
96+
cmdclass={"meta": JSONMetadataCommand},
97+
version=PACKAGE_INFO["__version__"],
98+
extras_require=extras_require,
99+
)
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,60 @@
1+
# Copyright The OpenTelemetry Authors
2+
#
3+
# Licensed under the Apache License, Version 2.0 (the "License");
4+
# you may not use this file except in compliance with the License.
5+
# You may obtain a copy of the License at
6+
#
7+
# http://www.apache.org/licenses/LICENSE-2.0
8+
#
9+
# Unless required by applicable law or agreed to in writing, software
10+
# distributed under the License is distributed on an "AS IS" BASIS,
11+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12+
# See the License for the specific language governing permissions and
13+
# limitations under the License.
14+
"""
15+
Instrument `aio_pika` to trace RabbitMQ applications.
16+
17+
Usage
18+
-----
19+
20+
* Start broker backend
21+
22+
.. code-block:: python
23+
24+
docker run -p 5672:5672 rabbitmq
25+
26+
* Run instrumented task
27+
28+
.. code-block:: python
29+
30+
import asyncio
31+
32+
from aio_pika import Message, connect
33+
from opentelemetry.instrumentation.aio_pika import AioPikaInstrumentor
34+
35+
AioPikaInstrumentor().instrument()
36+
37+
38+
async def main() -> None:
39+
connection = await connect("amqp://guest:guest@localhost/")
40+
async with connection:
41+
channel = await connection.channel()
42+
queue = await channel.declare_queue("hello")
43+
await channel.default_exchange.publish(
44+
Message(b"Hello World!"),
45+
routing_key=queue.name,
46+
)
47+
48+
49+
if __name__ == "__main__":
50+
asyncio.run(main())
51+
52+
API
53+
---
54+
"""
55+
# pylint: disable=import-error
56+
57+
from .aio_pika_instrumentor import AioPikaInstrumentor
58+
from .version import __version__
59+
60+
__all__ = ["AioPikaInstrumentor", "__version__"]

0 commit comments

Comments
 (0)