Skip to content

Commit

Permalink
Merge branch 'main' into issue_2328
Browse files Browse the repository at this point in the history
  • Loading branch information
ocelotl authored Mar 22, 2024
2 parents 943c48f + 86a552e commit a50e0a7
Show file tree
Hide file tree
Showing 154 changed files with 2,422 additions and 476 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/instrumentations_1.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,13 +25,13 @@ jobs:
python-version: [py38, py39, py310, py311, pypy3]
package:
- "urllib"
- "urllib3v"
- "urllib3"
- "wsgi"
- "distro"
- "richconsole"
- "psycopg"
- "prometheus-remote-write"
- "sdkextension-aws"
- "sdk-extension-aws"
- "propagator-aws-xray"
- "propagator-ot-trace"
- "resource-detector-container"
Expand Down
14 changes: 12 additions & 2 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,14 +7,24 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

## Unreleased

- `opentelemetry-instrumentation-psycopg` Async Instrumentation for psycopg 3.x
([#2146](https://github.com/open-telemetry/opentelemetry-python-contrib/pull/2146))

### Fixed
- `opentelemetry-instrumentation-celery` Allow Celery instrumentation to be installed multiple times
([#2342](https://github.com/open-telemetry/opentelemetry-python-contrib/pull/2342))
- Align gRPC span status codes to OTEL specification ([#1756](https://github.com/open-telemetry/opentelemetry-python-contrib/issues/1756))
- Align gRPC span status codes to OTEL specification
([#1756](https://github.com/open-telemetry/opentelemetry-python-contrib/issues/1756))
- `opentelemetry-instrumentation-flask` Add importlib metadata default for deprecation warning flask version
([#2297](https://github.com/open-telemetry/opentelemetry-python-contrib/issues/2297))
- Ensure all http.server.duration metrics have the same description
([#2151](https://github.com/open-telemetry/opentelemetry-python-contrib/issues/2298))
- Avoid losing repeated HTTP headers
([#2266](https://github.com/open-telemetry/opentelemetry-python-contrib/pull/2266))

## Version 1.23.0/0.44b0 (2024-02-23)

- Drop support for 3.7
- Drop uspport for 3.7
([#2151](https://github.com/open-telemetry/opentelemetry-python-contrib/pull/2151))
- `opentelemetry-resource-detector-azure` Added 10s timeout to VM Resource Detector
([#2119](https://github.com/open-telemetry/opentelemetry-python-contrib/pull/2119))
Expand Down
2 changes: 1 addition & 1 deletion docs/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ installed separately via pip:
pip install opentelemetry-exporter-{exporter}
pip install opentelemetry-instrumentation-{instrumentation}
pip install opentelemetry-sdk-extension-{sdkextension}
pip install opentelemetry-sdk-extension-{sdk-extension}
A complete list of packages can be found at the
`Contrib repo instrumentation <https://github.com/open-telemetry/opentelemetry-python-contrib/tree/main/instrumentation>`_
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,9 +31,6 @@ dependencies = [
"python-snappy ~= 0.6",
]

[project.optional-dependencies]
test = []

[project.urls]
Homepage = "https://github.com/open-telemetry/opentelemetry-python-contrib/tree/main/exporter/opentelemetry-exporter-prometheus-remote-write"

Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
asgiref==3.7.2
attrs==23.2.0
certifi==2024.2.2
charset-normalizer==3.3.2
cramjam==2.8.1
Deprecated==1.2.14
idna==3.6
importlib-metadata==6.11.0
iniconfig==2.0.0
packaging==23.2
pluggy==1.4.0
protobuf==4.25.3
py==1.11.0
py-cpuinfo==9.0.0
pytest==7.1.3
pytest-benchmark==4.0.0
python-snappy==0.7.1
requests==2.31.0
tomli==2.0.1
typing_extensions==4.10.0
urllib3==2.2.1
wrapt==1.16.0
zipp==3.17.0
-e exporter/opentelemetry-exporter-prometheus-remote-write
3 changes: 0 additions & 3 deletions exporter/opentelemetry-exporter-richconsole/pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -30,9 +30,6 @@ dependencies = [
"rich>=10.0.0",
]

[project.optional-dependencies]
test = []

[project.urls]
Homepage = "https://github.com/open-telemetry/opentelemetry-python-contrib/tree/main/exporter/opentelemetry-exporter-richconsole"

Expand Down
21 changes: 21 additions & 0 deletions exporter/opentelemetry-exporter-richconsole/test-requirements.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
asgiref==3.7.2
attrs==23.2.0
Deprecated==1.2.14
flaky==3.7.0
importlib-metadata==6.11.0
iniconfig==2.0.0
markdown-it-py==3.0.0
mdurl==0.1.2
packaging==23.2
pluggy==1.4.0
py==1.11.0
py-cpuinfo==9.0.0
Pygments==2.17.2
pytest==7.1.3
pytest-benchmark==4.0.0
rich==13.7.1
tomli==2.0.1
typing_extensions==4.10.0
wrapt==1.16.0
zipp==3.17.0
-e exporter/opentelemetry-exporter-richconsole
Original file line number Diff line number Diff line change
Expand Up @@ -33,12 +33,6 @@ dependencies = [
instruments = [
"aio_pika >= 7.2.0, < 10.0.0",
]
test = [
"opentelemetry-instrumentation-aio-pika[instruments]",
"opentelemetry-test-utils == 0.45b0.dev",
"pytest",
"wrapt >= 1.0.0, < 2.0.0",
]

[project.entry-points.opentelemetry_instrumentor]
aio-pika = "opentelemetry.instrumentation.aio_pika:AioPikaInstrumentor"
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
aio-pika==7.2.0
aiormq==6.2.3
asgiref==3.7.2
attrs==23.2.0
Deprecated==1.2.14
idna==3.6
importlib-metadata==6.11.0
iniconfig==2.0.0
multidict==6.0.5
packaging==23.2
pamqp==3.1.0
pluggy==1.4.0
py==1.11.0
py-cpuinfo==9.0.0
pytest==7.1.3
pytest-benchmark==4.0.0
tomli==2.0.1
typing_extensions==4.9.0
wrapt==1.16.0
yarl==1.9.4
zipp==3.17.0
-e opentelemetry-instrumentation
-e instrumentation/opentelemetry-instrumentation-aio-pika
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
aio-pika==8.3.0
aiormq==6.6.4
asgiref==3.7.2
attrs==23.2.0
Deprecated==1.2.14
idna==3.6
importlib-metadata==6.11.0
iniconfig==2.0.0
multidict==6.0.5
packaging==23.2
pamqp==3.2.1
pluggy==1.4.0
py==1.11.0
py-cpuinfo==9.0.0
pytest==7.1.3
pytest-benchmark==4.0.0
tomli==2.0.1
typing_extensions==4.9.0
wrapt==1.16.0
yarl==1.9.4
zipp==3.17.0
-e opentelemetry-instrumentation
-e instrumentation/opentelemetry-instrumentation-aio-pika
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
aio-pika==9.4.0
aiormq==6.8.0
asgiref==3.7.2
attrs==23.2.0
Deprecated==1.2.14
idna==3.6
importlib-metadata==6.11.0
iniconfig==2.0.0
multidict==6.0.5
packaging==23.2
pamqp==3.3.0
pluggy==1.4.0
py==1.11.0
py-cpuinfo==9.0.0
pytest==7.1.3
pytest-benchmark==4.0.0
tomli==2.0.1
typing_extensions==4.9.0
wrapt==1.16.0
yarl==1.9.4
zipp==3.17.0
-e opentelemetry-instrumentation
-e instrumentation/opentelemetry-instrumentation-aio-pika
Original file line number Diff line number Diff line change
Expand Up @@ -75,9 +75,7 @@ def _test_publish(self, exchange_type: Type[Exchange]):
with mock.patch.object(
PublishDecorator, "_get_publish_span"
) as mock_get_publish_span:
with mock.patch.object(
Exchange, "publish", return_value=asyncio.sleep(0)
) as mock_publish:
with mock.patch.object(Exchange, "publish") as mock_publish:
decorated_publish = PublishDecorator(
self.tracer, exchange
).decorate(mock_publish)
Expand All @@ -101,9 +99,7 @@ def _test_publish_works_with_not_recording_span(self, exchange_type):
mocked_not_recording_span = MagicMock()
mocked_not_recording_span.is_recording.return_value = False
mock_get_publish_span.return_value = mocked_not_recording_span
with mock.patch.object(
Exchange, "publish", return_value=asyncio.sleep(0)
) as mock_publish:
with mock.patch.object(Exchange, "publish") as mock_publish:
with mock.patch(
"opentelemetry.instrumentation.aio_pika.publish_decorator.propagate.inject"
) as mock_inject:
Expand Down Expand Up @@ -158,9 +154,7 @@ def _test_publish(self, exchange_type: Type[Exchange]):
with mock.patch.object(
PublishDecorator, "_get_publish_span"
) as mock_get_publish_span:
with mock.patch.object(
Exchange, "publish", return_value=asyncio.sleep(0)
) as mock_publish:
with mock.patch.object(Exchange, "publish") as mock_publish:
decorated_publish = PublishDecorator(
self.tracer, exchange
).decorate(mock_publish)
Expand All @@ -184,9 +178,7 @@ def _test_publish_works_with_not_recording_span(self, exchange_type):
mocked_not_recording_span = MagicMock()
mocked_not_recording_span.is_recording.return_value = False
mock_get_publish_span.return_value = mocked_not_recording_span
with mock.patch.object(
Exchange, "publish", return_value=asyncio.sleep(0)
) as mock_publish:
with mock.patch.object(Exchange, "publish") as mock_publish:
with mock.patch(
"opentelemetry.instrumentation.aio_pika.publish_decorator.propagate.inject"
) as mock_inject:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,10 +35,6 @@ dependencies = [
instruments = [
"aiohttp ~= 3.0",
]
test = [
"opentelemetry-instrumentation-aiohttp-client[instruments]",
"http-server-mock"
]

[project.entry-points.opentelemetry_instrumentor]
aiohttp-client = "opentelemetry.instrumentation.aiohttp_client:AioHttpClientInstrumentor"
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
aiohttp==3.9.3
aiosignal==1.3.1
asgiref==3.7.2
async-timeout==4.0.3
attrs==23.2.0
blinker==1.7.0
certifi==2024.2.2
charset-normalizer==3.3.2
click==8.1.7
Deprecated==1.2.14
Flask==3.0.2
frozenlist==1.4.1
http_server_mock==1.7
idna==3.6
importlib-metadata==6.11.0
iniconfig==2.0.0
itsdangerous==2.1.2
Jinja2==3.1.3
MarkupSafe==2.1.5
multidict==6.0.5
packaging==23.2
pluggy==1.4.0
py==1.11.0
py-cpuinfo==9.0.0
pytest==7.1.3
pytest-benchmark==4.0.0
requests==2.31.0
tomli==2.0.1
typing_extensions==4.10.0
urllib3==2.2.1
Werkzeug==3.0.1
wrapt==1.16.0
yarl==1.9.4
zipp==3.17.0
-e opentelemetry-instrumentation
-e util/opentelemetry-util-http
-e instrumentation/opentelemetry-instrumentation-aiohttp-client
Original file line number Diff line number Diff line change
Expand Up @@ -35,11 +35,6 @@ dependencies = [
instruments = [
"aiohttp ~= 3.0",
]
test = [
"opentelemetry-instrumentation-aiohttp-server[instruments]",
"pytest-asyncio",
"pytest-aiohttp",
]

[project.entry-points.opentelemetry_instrumentor]
aiohttp-server = "opentelemetry.instrumentation.aiohttp_server:AioHttpServerInstrumentor"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -207,7 +207,7 @@ async def middleware(request, handler):
duration_histogram = meter.create_histogram(
name=MetricInstruments.HTTP_SERVER_DURATION,
unit="ms",
description="measures the duration of the inbound HTTP request",
description="Duration of HTTP client requests.",
)

active_requests_counter = meter.create_up_down_counter(
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
aiohttp==3.9.3
aiosignal==1.3.1
asgiref==3.7.2
async-timeout==4.0.3
attrs==23.2.0
Deprecated==1.2.14
frozenlist==1.4.1
idna==3.6
importlib-metadata==6.11.0
iniconfig==2.0.0
multidict==6.0.5
packaging==23.2
pluggy==1.4.0
py==1.11.0
py-cpuinfo==9.0.0
pytest==7.1.3
pytest-aiohttp==1.0.5
pytest-asyncio==0.23.5
pytest-benchmark==4.0.0
tomli==2.0.1
typing_extensions==4.10.0
wrapt==1.16.0
yarl==1.9.4
zipp==3.17.0
-e opentelemetry-instrumentation
-e util/opentelemetry-util-http
-e instrumentation/opentelemetry-instrumentation-aiohttp-server
Original file line number Diff line number Diff line change
Expand Up @@ -34,11 +34,6 @@ dependencies = [
instruments = [
"aiopg >= 0.13.0, < 2.0.0",
]
test = [
"opentelemetry-instrumentation-aiopg[instruments]",
"opentelemetry-semantic-conventions == 0.45b0.dev",
"opentelemetry-test-utils == 0.45b0.dev",
]

[project.entry-points.opentelemetry_instrumentor]
aiopg = "opentelemetry.instrumentation.aiopg:AiopgInstrumentor"
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
aiopg==1.4.0
asgiref==3.7.2
async-timeout==4.0.3
attrs==23.2.0
Deprecated==1.2.14
importlib-metadata==6.11.0
iniconfig==2.0.0
install==1.3.5
packaging==23.2
pluggy==1.4.0
psycopg2-binary==2.9.9
py==1.11.0
py-cpuinfo==9.0.0
pytest==7.1.3
pytest-benchmark==4.0.0
tomli==2.0.1
typing_extensions==4.10.0
wrapt==1.16.0
zipp==3.17.0
-e opentelemetry-instrumentation
-e instrumentation/opentelemetry-instrumentation-dbapi
-e instrumentation/opentelemetry-instrumentation-aiopg
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ def test_instrumentor_connect(self):
cnx = async_call(aiopg.connect(database="test"))
cursor = async_call(cnx.cursor())
query = "SELECT * FROM test"
cursor.execute(query)
async_call(cursor.execute(query))

spans_list = self.memory_exporter.get_finished_spans()
self.assertEqual(len(spans_list), 1)
Expand Down Expand Up @@ -127,7 +127,7 @@ def test_instrumentor_create_pool(self):
cnx = async_call(pool.acquire())
cursor = async_call(cnx.cursor())
query = "SELECT * FROM test"
cursor.execute(query)
async_call(cursor.execute(query))

spans_list = self.memory_exporter.get_finished_spans()
self.assertEqual(len(spans_list), 1)
Expand Down
Loading

0 comments on commit a50e0a7

Please sign in to comment.