From bc4d2c5b75e3e523c4be2da2fa01f2c02e4f9453 Mon Sep 17 00:00:00 2001
From: Leighton Chen
Date: Fri, 23 Aug 2024 16:56:36 -0700
Subject: [PATCH 01/33] Fix `http.host` and `net.peer.ip` new http semconv
mapping (#2814)
---
CHANGELOG.md | 2 +
.../instrumentation/asgi/__init__.py | 10 ++--
.../tests/test_asgi_middleware.py | 19 ++-----
.../instrumentation/httpx/__init__.py | 4 +-
.../instrumentation/requests/__init__.py | 6 +-
.../instrumentation/urllib3/__init__.py | 6 +-
.../instrumentation/wsgi/__init__.py | 4 +-
.../opentelemetry/instrumentation/_semconv.py | 56 ++++++++++++-------
8 files changed, 59 insertions(+), 48 deletions(-)
diff --git a/CHANGELOG.md b/CHANGELOG.md
index 5abca8227a..c5ce56423a 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -40,6 +40,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
([#2792](https://github.com/open-telemetry/opentelemetry-python-contrib/pull/2792))
- `opentelemetry-instrumentation-tornado` Handle http client exception and record exception info into span
([#2563](https://github.com/open-telemetry/opentelemetry-python-contrib/pull/2563))
+- `opentelemetry-instrumentation` fix `http.host` new http semantic convention mapping to depend on `kind` of span
+ ([#2814](https://github.com/open-telemetry/opentelemetry-python-contrib/pull/2814))
## Version 1.26.0/0.47b0 (2024-07-23)
diff --git a/instrumentation/opentelemetry-instrumentation-asgi/src/opentelemetry/instrumentation/asgi/__init__.py b/instrumentation/opentelemetry-instrumentation-asgi/src/opentelemetry/instrumentation/asgi/__init__.py
index 8e3199cef8..295eb2a043 100644
--- a/instrumentation/opentelemetry-instrumentation-asgi/src/opentelemetry/instrumentation/asgi/__init__.py
+++ b/instrumentation/opentelemetry-instrumentation-asgi/src/opentelemetry/instrumentation/asgi/__init__.py
@@ -215,10 +215,10 @@ def client_response_hook(span: Span, scope: dict[str, Any], message: dict[str, A
_server_duration_attrs_new,
_server_duration_attrs_old,
_set_http_flavor_version,
- _set_http_host,
+ _set_http_host_server,
_set_http_method,
_set_http_net_host_port,
- _set_http_peer_ip,
+ _set_http_peer_ip_server,
_set_http_peer_port_server,
_set_http_scheme,
_set_http_target,
@@ -342,7 +342,7 @@ def collect_request_attributes(
if scheme:
_set_http_scheme(result, scheme, sem_conv_opt_in_mode)
if server_host:
- _set_http_host(result, server_host, sem_conv_opt_in_mode)
+ _set_http_host_server(result, server_host, sem_conv_opt_in_mode)
if port:
_set_http_net_host_port(result, port, sem_conv_opt_in_mode)
flavor = scope.get("http_version")
@@ -380,7 +380,9 @@ def collect_request_attributes(
_set_http_user_agent(result, http_user_agent[0], sem_conv_opt_in_mode)
if "client" in scope and scope["client"] is not None:
- _set_http_peer_ip(result, scope.get("client")[0], sem_conv_opt_in_mode)
+ _set_http_peer_ip_server(
+ result, scope.get("client")[0], sem_conv_opt_in_mode
+ )
_set_http_peer_port_server(
result, scope.get("client")[1], sem_conv_opt_in_mode
)
diff --git a/instrumentation/opentelemetry-instrumentation-asgi/tests/test_asgi_middleware.py b/instrumentation/opentelemetry-instrumentation-asgi/tests/test_asgi_middleware.py
index af51faa808..d89f4a54e0 100644
--- a/instrumentation/opentelemetry-instrumentation-asgi/tests/test_asgi_middleware.py
+++ b/instrumentation/opentelemetry-instrumentation-asgi/tests/test_asgi_middleware.py
@@ -53,10 +53,7 @@
from opentelemetry.semconv.attributes.network_attributes import (
NETWORK_PROTOCOL_VERSION,
)
-from opentelemetry.semconv.attributes.server_attributes import (
- SERVER_ADDRESS,
- SERVER_PORT,
-)
+from opentelemetry.semconv.attributes.server_attributes import SERVER_PORT
from opentelemetry.semconv.attributes.url_attributes import (
URL_PATH,
URL_QUERY,
@@ -406,7 +403,6 @@ def validate_outputs(
HTTP_REQUEST_METHOD: "GET",
URL_SCHEME: "http",
SERVER_PORT: 80,
- SERVER_ADDRESS: "127.0.0.1",
NETWORK_PROTOCOL_VERSION: "1.0",
URL_PATH: "/",
CLIENT_ADDRESS: "127.0.0.1",
@@ -442,7 +438,6 @@ def validate_outputs(
HTTP_REQUEST_METHOD: "GET",
URL_SCHEME: "http",
SERVER_PORT: 80,
- SERVER_ADDRESS: "127.0.0.1",
NETWORK_PROTOCOL_VERSION: "1.0",
URL_PATH: "/",
CLIENT_ADDRESS: "127.0.0.1",
@@ -688,7 +683,7 @@ def test_behavior_with_scope_server_as_none_new_semconv(self):
def update_expected_server(expected):
expected[3]["attributes"].update(
{
- SERVER_ADDRESS: "0.0.0.0",
+ CLIENT_ADDRESS: "0.0.0.0",
SERVER_PORT: 80,
}
)
@@ -715,7 +710,7 @@ def update_expected_server(expected):
SpanAttributes.HTTP_HOST: "0.0.0.0",
SpanAttributes.NET_HOST_PORT: 80,
SpanAttributes.HTTP_URL: "http://0.0.0.0/",
- SERVER_ADDRESS: "0.0.0.0",
+ CLIENT_ADDRESS: "0.0.0.0",
SERVER_PORT: 80,
}
)
@@ -1001,7 +996,6 @@ def test_websocket_new_semconv(self):
"attributes": {
URL_SCHEME: self.scope["scheme"],
SERVER_PORT: self.scope["server"][1],
- SERVER_ADDRESS: self.scope["server"][0],
NETWORK_PROTOCOL_VERSION: self.scope["http_version"],
URL_PATH: self.scope["path"],
CLIENT_ADDRESS: self.scope["client"][0],
@@ -1086,7 +1080,6 @@ def test_websocket_both_semconv(self):
SpanAttributes.HTTP_METHOD: self.scope["method"],
URL_SCHEME: self.scope["scheme"],
SERVER_PORT: self.scope["server"][1],
- SERVER_ADDRESS: self.scope["server"][0],
NETWORK_PROTOCOL_VERSION: self.scope["http_version"],
URL_PATH: self.scope["path"],
CLIENT_ADDRESS: self.scope["client"][0],
@@ -1629,7 +1622,6 @@ def test_request_attributes_new_semconv(self):
attrs,
{
HTTP_REQUEST_METHOD: "GET",
- SERVER_ADDRESS: "127.0.0.1",
URL_PATH: "/",
URL_QUERY: "foo=bar",
SERVER_PORT: 80,
@@ -1665,7 +1657,6 @@ def test_request_attributes_both_semconv(self):
SpanAttributes.NET_PEER_IP: "127.0.0.1",
SpanAttributes.NET_PEER_PORT: 32767,
HTTP_REQUEST_METHOD: "GET",
- SERVER_ADDRESS: "127.0.0.1",
URL_PATH: "/",
URL_QUERY: "foo=bar",
SERVER_PORT: 80,
@@ -1690,7 +1681,7 @@ def test_query_string_new_semconv(self):
_HTTPStabilityMode.HTTP,
)
self.assertEqual(attrs[URL_SCHEME], "http")
- self.assertEqual(attrs[SERVER_ADDRESS], "127.0.0.1")
+ self.assertEqual(attrs[CLIENT_ADDRESS], "127.0.0.1")
self.assertEqual(attrs[URL_PATH], "/")
self.assertEqual(attrs[URL_QUERY], "foo=bar")
@@ -1704,7 +1695,7 @@ def test_query_string_both_semconv(self):
attrs[SpanAttributes.HTTP_URL], "http://127.0.0.1/?foo=bar"
)
self.assertEqual(attrs[URL_SCHEME], "http")
- self.assertEqual(attrs[SERVER_ADDRESS], "127.0.0.1")
+ self.assertEqual(attrs[CLIENT_ADDRESS], "127.0.0.1")
self.assertEqual(attrs[URL_PATH], "/")
self.assertEqual(attrs[URL_QUERY], "foo=bar")
diff --git a/instrumentation/opentelemetry-instrumentation-httpx/src/opentelemetry/instrumentation/httpx/__init__.py b/instrumentation/opentelemetry-instrumentation-httpx/src/opentelemetry/instrumentation/httpx/__init__.py
index f2a18a2770..43db6c3a82 100644
--- a/instrumentation/opentelemetry-instrumentation-httpx/src/opentelemetry/instrumentation/httpx/__init__.py
+++ b/instrumentation/opentelemetry-instrumentation-httpx/src/opentelemetry/instrumentation/httpx/__init__.py
@@ -202,7 +202,7 @@ async def async_response_hook(span, request, response):
_OpenTelemetrySemanticConventionStability,
_OpenTelemetryStabilitySignalType,
_report_new,
- _set_http_host,
+ _set_http_host_client,
_set_http_method,
_set_http_network_protocol_version,
_set_http_peer_port_client,
@@ -342,7 +342,7 @@ def _apply_request_client_attributes_to_span(
if _report_new(semconv):
if url.host:
# http semconv transition: http.host -> server.address
- _set_http_host(span_attributes, url.host, semconv)
+ _set_http_host_client(span_attributes, url.host, semconv)
# http semconv transition: net.sock.peer.addr -> network.peer.address
span_attributes[NETWORK_PEER_ADDRESS] = url.host
if url.port:
diff --git a/instrumentation/opentelemetry-instrumentation-requests/src/opentelemetry/instrumentation/requests/__init__.py b/instrumentation/opentelemetry-instrumentation-requests/src/opentelemetry/instrumentation/requests/__init__.py
index 3aa1b476f5..db67d378d9 100644
--- a/instrumentation/opentelemetry-instrumentation-requests/src/opentelemetry/instrumentation/requests/__init__.py
+++ b/instrumentation/opentelemetry-instrumentation-requests/src/opentelemetry/instrumentation/requests/__init__.py
@@ -92,7 +92,7 @@ def response_hook(span, request_obj, response)
_OpenTelemetryStabilitySignalType,
_report_new,
_report_old,
- _set_http_host,
+ _set_http_host_client,
_set_http_method,
_set_http_net_peer_name_client,
_set_http_network_protocol_version,
@@ -212,14 +212,14 @@ def get_or_create_headers():
metric_labels, parsed_url.scheme, sem_conv_opt_in_mode
)
if parsed_url.hostname:
- _set_http_host(
+ _set_http_host_client(
metric_labels, parsed_url.hostname, sem_conv_opt_in_mode
)
_set_http_net_peer_name_client(
metric_labels, parsed_url.hostname, sem_conv_opt_in_mode
)
if _report_new(sem_conv_opt_in_mode):
- _set_http_host(
+ _set_http_host_client(
span_attributes,
parsed_url.hostname,
sem_conv_opt_in_mode,
diff --git a/instrumentation/opentelemetry-instrumentation-urllib3/src/opentelemetry/instrumentation/urllib3/__init__.py b/instrumentation/opentelemetry-instrumentation-urllib3/src/opentelemetry/instrumentation/urllib3/__init__.py
index 4bcd0816fd..1c83f3f447 100644
--- a/instrumentation/opentelemetry-instrumentation-urllib3/src/opentelemetry/instrumentation/urllib3/__init__.py
+++ b/instrumentation/opentelemetry-instrumentation-urllib3/src/opentelemetry/instrumentation/urllib3/__init__.py
@@ -103,7 +103,7 @@ def response_hook(
_OpenTelemetryStabilitySignalType,
_report_new,
_report_old,
- _set_http_host,
+ _set_http_host_client,
_set_http_method,
_set_http_net_peer_name_client,
_set_http_network_protocol_version,
@@ -491,7 +491,9 @@ def _set_metric_attributes(
sem_conv_opt_in_mode: _HTTPStabilityMode = _HTTPStabilityMode.DEFAULT,
) -> None:
- _set_http_host(metric_attributes, instance.host, sem_conv_opt_in_mode)
+ _set_http_host_client(
+ metric_attributes, instance.host, sem_conv_opt_in_mode
+ )
_set_http_scheme(metric_attributes, instance.scheme, sem_conv_opt_in_mode)
_set_http_method(
metric_attributes,
diff --git a/instrumentation/opentelemetry-instrumentation-wsgi/src/opentelemetry/instrumentation/wsgi/__init__.py b/instrumentation/opentelemetry-instrumentation-wsgi/src/opentelemetry/instrumentation/wsgi/__init__.py
index 355b1d7458..88704f35ab 100644
--- a/instrumentation/opentelemetry-instrumentation-wsgi/src/opentelemetry/instrumentation/wsgi/__init__.py
+++ b/instrumentation/opentelemetry-instrumentation-wsgi/src/opentelemetry/instrumentation/wsgi/__init__.py
@@ -231,7 +231,7 @@ def response_hook(span: Span, environ: WSGIEnvironment, status: str, response_he
_set_http_net_host,
_set_http_net_host_port,
_set_http_net_peer_name_server,
- _set_http_peer_ip,
+ _set_http_peer_ip_server,
_set_http_peer_port_server,
_set_http_scheme,
_set_http_target,
@@ -360,7 +360,7 @@ def collect_request_attributes(
remote_addr = environ.get("REMOTE_ADDR")
if remote_addr:
- _set_http_peer_ip(result, remote_addr, sem_conv_opt_in_mode)
+ _set_http_peer_ip_server(result, remote_addr, sem_conv_opt_in_mode)
peer_port = environ.get("REMOTE_PORT")
if peer_port:
diff --git a/opentelemetry-instrumentation/src/opentelemetry/instrumentation/_semconv.py b/opentelemetry-instrumentation/src/opentelemetry/instrumentation/_semconv.py
index 33668333ce..c4e720fd04 100644
--- a/opentelemetry-instrumentation/src/opentelemetry/instrumentation/_semconv.py
+++ b/opentelemetry-instrumentation/src/opentelemetry/instrumentation/_semconv.py
@@ -252,16 +252,32 @@ def _set_http_scheme(result, scheme, sem_conv_opt_in_mode):
set_string_attribute(result, URL_SCHEME, scheme)
-def _set_http_host(result, host, sem_conv_opt_in_mode):
+def _set_http_flavor_version(result, version, sem_conv_opt_in_mode):
if _report_old(sem_conv_opt_in_mode):
- set_string_attribute(result, SpanAttributes.HTTP_HOST, host)
+ set_string_attribute(result, SpanAttributes.HTTP_FLAVOR, version)
if _report_new(sem_conv_opt_in_mode):
- set_string_attribute(result, SERVER_ADDRESS, host)
+ set_string_attribute(result, NETWORK_PROTOCOL_VERSION, version)
+
+
+def _set_http_user_agent(result, user_agent, sem_conv_opt_in_mode):
+ if _report_old(sem_conv_opt_in_mode):
+ set_string_attribute(
+ result, SpanAttributes.HTTP_USER_AGENT, user_agent
+ )
+ if _report_new(sem_conv_opt_in_mode):
+ set_string_attribute(result, USER_AGENT_ORIGINAL, user_agent)
# Client
+def _set_http_host_client(result, host, sem_conv_opt_in_mode):
+ if _report_old(sem_conv_opt_in_mode):
+ set_string_attribute(result, SpanAttributes.HTTP_HOST, host)
+ if _report_new(sem_conv_opt_in_mode):
+ set_string_attribute(result, SERVER_ADDRESS, host)
+
+
def _set_http_net_peer_name_client(result, peer_name, sem_conv_opt_in_mode):
if _report_old(sem_conv_opt_in_mode):
set_string_attribute(result, SpanAttributes.NET_PEER_NAME, peer_name)
@@ -310,27 +326,32 @@ def _set_http_target(result, target, path, query, sem_conv_opt_in_mode):
set_string_attribute(result, URL_QUERY, query)
-def _set_http_peer_ip(result, ip, sem_conv_opt_in_mode):
+def _set_http_host_server(result, host, sem_conv_opt_in_mode):
if _report_old(sem_conv_opt_in_mode):
- set_string_attribute(result, SpanAttributes.NET_PEER_IP, ip)
+ set_string_attribute(result, SpanAttributes.HTTP_HOST, host)
if _report_new(sem_conv_opt_in_mode):
- set_string_attribute(result, CLIENT_ADDRESS, ip)
+ set_string_attribute(result, CLIENT_ADDRESS, host)
-def _set_http_peer_port_server(result, port, sem_conv_opt_in_mode):
+# net.peer.ip -> net.sock.peer.addr
+# https://github.com/open-telemetry/semantic-conventions/blob/40db676ca0e735aa84f242b5a0fb14e49438b69b/schemas/1.15.0#L18
+# net.sock.peer.addr -> client.socket.address for server spans (TODO) AND client.address if missing
+# https://github.com/open-telemetry/semantic-conventions/blob/v1.21.0/CHANGELOG.md#v1210-2023-07-13
+# https://github.com/open-telemetry/semantic-conventions/blob/main/docs/non-normative/http-migration.md#common-attributes-across-http-client-and-server-spans
+def _set_http_peer_ip_server(result, ip, sem_conv_opt_in_mode):
if _report_old(sem_conv_opt_in_mode):
- set_int_attribute(result, SpanAttributes.NET_PEER_PORT, port)
+ set_string_attribute(result, SpanAttributes.NET_PEER_IP, ip)
if _report_new(sem_conv_opt_in_mode):
- set_int_attribute(result, CLIENT_PORT, port)
+ # Only populate if not already populated
+ if not result.get(CLIENT_ADDRESS):
+ set_string_attribute(result, CLIENT_ADDRESS, ip)
-def _set_http_user_agent(result, user_agent, sem_conv_opt_in_mode):
+def _set_http_peer_port_server(result, port, sem_conv_opt_in_mode):
if _report_old(sem_conv_opt_in_mode):
- set_string_attribute(
- result, SpanAttributes.HTTP_USER_AGENT, user_agent
- )
+ set_int_attribute(result, SpanAttributes.NET_PEER_PORT, port)
if _report_new(sem_conv_opt_in_mode):
- set_string_attribute(result, USER_AGENT_ORIGINAL, user_agent)
+ set_int_attribute(result, CLIENT_PORT, port)
def _set_http_net_peer_name_server(result, name, sem_conv_opt_in_mode):
@@ -340,13 +361,6 @@ def _set_http_net_peer_name_server(result, name, sem_conv_opt_in_mode):
set_string_attribute(result, CLIENT_ADDRESS, name)
-def _set_http_flavor_version(result, version, sem_conv_opt_in_mode):
- if _report_old(sem_conv_opt_in_mode):
- set_string_attribute(result, SpanAttributes.HTTP_FLAVOR, version)
- if _report_new(sem_conv_opt_in_mode):
- set_string_attribute(result, NETWORK_PROTOCOL_VERSION, version)
-
-
def _set_status(
span,
metrics_attributes: dict,
From 19f8e775ce76841d097b11ec42c886e5ed46ea06 Mon Sep 17 00:00:00 2001
From: Riccardo Magliocchetti
Date: Mon, 26 Aug 2024 18:38:07 +0200
Subject: [PATCH 02/33] Prepare asgi tests to support newer asgiref version
(#2778)
---
.../tests/test_asgi_custom_headers.py | 98 ++++---
.../tests/test_asgi_middleware.py | 260 +++++++++---------
2 files changed, 195 insertions(+), 163 deletions(-)
diff --git a/instrumentation/opentelemetry-instrumentation-asgi/tests/test_asgi_custom_headers.py b/instrumentation/opentelemetry-instrumentation-asgi/tests/test_asgi_custom_headers.py
index 5394d62ff0..f6cb05fbda 100644
--- a/instrumentation/opentelemetry-instrumentation-asgi/tests/test_asgi_custom_headers.py
+++ b/instrumentation/opentelemetry-instrumentation-asgi/tests/test_asgi_custom_headers.py
@@ -1,7 +1,21 @@
+# Copyright The OpenTelemetry Authors
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+
import os
import opentelemetry.instrumentation.asgi as otel_asgi
-from opentelemetry.test.asgitestutil import AsgiTestBase
+from opentelemetry.test.asgitestutil import AsyncAsgiTestBase
from opentelemetry.test.test_base import TestBase
from opentelemetry.trace import SpanKind
from opentelemetry.util.http import (
@@ -90,7 +104,7 @@ async def websocket_app_with_custom_headers(scope, receive, send):
break
-class TestCustomHeaders(AsgiTestBase, TestBase):
+class TestCustomHeaders(AsyncAsgiTestBase):
constructor_params = {}
__test__ = False
@@ -108,7 +122,7 @@ def setUp(self):
**self.constructor_params,
)
- def test_http_custom_request_headers_in_span_attributes(self):
+ async def test_http_custom_request_headers_in_span_attributes(self):
self.scope["headers"].extend(
[
(b"custom-test-header-1", b"test-header-value-1"),
@@ -119,8 +133,8 @@ def test_http_custom_request_headers_in_span_attributes(self):
]
)
self.seed_app(self.app)
- self.send_default_request()
- self.get_all_output()
+ await self.send_default_request()
+ await self.get_all_output()
span_list = self.exporter.get_finished_spans()
expected = {
"http.request.header.custom_test_header_1": (
@@ -139,7 +153,7 @@ def test_http_custom_request_headers_in_span_attributes(self):
if span.kind == SpanKind.SERVER:
self.assertSpanHasAttributes(span, expected)
- def test_http_repeat_request_headers_in_span_attributes(self):
+ async def test_http_repeat_request_headers_in_span_attributes(self):
self.scope["headers"].extend(
[
(b"custom-test-header-1", b"test-header-value-1"),
@@ -147,8 +161,8 @@ def test_http_repeat_request_headers_in_span_attributes(self):
]
)
self.seed_app(self.app)
- self.send_default_request()
- self.get_all_output()
+ await self.send_default_request()
+ await self.get_all_output()
span_list = self.exporter.get_finished_spans()
expected = {
"http.request.header.custom_test_header_1": (
@@ -159,15 +173,15 @@ def test_http_repeat_request_headers_in_span_attributes(self):
span = next(span for span in span_list if span.kind == SpanKind.SERVER)
self.assertSpanHasAttributes(span, expected)
- def test_http_custom_request_headers_not_in_span_attributes(self):
+ async def test_http_custom_request_headers_not_in_span_attributes(self):
self.scope["headers"].extend(
[
(b"custom-test-header-1", b"test-header-value-1"),
]
)
self.seed_app(self.app)
- self.send_default_request()
- self.get_all_output()
+ await self.send_default_request()
+ await self.get_all_output()
span_list = self.exporter.get_finished_spans()
expected = {
"http.request.header.custom_test_header_1": (
@@ -185,15 +199,15 @@ def test_http_custom_request_headers_not_in_span_attributes(self):
for key, _ in not_expected.items():
self.assertNotIn(key, span.attributes)
- def test_http_custom_response_headers_in_span_attributes(self):
+ async def test_http_custom_response_headers_in_span_attributes(self):
self.app = otel_asgi.OpenTelemetryMiddleware(
http_app_with_custom_headers,
tracer_provider=self.tracer_provider,
**self.constructor_params,
)
self.seed_app(self.app)
- self.send_default_request()
- self.get_all_output()
+ await self.send_default_request()
+ await self.get_all_output()
span_list = self.exporter.get_finished_spans()
expected = {
"http.response.header.custom_test_header_1": (
@@ -214,15 +228,15 @@ def test_http_custom_response_headers_in_span_attributes(self):
if span.kind == SpanKind.SERVER:
self.assertSpanHasAttributes(span, expected)
- def test_http_repeat_response_headers_in_span_attributes(self):
+ async def test_http_repeat_response_headers_in_span_attributes(self):
self.app = otel_asgi.OpenTelemetryMiddleware(
http_app_with_repeat_headers,
tracer_provider=self.tracer_provider,
**self.constructor_params,
)
self.seed_app(self.app)
- self.send_default_request()
- self.get_all_output()
+ await self.send_default_request()
+ await self.get_all_output()
span_list = self.exporter.get_finished_spans()
expected = {
"http.response.header.custom_test_header_1": (
@@ -233,15 +247,15 @@ def test_http_repeat_response_headers_in_span_attributes(self):
span = next(span for span in span_list if span.kind == SpanKind.SERVER)
self.assertSpanHasAttributes(span, expected)
- def test_http_custom_response_headers_not_in_span_attributes(self):
+ async def test_http_custom_response_headers_not_in_span_attributes(self):
self.app = otel_asgi.OpenTelemetryMiddleware(
http_app_with_custom_headers,
tracer_provider=self.tracer_provider,
**self.constructor_params,
)
self.seed_app(self.app)
- self.send_default_request()
- self.get_all_output()
+ await self.send_default_request()
+ await self.get_all_output()
span_list = self.exporter.get_finished_spans()
not_expected = {
"http.response.header.custom_test_header_3": (
@@ -253,7 +267,7 @@ def test_http_custom_response_headers_not_in_span_attributes(self):
for key, _ in not_expected.items():
self.assertNotIn(key, span.attributes)
- def test_websocket_custom_request_headers_in_span_attributes(self):
+ async def test_websocket_custom_request_headers_in_span_attributes(self):
self.scope = {
"type": "websocket",
"http_version": "1.1",
@@ -271,11 +285,11 @@ def test_websocket_custom_request_headers_in_span_attributes(self):
"server": ("127.0.0.1", 80),
}
self.seed_app(self.app)
- self.send_input({"type": "websocket.connect"})
- self.send_input({"type": "websocket.receive", "text": "ping"})
- self.send_input({"type": "websocket.disconnect"})
+ await self.send_input({"type": "websocket.connect"})
+ await self.send_input({"type": "websocket.receive", "text": "ping"})
+ await self.send_input({"type": "websocket.disconnect"})
- self.get_all_output()
+ await self.get_all_output()
span_list = self.exporter.get_finished_spans()
expected = {
"http.request.header.custom_test_header_1": (
@@ -294,7 +308,9 @@ def test_websocket_custom_request_headers_in_span_attributes(self):
if span.kind == SpanKind.SERVER:
self.assertSpanHasAttributes(span, expected)
- def test_websocket_custom_request_headers_not_in_span_attributes(self):
+ async def test_websocket_custom_request_headers_not_in_span_attributes(
+ self,
+ ):
self.scope = {
"type": "websocket",
"http_version": "1.1",
@@ -309,11 +325,11 @@ def test_websocket_custom_request_headers_not_in_span_attributes(self):
"server": ("127.0.0.1", 80),
}
self.seed_app(self.app)
- self.send_input({"type": "websocket.connect"})
- self.send_input({"type": "websocket.receive", "text": "ping"})
- self.send_input({"type": "websocket.disconnect"})
+ await self.send_input({"type": "websocket.connect"})
+ await self.send_input({"type": "websocket.receive", "text": "ping"})
+ await self.send_input({"type": "websocket.disconnect"})
- self.get_all_output()
+ await self.get_all_output()
span_list = self.exporter.get_finished_spans()
not_expected = {
"http.request.header.custom_test_header_3": (
@@ -325,7 +341,7 @@ def test_websocket_custom_request_headers_not_in_span_attributes(self):
for key, _ in not_expected.items():
self.assertNotIn(key, span.attributes)
- def test_websocket_custom_response_headers_in_span_attributes(self):
+ async def test_websocket_custom_response_headers_in_span_attributes(self):
self.scope = {
"type": "websocket",
"http_version": "1.1",
@@ -342,10 +358,10 @@ def test_websocket_custom_response_headers_in_span_attributes(self):
**self.constructor_params,
)
self.seed_app(self.app)
- self.send_input({"type": "websocket.connect"})
- self.send_input({"type": "websocket.receive", "text": "ping"})
- self.send_input({"type": "websocket.disconnect"})
- self.get_all_output()
+ await self.send_input({"type": "websocket.connect"})
+ await self.send_input({"type": "websocket.receive", "text": "ping"})
+ await self.send_input({"type": "websocket.disconnect"})
+ await self.get_all_output()
span_list = self.exporter.get_finished_spans()
expected = {
"http.response.header.custom_test_header_1": (
@@ -366,7 +382,9 @@ def test_websocket_custom_response_headers_in_span_attributes(self):
if span.kind == SpanKind.SERVER:
self.assertSpanHasAttributes(span, expected)
- def test_websocket_custom_response_headers_not_in_span_attributes(self):
+ async def test_websocket_custom_response_headers_not_in_span_attributes(
+ self,
+ ):
self.scope = {
"type": "websocket",
"http_version": "1.1",
@@ -383,10 +401,10 @@ def test_websocket_custom_response_headers_not_in_span_attributes(self):
**self.constructor_params,
)
self.seed_app(self.app)
- self.send_input({"type": "websocket.connect"})
- self.send_input({"type": "websocket.receive", "text": "ping"})
- self.send_input({"type": "websocket.disconnect"})
- self.get_all_output()
+ await self.send_input({"type": "websocket.connect"})
+ await self.send_input({"type": "websocket.receive", "text": "ping"})
+ await self.send_input({"type": "websocket.disconnect"})
+ await self.get_all_output()
span_list = self.exporter.get_finished_spans()
not_expected = {
"http.response.header.custom_test_header_3": (
diff --git a/instrumentation/opentelemetry-instrumentation-asgi/tests/test_asgi_middleware.py b/instrumentation/opentelemetry-instrumentation-asgi/tests/test_asgi_middleware.py
index d89f4a54e0..a21dd626c8 100644
--- a/instrumentation/opentelemetry-instrumentation-asgi/tests/test_asgi_middleware.py
+++ b/instrumentation/opentelemetry-instrumentation-asgi/tests/test_asgi_middleware.py
@@ -14,7 +14,6 @@
# pylint: disable=too-many-lines
-import asyncio
import sys
import time
import unittest
@@ -64,7 +63,7 @@
)
from opentelemetry.semconv.trace import SpanAttributes
from opentelemetry.test.asgitestutil import (
- AsgiTestBase,
+ AsyncAsgiTestBase,
setup_testing_defaults,
)
from opentelemetry.test.test_base import TestBase
@@ -275,7 +274,7 @@ async def error_asgi(scope, receive, send):
# pylint: disable=too-many-public-methods
-class TestAsgiApplication(AsgiTestBase):
+class TestAsgiApplication(AsyncAsgiTestBase):
def setUp(self):
super().setUp()
@@ -477,31 +476,31 @@ def validate_outputs(
"opentelemetry.instrumentation.asgi",
)
- def test_basic_asgi_call(self):
+ async def test_basic_asgi_call(self):
"""Test that spans are emitted as expected."""
app = otel_asgi.OpenTelemetryMiddleware(simple_asgi)
self.seed_app(app)
- self.send_default_request()
- outputs = self.get_all_output()
+ await self.send_default_request()
+ outputs = await self.get_all_output()
self.validate_outputs(outputs)
- def test_basic_asgi_call_new_semconv(self):
+ async def test_basic_asgi_call_new_semconv(self):
"""Test that spans are emitted as expected."""
app = otel_asgi.OpenTelemetryMiddleware(simple_asgi)
self.seed_app(app)
- self.send_default_request()
- outputs = self.get_all_output()
+ await self.send_default_request()
+ outputs = await self.get_all_output()
self.validate_outputs(outputs, old_sem_conv=False, new_sem_conv=True)
- def test_basic_asgi_call_both_semconv(self):
+ async def test_basic_asgi_call_both_semconv(self):
"""Test that spans are emitted as expected."""
app = otel_asgi.OpenTelemetryMiddleware(simple_asgi)
self.seed_app(app)
- self.send_default_request()
- outputs = self.get_all_output()
+ await self.send_default_request()
+ outputs = await self.get_all_output()
self.validate_outputs(outputs, old_sem_conv=True, new_sem_conv=True)
- def test_asgi_not_recording(self):
+ async def test_asgi_not_recording(self):
mock_tracer = mock.Mock()
mock_span = mock.Mock()
mock_span.is_recording.return_value = False
@@ -514,21 +513,21 @@ def test_asgi_not_recording(self):
tracer.return_value = mock_tracer
app = otel_asgi.OpenTelemetryMiddleware(simple_asgi)
self.seed_app(app)
- self.send_default_request()
+ await self.send_default_request()
self.assertFalse(mock_span.is_recording())
self.assertTrue(mock_span.is_recording.called)
self.assertFalse(mock_span.set_attribute.called)
self.assertFalse(mock_span.set_status.called)
- def test_asgi_exc_info(self):
+ async def test_asgi_exc_info(self):
"""Test that exception information is emitted as expected."""
app = otel_asgi.OpenTelemetryMiddleware(error_asgi)
self.seed_app(app)
- self.send_default_request()
- outputs = self.get_all_output()
+ await self.send_default_request()
+ outputs = await self.get_all_output()
self.validate_outputs(outputs, error=ValueError)
- def test_long_response(self):
+ async def test_long_response(self):
"""Test that the server span is ended on the final response body message.
If the server span is ended early then this test will fail due
@@ -536,8 +535,8 @@ def test_long_response(self):
"""
app = otel_asgi.OpenTelemetryMiddleware(long_response_asgi)
self.seed_app(app)
- self.send_default_request()
- outputs = self.get_all_output()
+ await self.send_default_request()
+ outputs = await self.get_all_output()
def add_more_body_spans(expected: list):
more_body_span = {
@@ -551,12 +550,12 @@ def add_more_body_spans(expected: list):
self.validate_outputs(outputs, modifiers=[add_more_body_spans])
- def test_background_execution(self):
+ async def test_background_execution(self):
"""Test that the server span is ended BEFORE the background task is finished."""
app = otel_asgi.OpenTelemetryMiddleware(background_execution_asgi)
self.seed_app(app)
- self.send_default_request()
- outputs = self.get_all_output()
+ await self.send_default_request()
+ outputs = await self.get_all_output()
self.validate_outputs(outputs)
span_list = self.memory_exporter.get_finished_spans()
server_span = span_list[-1]
@@ -567,15 +566,15 @@ def test_background_execution(self):
_SIMULATED_BACKGROUND_TASK_EXECUTION_TIME_S * 10**9,
)
- def test_trailers(self):
+ async def test_trailers(self):
"""Test that trailers are emitted as expected and that the server span is ended
BEFORE the background task is finished."""
app = otel_asgi.OpenTelemetryMiddleware(
background_execution_trailers_asgi
)
self.seed_app(app)
- self.send_default_request()
- outputs = self.get_all_output()
+ await self.send_default_request()
+ outputs = await self.get_all_output()
def add_body_and_trailer_span(expected: list):
body_span = {
@@ -602,7 +601,7 @@ def add_body_and_trailer_span(expected: list):
_SIMULATED_BACKGROUND_TASK_EXECUTION_TIME_S * 10**9,
)
- def test_override_span_name(self):
+ async def test_override_span_name(self):
"""Test that default span_names can be overwritten by our callback function."""
span_name = "Dymaxion"
@@ -623,11 +622,11 @@ def update_expected_span_name(expected):
simple_asgi, default_span_details=get_predefined_span_details
)
self.seed_app(app)
- self.send_default_request()
- outputs = self.get_all_output()
+ await self.send_default_request()
+ outputs = await self.get_all_output()
self.validate_outputs(outputs, modifiers=[update_expected_span_name])
- def test_custom_tracer_provider_otel_asgi(self):
+ async def test_custom_tracer_provider_otel_asgi(self):
resource = resources.Resource.create({"service-test-key": "value"})
result = TestBase.create_tracer_provider(resource=resource)
tracer_provider, exporter = result
@@ -636,28 +635,28 @@ def test_custom_tracer_provider_otel_asgi(self):
simple_asgi, tracer_provider=tracer_provider
)
self.seed_app(app)
- self.send_default_request()
+ await self.send_default_request()
span_list = exporter.get_finished_spans()
for span in span_list:
self.assertEqual(
span.resource.attributes["service-test-key"], "value"
)
- def test_no_op_tracer_provider_otel_asgi(self):
+ async def test_no_op_tracer_provider_otel_asgi(self):
app = otel_asgi.OpenTelemetryMiddleware(
simple_asgi, tracer_provider=trace_api.NoOpTracerProvider()
)
self.seed_app(app)
- self.send_default_request()
+ await self.send_default_request()
- response_start, response_body, *_ = self.get_all_output()
+ response_start, response_body, *_ = await self.get_all_output()
self.assertEqual(response_body["body"], b"*")
self.assertEqual(response_start["status"], 200)
span_list = self.memory_exporter.get_finished_spans()
self.assertEqual(len(span_list), 0)
- def test_behavior_with_scope_server_as_none(self):
+ async def test_behavior_with_scope_server_as_none(self):
"""Test that middleware is ok when server is none in scope."""
def update_expected_server(expected):
@@ -673,11 +672,11 @@ def update_expected_server(expected):
self.scope["server"] = None
app = otel_asgi.OpenTelemetryMiddleware(simple_asgi)
self.seed_app(app)
- self.send_default_request()
- outputs = self.get_all_output()
+ await self.send_default_request()
+ outputs = await self.get_all_output()
self.validate_outputs(outputs, modifiers=[update_expected_server])
- def test_behavior_with_scope_server_as_none_new_semconv(self):
+ async def test_behavior_with_scope_server_as_none_new_semconv(self):
"""Test that middleware is ok when server is none in scope."""
def update_expected_server(expected):
@@ -692,8 +691,8 @@ def update_expected_server(expected):
self.scope["server"] = None
app = otel_asgi.OpenTelemetryMiddleware(simple_asgi)
self.seed_app(app)
- self.send_default_request()
- outputs = self.get_all_output()
+ await self.send_default_request()
+ outputs = await self.get_all_output()
self.validate_outputs(
outputs,
modifiers=[update_expected_server],
@@ -701,7 +700,7 @@ def update_expected_server(expected):
new_sem_conv=True,
)
- def test_behavior_with_scope_server_as_none_both_semconv(self):
+ async def test_behavior_with_scope_server_as_none_both_semconv(self):
"""Test that middleware is ok when server is none in scope."""
def update_expected_server(expected):
@@ -719,8 +718,8 @@ def update_expected_server(expected):
self.scope["server"] = None
app = otel_asgi.OpenTelemetryMiddleware(simple_asgi)
self.seed_app(app)
- self.send_default_request()
- outputs = self.get_all_output()
+ await self.send_default_request()
+ outputs = await self.get_all_output()
self.validate_outputs(
outputs,
modifiers=[update_expected_server],
@@ -728,7 +727,7 @@ def update_expected_server(expected):
new_sem_conv=True,
)
- def test_host_header(self):
+ async def test_host_header(self):
"""Test that host header is converted to http.server_name."""
hostname = b"server_name_1"
@@ -741,11 +740,11 @@ def update_expected_server(expected):
self.scope["headers"].append([b"host", hostname])
app = otel_asgi.OpenTelemetryMiddleware(simple_asgi)
self.seed_app(app)
- self.send_default_request()
- outputs = self.get_all_output()
+ await self.send_default_request()
+ outputs = await self.get_all_output()
self.validate_outputs(outputs, modifiers=[update_expected_server])
- def test_host_header_both_semconv(self):
+ async def test_host_header_both_semconv(self):
"""Test that host header is converted to http.server_name."""
hostname = b"server_name_1"
@@ -758,8 +757,8 @@ def update_expected_server(expected):
self.scope["headers"].append([b"host", hostname])
app = otel_asgi.OpenTelemetryMiddleware(simple_asgi)
self.seed_app(app)
- self.send_default_request()
- outputs = self.get_all_output()
+ await self.send_default_request()
+ outputs = await self.get_all_output()
self.validate_outputs(
outputs,
modifiers=[update_expected_server],
@@ -767,7 +766,7 @@ def update_expected_server(expected):
new_sem_conv=True,
)
- def test_user_agent(self):
+ async def test_user_agent(self):
"""Test that host header is converted to http.server_name."""
user_agent = b"test-agent"
@@ -780,11 +779,11 @@ def update_expected_user_agent(expected):
self.scope["headers"].append([b"user-agent", user_agent])
app = otel_asgi.OpenTelemetryMiddleware(simple_asgi)
self.seed_app(app)
- self.send_default_request()
- outputs = self.get_all_output()
+ await self.send_default_request()
+ outputs = await self.get_all_output()
self.validate_outputs(outputs, modifiers=[update_expected_user_agent])
- def test_user_agent_new_semconv(self):
+ async def test_user_agent_new_semconv(self):
"""Test that host header is converted to http.server_name."""
user_agent = b"test-agent"
@@ -797,8 +796,8 @@ def update_expected_user_agent(expected):
self.scope["headers"].append([b"user-agent", user_agent])
app = otel_asgi.OpenTelemetryMiddleware(simple_asgi)
self.seed_app(app)
- self.send_default_request()
- outputs = self.get_all_output()
+ await self.send_default_request()
+ outputs = await self.get_all_output()
self.validate_outputs(
outputs,
modifiers=[update_expected_user_agent],
@@ -806,7 +805,7 @@ def update_expected_user_agent(expected):
new_sem_conv=True,
)
- def test_user_agent_both_semconv(self):
+ async def test_user_agent_both_semconv(self):
"""Test that host header is converted to http.server_name."""
user_agent = b"test-agent"
@@ -822,8 +821,8 @@ def update_expected_user_agent(expected):
self.scope["headers"].append([b"user-agent", user_agent])
app = otel_asgi.OpenTelemetryMiddleware(simple_asgi)
self.seed_app(app)
- self.send_default_request()
- outputs = self.get_all_output()
+ await self.send_default_request()
+ outputs = await self.get_all_output()
self.validate_outputs(
outputs,
modifiers=[update_expected_user_agent],
@@ -831,7 +830,7 @@ def update_expected_user_agent(expected):
new_sem_conv=True,
)
- def test_traceresponse_header(self):
+ async def test_traceresponse_header(self):
"""Test a traceresponse header is sent when a global propagator is set."""
orig = get_global_response_propagator()
@@ -839,12 +838,12 @@ def test_traceresponse_header(self):
app = otel_asgi.OpenTelemetryMiddleware(simple_asgi)
self.seed_app(app)
- self.send_default_request()
+ await self.send_default_request()
+ response_start, response_body, *_ = await self.get_all_output()
span = self.memory_exporter.get_finished_spans()[-1]
self.assertEqual(trace_api.SpanKind.SERVER, span.kind)
- response_start, response_body, *_ = self.get_all_output()
self.assertEqual(response_body["body"], b"*")
self.assertEqual(response_start["status"], 200)
@@ -864,7 +863,7 @@ def test_traceresponse_header(self):
set_global_response_propagator(orig)
- def test_websocket(self):
+ async def test_websocket(self):
self.scope = {
"method": "GET",
"type": "websocket",
@@ -878,10 +877,10 @@ def test_websocket(self):
}
app = otel_asgi.OpenTelemetryMiddleware(simple_asgi)
self.seed_app(app)
- self.send_input({"type": "websocket.connect"})
- self.send_input({"type": "websocket.receive", "text": "ping"})
- self.send_input({"type": "websocket.disconnect"})
- self.get_all_output()
+ await self.send_input({"type": "websocket.connect"})
+ await self.send_input({"type": "websocket.receive", "text": "ping"})
+ await self.send_input({"type": "websocket.disconnect"})
+ await self.get_all_output()
span_list = self.memory_exporter.get_finished_spans()
self.assertEqual(len(span_list), 6)
expected = [
@@ -938,7 +937,7 @@ def test_websocket(self):
self.assertEqual(span.kind, expected["kind"])
self.assertDictEqual(dict(span.attributes), expected["attributes"])
- def test_websocket_new_semconv(self):
+ async def test_websocket_new_semconv(self):
self.scope = {
"method": "GET",
"type": "websocket",
@@ -952,10 +951,10 @@ def test_websocket_new_semconv(self):
}
app = otel_asgi.OpenTelemetryMiddleware(simple_asgi)
self.seed_app(app)
- self.send_input({"type": "websocket.connect"})
- self.send_input({"type": "websocket.receive", "text": "ping"})
- self.send_input({"type": "websocket.disconnect"})
- self.get_all_output()
+ await self.send_input({"type": "websocket.connect"})
+ await self.send_input({"type": "websocket.receive", "text": "ping"})
+ await self.send_input({"type": "websocket.disconnect"})
+ await self.get_all_output()
span_list = self.memory_exporter.get_finished_spans()
self.assertEqual(len(span_list), 6)
expected = [
@@ -1010,7 +1009,7 @@ def test_websocket_new_semconv(self):
self.assertEqual(span.kind, expected["kind"])
self.assertDictEqual(dict(span.attributes), expected["attributes"])
- def test_websocket_both_semconv(self):
+ async def test_websocket_both_semconv(self):
self.scope = {
"method": "GET",
"type": "websocket",
@@ -1024,10 +1023,10 @@ def test_websocket_both_semconv(self):
}
app = otel_asgi.OpenTelemetryMiddleware(simple_asgi)
self.seed_app(app)
- self.send_input({"type": "websocket.connect"})
- self.send_input({"type": "websocket.receive", "text": "ping"})
- self.send_input({"type": "websocket.disconnect"})
- self.get_all_output()
+ await self.send_input({"type": "websocket.connect"})
+ await self.send_input({"type": "websocket.receive", "text": "ping"})
+ await self.send_input({"type": "websocket.disconnect"})
+ await self.get_all_output()
span_list = self.memory_exporter.get_finished_spans()
self.assertEqual(len(span_list), 6)
expected = [
@@ -1094,7 +1093,7 @@ def test_websocket_both_semconv(self):
self.assertEqual(span.kind, expected["kind"])
self.assertDictEqual(dict(span.attributes), expected["attributes"])
- def test_websocket_traceresponse_header(self):
+ async def test_websocket_traceresponse_header(self):
"""Test a traceresponse header is set for websocket messages"""
orig = get_global_response_propagator()
@@ -1112,10 +1111,10 @@ def test_websocket_traceresponse_header(self):
}
app = otel_asgi.OpenTelemetryMiddleware(simple_asgi)
self.seed_app(app)
- self.send_input({"type": "websocket.connect"})
- self.send_input({"type": "websocket.receive", "text": "ping"})
- self.send_input({"type": "websocket.disconnect"})
- _, socket_send, *_ = self.get_all_output()
+ await self.send_input({"type": "websocket.connect"})
+ await self.send_input({"type": "websocket.receive", "text": "ping"})
+ await self.send_input({"type": "websocket.disconnect"})
+ _, socket_send, *_ = await self.get_all_output()
span = self.memory_exporter.get_finished_spans()[-1]
self.assertEqual(trace_api.SpanKind.SERVER, span.kind)
@@ -1134,15 +1133,15 @@ def test_websocket_traceresponse_header(self):
set_global_response_propagator(orig)
- def test_lifespan(self):
+ async def test_lifespan(self):
self.scope["type"] = "lifespan"
app = otel_asgi.OpenTelemetryMiddleware(simple_asgi)
self.seed_app(app)
- self.send_default_request()
+ await self.send_default_request()
span_list = self.memory_exporter.get_finished_spans()
self.assertEqual(len(span_list), 0)
- def test_hooks(self):
+ async def test_hooks(self):
def server_request_hook(span, scope):
span.update_name("name from server hook")
@@ -1169,20 +1168,23 @@ def update_expected_hook_results(expected):
client_response_hook=client_response_hook,
)
self.seed_app(app)
- self.send_default_request()
- outputs = self.get_all_output()
+ await self.send_default_request()
+ outputs = await self.get_all_output()
self.validate_outputs(
outputs, modifiers=[update_expected_hook_results]
)
- def test_asgi_metrics(self):
+ async def test_asgi_metrics(self):
app = otel_asgi.OpenTelemetryMiddleware(simple_asgi)
self.seed_app(app)
- self.send_default_request()
+ await self.send_default_request()
+ await self.get_all_output()
self.seed_app(app)
- self.send_default_request()
+ await self.send_default_request()
+ await self.get_all_output()
self.seed_app(app)
- self.send_default_request()
+ await self.send_default_request()
+ await self.get_all_output()
metrics_list = self.memory_metrics_reader.get_metrics_data()
number_data_point_seen = False
histogram_data_point_seen = False
@@ -1211,14 +1213,17 @@ def test_asgi_metrics(self):
)
self.assertTrue(number_data_point_seen and histogram_data_point_seen)
- def test_asgi_metrics_new_semconv(self):
+ async def test_asgi_metrics_new_semconv(self):
app = otel_asgi.OpenTelemetryMiddleware(simple_asgi)
self.seed_app(app)
- self.send_default_request()
+ await self.send_default_request()
+ await self.get_all_output()
self.seed_app(app)
- self.send_default_request()
+ await self.send_default_request()
+ await self.get_all_output()
self.seed_app(app)
- self.send_default_request()
+ await self.send_default_request()
+ await self.get_all_output()
metrics_list = self.memory_metrics_reader.get_metrics_data()
number_data_point_seen = False
histogram_data_point_seen = False
@@ -1247,14 +1252,17 @@ def test_asgi_metrics_new_semconv(self):
)
self.assertTrue(number_data_point_seen and histogram_data_point_seen)
- def test_asgi_metrics_both_semconv(self):
+ async def test_asgi_metrics_both_semconv(self):
app = otel_asgi.OpenTelemetryMiddleware(simple_asgi)
self.seed_app(app)
- self.send_default_request()
+ await self.send_default_request()
+ await self.get_all_output()
self.seed_app(app)
- self.send_default_request()
+ await self.send_default_request()
+ await self.get_all_output()
self.seed_app(app)
- self.send_default_request()
+ await self.send_default_request()
+ await self.get_all_output()
metrics_list = self.memory_metrics_reader.get_metrics_data()
number_data_point_seen = False
histogram_data_point_seen = False
@@ -1283,12 +1291,13 @@ def test_asgi_metrics_both_semconv(self):
)
self.assertTrue(number_data_point_seen and histogram_data_point_seen)
- def test_basic_metric_success(self):
+ async def test_basic_metric_success(self):
app = otel_asgi.OpenTelemetryMiddleware(simple_asgi)
self.seed_app(app)
start = default_timer()
- self.send_default_request()
+ await self.send_default_request()
duration = max(round((default_timer() - start) * 1000), 0)
+ await self.get_all_output()
expected_duration_attributes = {
"http.method": "GET",
"http.host": "127.0.0.1",
@@ -1330,7 +1339,7 @@ def test_basic_metric_success(self):
)
self.assertEqual(point.value, 0)
- def test_basic_metric_success_nonrecording_span(self):
+ async def test_basic_metric_success_nonrecording_span(self):
mock_tracer = mock.Mock()
mock_span = mock.Mock()
mock_span.is_recording.return_value = False
@@ -1344,8 +1353,9 @@ def test_basic_metric_success_nonrecording_span(self):
app = otel_asgi.OpenTelemetryMiddleware(simple_asgi)
self.seed_app(app)
start = default_timer()
- self.send_default_request()
+ await self.send_default_request()
duration = max(round((default_timer() - start) * 1000), 0)
+ await self.get_all_output()
expected_duration_attributes = {
"http.method": "GET",
"http.host": "127.0.0.1",
@@ -1374,7 +1384,7 @@ def test_basic_metric_success_nonrecording_span(self):
self.assertEqual(point.count, 1)
if metric.name == "http.server.duration":
self.assertAlmostEqual(
- duration, point.sum, delta=5
+ duration, point.sum, delta=15
)
elif (
metric.name == "http.server.response.size"
@@ -1389,12 +1399,13 @@ def test_basic_metric_success_nonrecording_span(self):
)
self.assertEqual(point.value, 0)
- def test_basic_metric_success_new_semconv(self):
+ async def test_basic_metric_success_new_semconv(self):
app = otel_asgi.OpenTelemetryMiddleware(simple_asgi)
self.seed_app(app)
start = default_timer()
- self.send_default_request()
+ await self.send_default_request()
duration_s = max(default_timer() - start, 0)
+ await self.get_all_output()
expected_duration_attributes = {
"http.request.method": "GET",
"url.scheme": "http",
@@ -1436,13 +1447,14 @@ def test_basic_metric_success_new_semconv(self):
)
self.assertEqual(point.value, 0)
- def test_basic_metric_success_both_semconv(self):
+ async def test_basic_metric_success_both_semconv(self):
app = otel_asgi.OpenTelemetryMiddleware(simple_asgi)
self.seed_app(app)
start = default_timer()
- self.send_default_request()
+ await self.send_default_request()
duration = max(round((default_timer() - start) * 1000), 0)
duration_s = max(default_timer() - start, 0)
+ await self.get_all_output()
expected_duration_attributes_old = {
"http.method": "GET",
"http.host": "127.0.0.1",
@@ -1524,7 +1536,7 @@ def test_basic_metric_success_both_semconv(self):
)
self.assertEqual(point.value, 0)
- def test_metric_target_attribute(self):
+ async def test_metric_target_attribute(self):
expected_target = "/api/user/{id}"
class TestRoute:
@@ -1540,7 +1552,8 @@ async def target_asgi(scope, receive, send):
app = otel_asgi.OpenTelemetryMiddleware(target_asgi)
self.seed_app(app)
- self.send_default_request()
+ await self.send_default_request()
+ await self.get_all_output()
metrics_list = self.memory_metrics_reader.get_metrics_data()
assertions = 0
for resource_metric in metrics_list.resource_metrics:
@@ -1557,7 +1570,7 @@ async def target_asgi(scope, receive, send):
assertions += 1
self.assertEqual(assertions, 3)
- def test_no_metric_for_websockets(self):
+ async def test_no_metric_for_websockets(self):
self.scope = {
"type": "websocket",
"http_version": "1.1",
@@ -1570,10 +1583,10 @@ def test_no_metric_for_websockets(self):
}
app = otel_asgi.OpenTelemetryMiddleware(simple_asgi)
self.seed_app(app)
- self.send_input({"type": "websocket.connect"})
- self.send_input({"type": "websocket.receive", "text": "ping"})
- self.send_input({"type": "websocket.disconnect"})
- self.get_all_output()
+ await self.send_input({"type": "websocket.connect"})
+ await self.send_input({"type": "websocket.receive", "text": "ping"})
+ await self.send_input({"type": "websocket.disconnect"})
+ await self.get_all_output()
self.assertIsNone(self.memory_metrics_reader.get_metrics_data())
@@ -1790,8 +1803,10 @@ def test_collect_target_attribute_fastapi_starlette_invalid(self):
)
-class TestWrappedApplication(AsgiTestBase):
- def test_mark_span_internal_in_presence_of_span_from_other_framework(self):
+class TestWrappedApplication(AsyncAsgiTestBase):
+ async def test_mark_span_internal_in_presence_of_span_from_other_framework(
+ self,
+ ):
tracer_provider, exporter = TestBase.create_tracer_provider()
tracer = tracer_provider.get_tracer(__name__)
app = otel_asgi.OpenTelemetryMiddleware(
@@ -1806,7 +1821,8 @@ async def wrapped_app(scope, receive, send):
await app(scope, receive, send)
self.seed_app(wrapped_app)
- self.send_default_request()
+ await self.send_default_request()
+ await self.get_all_output()
span_list = exporter.get_finished_spans()
self.assertEqual(SpanKind.INTERNAL, span_list[0].kind)
@@ -1823,11 +1839,11 @@ async def wrapped_app(scope, receive, send):
)
-class TestAsgiApplicationRaisingError(AsgiTestBase):
+class TestAsgiApplicationRaisingError(AsyncAsgiTestBase):
def tearDown(self):
pass
- def test_asgi_issue_1883(self):
+ async def test_asgi_value_error_exception(self):
"""
Test that exception UnboundLocalError local variable 'start' referenced before assignment is not raised
See https://github.com/open-telemetry/opentelemetry-python-contrib/issues/1883
@@ -1838,11 +1854,9 @@ async def bad_app(_scope, _receive, _send):
app = otel_asgi.OpenTelemetryMiddleware(bad_app)
self.seed_app(app)
- self.send_default_request()
+ await self.send_default_request()
try:
- asyncio.get_event_loop().run_until_complete(
- self.communicator.stop()
- )
+ await self.communicator.wait()
except ValueError as exc_info:
self.assertEqual(exc_info.args[0], "whatever")
except Exception as exc_info: # pylint: disable=W0703
From 830397ecbf332e469ff5adc99ba6dea7a79359c5 Mon Sep 17 00:00:00 2001
From: Riccardo Magliocchetti
Date: Mon, 26 Aug 2024 18:54:57 +0200
Subject: [PATCH 03/33] httpx: fix handling of async hooks (#2823)
---
CHANGELOG.md | 12 +++--
.../instrumentation/httpx/__init__.py | 13 +++--
.../tests/test_httpx_integration.py | 49 ++++++++++++++++++-
3 files changed, 63 insertions(+), 11 deletions(-)
diff --git a/CHANGELOG.md b/CHANGELOG.md
index c5ce56423a..3dd53582ec 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -7,23 +7,25 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
## Unreleased
-## Added
+### Added
- `opentelemetry-instrumentation-kafka-python` Instrument temporary fork, kafka-python-ng
inside kafka-python's instrumentation
([#2537](https://github.com/open-telemetry/opentelemetry-python-contrib/pull/2537))
-## Breaking changes
+### Breaking changes
- `opentelemetry-bootstrap` Remove `opentelemetry-instrumentation-aws-lambda` from the defaults instrumentations
([#2786](https://github.com/open-telemetry/opentelemetry-python-contrib/pull/2786))
-## Fixed
+### Fixed
+- `opentelemetry-instrumentation-httpx` fix handling of async hooks
+ ([#2823](https://github.com/open-telemetry/opentelemetry-python-contrib/pull/2823))
- `opentelemetry-instrumentation-system-metrics` fix `process.runtime.cpu.utilization` values to be shown in range of 0 to 1
- ([2812](https://github.com/open-telemetry/opentelemetry-python-contrib/pull/2812))
+ ([#2812](https://github.com/open-telemetry/opentelemetry-python-contrib/pull/2812))
- `opentelemetry-instrumentation-fastapi` fix `fastapi` auto-instrumentation by removing `fastapi-slim` support, `fastapi-slim` itself is discontinued from maintainers
- ([2783](https://github.com/open-telemetry/opentelemetry-python-contrib/pull/2783))
+ ([#2783](https://github.com/open-telemetry/opentelemetry-python-contrib/pull/2783))
- `opentelemetry-instrumentation-aws-lambda` Avoid exception when a handler is not present.
([#2750](https://github.com/open-telemetry/opentelemetry-python-contrib/pull/2750))
- `opentelemetry-instrumentation-django` Fix regression - `http.target` re-added back to old semconv duration metrics
diff --git a/instrumentation/opentelemetry-instrumentation-httpx/src/opentelemetry/instrumentation/httpx/__init__.py b/instrumentation/opentelemetry-instrumentation-httpx/src/opentelemetry/instrumentation/httpx/__init__.py
index 43db6c3a82..15ee59a183 100644
--- a/instrumentation/opentelemetry-instrumentation-httpx/src/opentelemetry/instrumentation/httpx/__init__.py
+++ b/instrumentation/opentelemetry-instrumentation-httpx/src/opentelemetry/instrumentation/httpx/__init__.py
@@ -192,6 +192,7 @@ async def async_response_hook(span, request, response):
"""
import logging
import typing
+from asyncio import iscoroutinefunction
from types import TracebackType
import httpx
@@ -731,15 +732,19 @@ def _instrument(self, **kwargs):
self._original_async_client = httpx.AsyncClient
request_hook = kwargs.get("request_hook")
response_hook = kwargs.get("response_hook")
- async_request_hook = kwargs.get("async_request_hook", request_hook)
- async_response_hook = kwargs.get("async_response_hook", response_hook)
+ async_request_hook = kwargs.get("async_request_hook")
+ async_response_hook = kwargs.get("async_response_hook")
if callable(request_hook):
_InstrumentedClient._request_hook = request_hook
- if callable(async_request_hook):
+ if callable(async_request_hook) and iscoroutinefunction(
+ async_request_hook
+ ):
_InstrumentedAsyncClient._request_hook = async_request_hook
if callable(response_hook):
_InstrumentedClient._response_hook = response_hook
- if callable(async_response_hook):
+ if callable(async_response_hook) and iscoroutinefunction(
+ async_response_hook
+ ):
_InstrumentedAsyncClient._response_hook = async_response_hook
tracer_provider = kwargs.get("tracer_provider")
_InstrumentedClient._tracer_provider = tracer_provider
diff --git a/instrumentation/opentelemetry-instrumentation-httpx/tests/test_httpx_integration.py b/instrumentation/opentelemetry-instrumentation-httpx/tests/test_httpx_integration.py
index 011b5e57d2..78938eb337 100644
--- a/instrumentation/opentelemetry-instrumentation-httpx/tests/test_httpx_integration.py
+++ b/instrumentation/opentelemetry-instrumentation-httpx/tests/test_httpx_integration.py
@@ -780,9 +780,15 @@ def test_custom_tracer_provider(self):
HTTPXClientInstrumentor().uninstrument()
def test_response_hook(self):
+ response_hook_key = (
+ "async_response_hook"
+ if asyncio.iscoroutinefunction(self.response_hook)
+ else "response_hook"
+ )
+ response_hook_kwargs = {response_hook_key: self.response_hook}
HTTPXClientInstrumentor().instrument(
tracer_provider=self.tracer_provider,
- response_hook=self.response_hook,
+ **response_hook_kwargs,
)
client = self.create_client()
result = self.perform_request(self.URL, client=client)
@@ -823,9 +829,15 @@ def test_response_hook_sync_async_kwargs(self):
HTTPXClientInstrumentor().uninstrument()
def test_request_hook(self):
+ request_hook_key = (
+ "async_request_hook"
+ if asyncio.iscoroutinefunction(self.request_hook)
+ else "request_hook"
+ )
+ request_hook_kwargs = {request_hook_key: self.request_hook}
HTTPXClientInstrumentor().instrument(
tracer_provider=self.tracer_provider,
- request_hook=self.request_hook,
+ **request_hook_kwargs,
)
client = self.create_client()
result = self.perform_request(self.URL, client=client)
@@ -1214,3 +1226,36 @@ def test_basic_multiple(self):
self.perform_request(self.URL, client=self.client)
self.perform_request(self.URL, client=self.client2)
self.assert_span(num_spans=2)
+
+ def test_async_response_hook_does_nothing_if_not_coroutine(self):
+ HTTPXClientInstrumentor().instrument(
+ tracer_provider=self.tracer_provider,
+ async_response_hook=_response_hook,
+ )
+ client = self.create_client()
+ result = self.perform_request(self.URL, client=client)
+
+ self.assertEqual(result.text, "Hello!")
+ span = self.assert_span()
+ self.assertEqual(
+ dict(span.attributes),
+ {
+ SpanAttributes.HTTP_METHOD: "GET",
+ SpanAttributes.HTTP_URL: self.URL,
+ SpanAttributes.HTTP_STATUS_CODE: 200,
+ },
+ )
+ HTTPXClientInstrumentor().uninstrument()
+
+ def test_async_request_hook_does_nothing_if_not_coroutine(self):
+ HTTPXClientInstrumentor().instrument(
+ tracer_provider=self.tracer_provider,
+ async_request_hook=_request_hook,
+ )
+ client = self.create_client()
+ result = self.perform_request(self.URL, client=client)
+
+ self.assertEqual(result.text, "Hello!")
+ span = self.assert_span()
+ self.assertEqual(span.name, "GET")
+ HTTPXClientInstrumentor().uninstrument()
From 5558e78d8c1755fbe36413c03d8fead572bff0d2 Mon Sep 17 00:00:00 2001
From: Riccardo Magliocchetti
Date: Mon, 26 Aug 2024 21:24:53 +0200
Subject: [PATCH 04/33] httpx: decouple tests from proxy related environment
variables (#2822)
---
.../tests/test_httpx_integration.py | 1 +
1 file changed, 1 insertion(+)
diff --git a/instrumentation/opentelemetry-instrumentation-httpx/tests/test_httpx_integration.py b/instrumentation/opentelemetry-instrumentation-httpx/tests/test_httpx_integration.py
index 78938eb337..27535800cb 100644
--- a/instrumentation/opentelemetry-instrumentation-httpx/tests/test_httpx_integration.py
+++ b/instrumentation/opentelemetry-instrumentation-httpx/tests/test_httpx_integration.py
@@ -723,6 +723,7 @@ def test_client_mounts_with_instrumented_transport(self):
spans[1].attributes[SpanAttributes.HTTP_URL], https_url
)
+ @mock.patch.dict("os.environ", {"NO_PROXY": ""}, clear=True)
class BaseInstrumentorTest(BaseTest, metaclass=abc.ABCMeta):
@abc.abstractmethod
def create_client(
From 476f6e245a68881796b96f171429a4ce31fed635 Mon Sep 17 00:00:00 2001
From: Riccardo Magliocchetti
Date: Mon, 26 Aug 2024 21:46:08 +0200
Subject: [PATCH 05/33] bootstrap: don't strip \n for last item on listing
(#2820)
---
.../src/opentelemetry/instrumentation/bootstrap.py | 2 +-
opentelemetry-instrumentation/tests/test_bootstrap.py | 2 +-
2 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/opentelemetry-instrumentation/src/opentelemetry/instrumentation/bootstrap.py b/opentelemetry-instrumentation/src/opentelemetry/instrumentation/bootstrap.py
index 6f86a539b2..1cc28abca4 100644
--- a/opentelemetry-instrumentation/src/opentelemetry/instrumentation/bootstrap.py
+++ b/opentelemetry-instrumentation/src/opentelemetry/instrumentation/bootstrap.py
@@ -119,7 +119,7 @@ def _find_installed_libraries():
def _run_requirements():
logger.setLevel(logging.ERROR)
- print("\n".join(_find_installed_libraries()), end="")
+ print("\n".join(_find_installed_libraries()))
def _run_install():
diff --git a/opentelemetry-instrumentation/tests/test_bootstrap.py b/opentelemetry-instrumentation/tests/test_bootstrap.py
index bbe2f5623b..4807f0beb7 100644
--- a/opentelemetry-instrumentation/tests/test_bootstrap.py
+++ b/opentelemetry-instrumentation/tests/test_bootstrap.py
@@ -77,7 +77,7 @@ def test_run_cmd_print(self):
bootstrap.run()
self.assertEqual(
fake_out.getvalue(),
- "\n".join(self.installed_libraries),
+ "\n".join(self.installed_libraries) + "\n",
)
@patch("sys.argv", ["bootstrap", "-a", "install"])
From 3ec1b9717ce47eb876dba3e6037b3d8fd72c1d3f Mon Sep 17 00:00:00 2001
From: Leighton Chen
Date: Tue, 27 Aug 2024 10:44:37 -0700
Subject: [PATCH 06/33] Add new maintainers aabmass and xrmx (#2825)
Congratulations and welcome @aabmass and @xrmx as new Python maintainers! We greatly appreciate your help and expertise.
Co-authored-by: Diego Hurtado
---
README.md | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/README.md b/README.md
index dcb2ebbba5..d33c1ca4d4 100644
--- a/README.md
+++ b/README.md
@@ -109,12 +109,10 @@ Meeting notes are available as a public [Google doc](https://docs.google.com/doc
Approvers ([@open-telemetry/python-approvers](https://github.com/orgs/open-telemetry/teams/python-approvers)):
-- [Aaron Abbott](https://github.com/aabmass), Google
- [EmÃdio Neto](https://github.com/emdneto), Zenvia
- [Jeremy Voss](https://github.com/jeremydvoss), Microsoft
- [Owais Lone](https://github.com/owais), Splunk
- [Pablo Collins](https://github.com/pmcollins), Splunk
-- [Riccardo Magliocchetti](https://github.com/xrmx), Elastic
- [Sanket Mehta](https://github.com/sanketmehta28), Cisco
- [Srikanth Chekuri](https://github.com/srikanthccv), signoz.io
- [Tammy Baylis](https://github.com/tammy-baylis-swi), SolarWinds
@@ -131,8 +129,10 @@ Emeritus Approvers:
Maintainers ([@open-telemetry/python-maintainers](https://github.com/orgs/open-telemetry/teams/python-maintainers)):
+- [Aaron Abbott](https://github.com/aabmass), Google
- [Diego Hurtado](https://github.com/ocelotl), Lightstep
- [Leighton Chen](https://github.com/lzchen), Microsoft
+- [Riccardo Magliocchetti](https://github.com/xrmx), Elastic
- [Shalev Roda](https://github.com/shalevr), Cisco
Emeritus Maintainers:
From 5a0540ba8bb5824596e0d42adde77f630555b62b Mon Sep 17 00:00:00 2001
From: Diego Hurtado
Date: Tue, 27 Aug 2024 12:08:00 -0600
Subject: [PATCH 07/33] Remove references to test.yml (#2830)
* Remove references to test.yml
Fixes #2829
* Update scripts/update_sha.py
Co-authored-by: Riccardo Magliocchetti
---------
Co-authored-by: Riccardo Magliocchetti
---
CONTRIBUTING.md | 2 +-
README.md | 7 +++++--
scripts/update_sha.py | 18 ++++++++++++------
3 files changed, 18 insertions(+), 9 deletions(-)
diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md
index d01d43181f..9072a6a641 100644
--- a/CONTRIBUTING.md
+++ b/CONTRIBUTING.md
@@ -235,7 +235,7 @@ Some of the tox targets install packages from the [OpenTelemetry Python Core Rep
CORE_REPO_SHA=c49ad57bfe35cfc69bfa863d74058ca9bec55fc3 tox
```
-The continuous integration overrides that environment variable with as per the configuration [here](https://github.com/open-telemetry/opentelemetry-python-contrib/blob/main/.github/workflows/test.yml#L9).
+The continuous integration overrides that environment variable with as per the configuration [here](https://github.com/open-telemetry/opentelemetry-python-contrib/blob/main/.github/workflows/test_0.yml#L14).
## Style Guide
diff --git a/README.md b/README.md
index d33c1ca4d4..1a2aaf4f8a 100644
--- a/README.md
+++ b/README.md
@@ -20,8 +20,11 @@
-
-
+
+
+
+
+
diff --git a/scripts/update_sha.py b/scripts/update_sha.py
index 1c913249a2..c63b9eda9b 100644
--- a/scripts/update_sha.py
+++ b/scripts/update_sha.py
@@ -22,7 +22,12 @@
API_URL = (
"https://api.github.com/repos/open-telemetry/opentelemetry-python/commits/"
)
-WORKFLOW_FILE = ".github/workflows/test.yml"
+workflow_files = [
+ ".github/workflows/test_0.yml"
+ ".github/workflows/test_1.yml"
+ ".github/workflows/misc_0.yml"
+ ".github/workflows/lint_0.yml"
+]
def get_sha(branch):
@@ -35,11 +40,12 @@ def get_sha(branch):
def update_sha(sha):
yaml = YAML()
yaml.preserve_quotes = True
- with open(WORKFLOW_FILE, "r") as file:
- workflow = yaml.load(file)
- workflow["env"]["CORE_REPO_SHA"] = sha
- with open(WORKFLOW_FILE, "w") as file:
- yaml.dump(workflow, file)
+ for workflow_file in workflow_files:
+ with open(workflow_file, "r") as file:
+ workflow = yaml.load(file)
+ workflow["env"]["CORE_REPO_SHA"] = sha
+ with open(workflow_file, "w") as file:
+ yaml.dump(workflow, file)
def main():
From b0129acbdf35c941f564058a4d5551fea6c8c2d5 Mon Sep 17 00:00:00 2001
From: Jack Gong <93988774+gongbenhua@users.noreply.github.com>
Date: Thu, 29 Aug 2024 01:02:42 +0800
Subject: [PATCH 08/33] fix ut in pypy (#2809)
---
.../tests/test_fastapi_instrumentation.py | 38 ++++++++++++-------
1 file changed, 25 insertions(+), 13 deletions(-)
diff --git a/instrumentation/opentelemetry-instrumentation-fastapi/tests/test_fastapi_instrumentation.py b/instrumentation/opentelemetry-instrumentation-fastapi/tests/test_fastapi_instrumentation.py
index 91ed514096..634c74af6b 100644
--- a/instrumentation/opentelemetry-instrumentation-fastapi/tests/test_fastapi_instrumentation.py
+++ b/instrumentation/opentelemetry-instrumentation-fastapi/tests/test_fastapi_instrumentation.py
@@ -530,7 +530,7 @@ def test_basic_metric_success(self):
dict(point.attributes),
)
self.assertEqual(point.count, 1)
- self.assertAlmostEqual(duration, point.sum, delta=40)
+ self.assertAlmostEqual(duration, point.sum, delta=350)
if isinstance(point, NumberDataPoint):
self.assertDictEqual(
expected_requests_count_attributes,
@@ -565,7 +565,9 @@ def test_basic_metric_success_new_semconv(self):
)
self.assertEqual(point.count, 1)
if metric.name == "http.server.request.duration":
- self.assertAlmostEqual(duration_s, point.sum, places=1)
+ self.assertAlmostEqual(
+ duration_s * 0.1, point.sum, places=1
+ )
elif metric.name == "http.server.response.body.size":
self.assertEqual(25, point.sum)
elif metric.name == "http.server.request.body.size":
@@ -615,9 +617,11 @@ def test_basic_metric_success_both_semconv(self):
for point in list(metric.data.data_points):
if isinstance(point, HistogramDataPoint):
self.assertEqual(point.count, 1)
- self.assertAlmostEqual(duration, point.sum, delta=40)
+ self.assertAlmostEqual(duration, point.sum, delta=350)
if metric.name == "http.server.request.duration":
- self.assertAlmostEqual(duration_s, point.sum, places=1)
+ self.assertAlmostEqual(
+ duration_s * 0.1, point.sum, places=1
+ )
self.assertDictEqual(
expected_duration_attributes_new,
dict(point.attributes),
@@ -635,7 +639,7 @@ def test_basic_metric_success_both_semconv(self):
dict(point.attributes),
)
elif metric.name == "http.server.duration":
- self.assertAlmostEqual(duration, point.sum, delta=40)
+ self.assertAlmostEqual(duration, point.sum, delta=350)
self.assertDictEqual(
expected_duration_attributes_old,
dict(point.attributes),
@@ -691,7 +695,7 @@ def test_basic_metric_nonstandard_http_method_success(self):
dict(point.attributes),
)
self.assertEqual(point.count, 1)
- self.assertAlmostEqual(duration, point.sum, delta=40)
+ self.assertAlmostEqual(duration, point.sum, delta=350)
if isinstance(point, NumberDataPoint):
self.assertDictEqual(
expected_requests_count_attributes,
@@ -726,7 +730,9 @@ def test_basic_metric_nonstandard_http_method_success_new_semconv(self):
)
self.assertEqual(point.count, 1)
if metric.name == "http.server.request.duration":
- self.assertAlmostEqual(duration_s, point.sum, places=1)
+ self.assertAlmostEqual(
+ duration_s * 0.1, point.sum, places=1
+ )
elif metric.name == "http.server.response.body.size":
self.assertEqual(31, point.sum)
elif metric.name == "http.server.request.body.size":
@@ -777,7 +783,9 @@ def test_basic_metric_nonstandard_http_method_success_both_semconv(self):
if isinstance(point, HistogramDataPoint):
self.assertEqual(point.count, 1)
if metric.name == "http.server.request.duration":
- self.assertAlmostEqual(duration_s, point.sum, places=1)
+ self.assertAlmostEqual(
+ duration_s * 0.1, point.sum, places=1
+ )
self.assertDictEqual(
expected_duration_attributes_new,
dict(point.attributes),
@@ -795,7 +803,7 @@ def test_basic_metric_nonstandard_http_method_success_both_semconv(self):
dict(point.attributes),
)
elif metric.name == "http.server.duration":
- self.assertAlmostEqual(duration, point.sum, delta=40)
+ self.assertAlmostEqual(duration, point.sum, delta=350)
self.assertDictEqual(
expected_duration_attributes_old,
dict(point.attributes),
@@ -836,7 +844,7 @@ def test_basic_post_request_metric_success(self):
if isinstance(point, HistogramDataPoint):
self.assertEqual(point.count, 1)
if metric.name == "http.server.duration":
- self.assertAlmostEqual(duration, point.sum, delta=40)
+ self.assertAlmostEqual(duration, point.sum, delta=350)
elif metric.name == "http.server.response.size":
self.assertEqual(response_size, point.sum)
elif metric.name == "http.server.request.size":
@@ -861,7 +869,9 @@ def test_basic_post_request_metric_success_new_semconv(self):
if isinstance(point, HistogramDataPoint):
self.assertEqual(point.count, 1)
if metric.name == "http.server.request.duration":
- self.assertAlmostEqual(duration_s, point.sum, places=1)
+ self.assertAlmostEqual(
+ duration_s * 0.1, point.sum, places=1
+ )
elif metric.name == "http.server.response.body.size":
self.assertEqual(response_size, point.sum)
elif metric.name == "http.server.request.body.size":
@@ -887,13 +897,15 @@ def test_basic_post_request_metric_success_both_semconv(self):
if isinstance(point, HistogramDataPoint):
self.assertEqual(point.count, 1)
if metric.name == "http.server.request.duration":
- self.assertAlmostEqual(duration_s, point.sum, places=1)
+ self.assertAlmostEqual(
+ duration_s * 0.1, point.sum, places=1
+ )
elif metric.name == "http.server.response.body.size":
self.assertEqual(response_size, point.sum)
elif metric.name == "http.server.request.body.size":
self.assertEqual(request_size, point.sum)
elif metric.name == "http.server.duration":
- self.assertAlmostEqual(duration, point.sum, delta=40)
+ self.assertAlmostEqual(duration, point.sum, delta=350)
elif metric.name == "http.server.response.size":
self.assertEqual(response_size, point.sum)
elif metric.name == "http.server.request.size":
From 161acbb8ca58f55d0c8da908de369f2cddb880a6 Mon Sep 17 00:00:00 2001
From: Diego Hurtado
Date: Wed, 28 Aug 2024 12:12:08 -0600
Subject: [PATCH 09/33] Skip generate-workflows when triggered by push (#2836)
Fixes #2835
---
.../src/generate_workflows_lib/misc.yml.j2 | 2 +-
.github/workflows/misc_0.yml | 2 +-
2 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/.github/workflows/generate_workflows_lib/src/generate_workflows_lib/misc.yml.j2 b/.github/workflows/generate_workflows_lib/src/generate_workflows_lib/misc.yml.j2
index 807da0eb1a..2b0735b432 100644
--- a/.github/workflows/generate_workflows_lib/src/generate_workflows_lib/misc.yml.j2
+++ b/.github/workflows/generate_workflows_lib/src/generate_workflows_lib/misc.yml.j2
@@ -23,7 +23,7 @@ jobs:
{%- if job_data == "generate-workflows" %}
if: |
!contains(github.event.pull_request.labels.*.name, 'Skip generate-workflows')
- && github.actor != 'opentelemetrybot'
+ && github.actor != 'opentelemetrybot' && github.event_name == 'pull_request'
{%- endif %}
{%- if job_data == "public-symbols-check" %}
if: |
diff --git a/.github/workflows/misc_0.yml b/.github/workflows/misc_0.yml
index f7b9faa9f3..3c3f7bfacf 100644
--- a/.github/workflows/misc_0.yml
+++ b/.github/workflows/misc_0.yml
@@ -96,7 +96,7 @@ jobs:
runs-on: ubuntu-latest
if: |
!contains(github.event.pull_request.labels.*.name, 'Skip generate-workflows')
- && github.actor != 'opentelemetrybot'
+ && github.actor != 'opentelemetrybot' && github.event_name == 'pull_request'
steps:
- name: Checkout repo @ SHA - ${{ github.sha }}
uses: actions/checkout@v4
From ee67ea8ba5380e55be1a9bb1f7e8bc916ff3bdec Mon Sep 17 00:00:00 2001
From: OpenTelemetry Bot <107717825+opentelemetrybot@users.noreply.github.com>
Date: Wed, 28 Aug 2024 16:20:37 -0500
Subject: [PATCH 10/33] Update version to 1.28.0.dev/0.49b0.dev (#2828)
* Update version to 1.28.0.dev/0.49b0.dev
* Update core SHA
---------
Co-authored-by: Diego Hurtado
---
.github/workflows/lint_0.yml | 2 +-
.github/workflows/misc_0.yml | 2 +-
.github/workflows/test_0.yml | 2 +-
.github/workflows/test_1.yml | 2 +-
CHANGELOG.md | 2 +
_template/version.py | 2 +-
eachdist.ini | 4 +-
.../prometheus_remote_write/version.py | 2 +-
.../pyproject.toml | 2 +-
.../exporter/richconsole/version.py | 2 +-
.../pyproject.toml | 2 +-
.../instrumentation/aio_pika/version.py | 2 +-
.../pyproject.toml | 6 +-
.../instrumentation/aiohttp_client/version.py | 2 +-
.../pyproject.toml | 6 +-
.../instrumentation/aiohttp_server/version.py | 2 +-
.../pyproject.toml | 4 +-
.../instrumentation/aiopg/version.py | 2 +-
.../pyproject.toml | 6 +-
.../instrumentation/asgi/version.py | 2 +-
.../pyproject.toml | 4 +-
.../instrumentation/asyncio/version.py | 2 +-
.../pyproject.toml | 4 +-
.../instrumentation/asyncpg/version.py | 2 +-
.../pyproject.toml | 4 +-
.../instrumentation/aws_lambda/version.py | 2 +-
.../pyproject.toml | 4 +-
.../instrumentation/boto/version.py | 2 +-
.../pyproject.toml | 4 +-
.../instrumentation/boto3sqs/version.py | 2 +-
.../pyproject.toml | 4 +-
.../instrumentation/botocore/version.py | 2 +-
.../pyproject.toml | 4 +-
.../instrumentation/cassandra/version.py | 2 +-
.../pyproject.toml | 4 +-
.../instrumentation/celery/version.py | 2 +-
.../pyproject.toml | 2 +-
.../confluent_kafka/version.py | 2 +-
.../pyproject.toml | 4 +-
.../instrumentation/dbapi/version.py | 2 +-
.../pyproject.toml | 10 +-
.../instrumentation/django/version.py | 2 +-
.../pyproject.toml | 4 +-
.../instrumentation/elasticsearch/version.py | 2 +-
.../pyproject.toml | 8 +-
.../instrumentation/falcon/version.py | 2 +-
.../pyproject.toml | 8 +-
.../instrumentation/fastapi/version.py | 2 +-
.../pyproject.toml | 8 +-
.../instrumentation/flask/version.py | 2 +-
.../pyproject.toml | 4 +-
.../instrumentation/grpc/version.py | 2 +-
.../pyproject.toml | 6 +-
.../instrumentation/httpx/version.py | 2 +-
.../pyproject.toml | 2 +-
.../instrumentation/jinja2/version.py | 2 +-
.../pyproject.toml | 4 +-
.../instrumentation/kafka/version.py | 2 +-
.../pyproject.toml | 2 +-
.../instrumentation/logging/version.py | 2 +-
.../pyproject.toml | 4 +-
.../instrumentation/mysql/version.py | 2 +-
.../pyproject.toml | 4 +-
.../instrumentation/mysqlclient/version.py | 2 +-
.../pyproject.toml | 2 +-
.../instrumentation/pika/version.py | 2 +-
.../pyproject.toml | 4 +-
.../instrumentation/psycopg/version.py | 2 +-
.../pyproject.toml | 4 +-
.../instrumentation/psycopg2/version.py | 2 +-
.../pyproject.toml | 4 +-
.../instrumentation/pymemcache/version.py | 2 +-
.../pyproject.toml | 4 +-
.../instrumentation/pymongo/version.py | 2 +-
.../pyproject.toml | 4 +-
.../instrumentation/pymysql/version.py | 2 +-
.../pyproject.toml | 8 +-
.../instrumentation/pyramid/version.py | 2 +-
.../pyproject.toml | 4 +-
.../instrumentation/redis/version.py | 2 +-
.../pyproject.toml | 4 +-
.../instrumentation/remoulade/version.py | 2 +-
.../pyproject.toml | 6 +-
.../instrumentation/requests/version.py | 2 +-
.../pyproject.toml | 4 +-
.../instrumentation/sqlalchemy/version.py | 2 +-
.../pyproject.toml | 4 +-
.../instrumentation/sqlite3/version.py | 2 +-
.../pyproject.toml | 8 +-
.../instrumentation/starlette/version.py | 2 +-
.../pyproject.toml | 2 +-
.../instrumentation/system_metrics/version.py | 2 +-
.../pyproject.toml | 2 +-
.../instrumentation/threading/version.py | 2 +-
.../pyproject.toml | 6 +-
.../instrumentation/tornado/version.py | 2 +-
.../pyproject.toml | 4 +-
.../instrumentation/tortoiseorm/version.py | 2 +-
.../pyproject.toml | 6 +-
.../instrumentation/urllib/version.py | 2 +-
.../pyproject.toml | 6 +-
.../instrumentation/urllib3/version.py | 2 +-
.../pyproject.toml | 6 +-
.../instrumentation/wsgi/version.py | 2 +-
.../pyproject.toml | 94 +++++++++---------
.../contrib-instrumentations/version.py | 2 +-
opentelemetry-distro/pyproject.toml | 4 +-
.../src/opentelemetry/distro/version.py | 2 +-
.../instrumentation/bootstrap_gen.py | 98 +++++++++----------
.../opentelemetry/instrumentation/version.py | 2 +-
.../processor/baggage/version.py | 2 +-
.../propagators/ot_trace/version.py | 2 +-
.../resource/detector/container/version.py | 2 +-
.../src/opentelemetry/util/http/version.py | 2 +-
114 files changed, 273 insertions(+), 271 deletions(-)
diff --git a/.github/workflows/lint_0.yml b/.github/workflows/lint_0.yml
index b5d20541e5..fa4f2e981a 100644
--- a/.github/workflows/lint_0.yml
+++ b/.github/workflows/lint_0.yml
@@ -10,7 +10,7 @@ on:
pull_request:
env:
- CORE_REPO_SHA: main
+ CORE_REPO_SHA: 8368b6305b4246aafa4ffa7d4890a692d1010b6e
CONTRIB_REPO_SHA: main
PIP_EXISTS_ACTION: w
diff --git a/.github/workflows/misc_0.yml b/.github/workflows/misc_0.yml
index 3c3f7bfacf..51cb5afea0 100644
--- a/.github/workflows/misc_0.yml
+++ b/.github/workflows/misc_0.yml
@@ -10,7 +10,7 @@ on:
pull_request:
env:
- CORE_REPO_SHA: main
+ CORE_REPO_SHA: 8368b6305b4246aafa4ffa7d4890a692d1010b6e
CONTRIB_REPO_SHA: main
PIP_EXISTS_ACTION: w
diff --git a/.github/workflows/test_0.yml b/.github/workflows/test_0.yml
index d251737227..d216e840ae 100644
--- a/.github/workflows/test_0.yml
+++ b/.github/workflows/test_0.yml
@@ -10,7 +10,7 @@ on:
pull_request:
env:
- CORE_REPO_SHA: main
+ CORE_REPO_SHA: 8368b6305b4246aafa4ffa7d4890a692d1010b6e
CONTRIB_REPO_SHA: main
PIP_EXISTS_ACTION: w
diff --git a/.github/workflows/test_1.yml b/.github/workflows/test_1.yml
index f7e71dd6b6..dc3afb6464 100644
--- a/.github/workflows/test_1.yml
+++ b/.github/workflows/test_1.yml
@@ -10,7 +10,7 @@ on:
pull_request:
env:
- CORE_REPO_SHA: main
+ CORE_REPO_SHA: 8368b6305b4246aafa4ffa7d4890a692d1010b6e
CONTRIB_REPO_SHA: main
PIP_EXISTS_ACTION: w
diff --git a/CHANGELOG.md b/CHANGELOG.md
index 3dd53582ec..2a18ea7858 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -7,6 +7,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
## Unreleased
+## Version 1.27.0/0.48b0 (2024-08-26)
+
### Added
- `opentelemetry-instrumentation-kafka-python` Instrument temporary fork, kafka-python-ng
diff --git a/_template/version.py b/_template/version.py
index 4d21fcb843..ee5a6342e7 100644
--- a/_template/version.py
+++ b/_template/version.py
@@ -12,4 +12,4 @@
# See the License for the specific language governing permissions and
# limitations under the License.
-__version__ = "0.48b0.dev"
+__version__ = "0.49b0.dev"
diff --git a/eachdist.ini b/eachdist.ini
index 2bcbde9c7c..79c865b334 100644
--- a/eachdist.ini
+++ b/eachdist.ini
@@ -16,7 +16,7 @@ sortfirst=
ext/*
[stable]
-version=1.27.0.dev
+version=1.28.0.dev
packages=
opentelemetry-sdk
@@ -34,7 +34,7 @@ packages=
opentelemetry-api
[prerelease]
-version=0.48b0.dev
+version=0.49b0.dev
packages=
all
diff --git a/exporter/opentelemetry-exporter-prometheus-remote-write/src/opentelemetry/exporter/prometheus_remote_write/version.py b/exporter/opentelemetry-exporter-prometheus-remote-write/src/opentelemetry/exporter/prometheus_remote_write/version.py
index 4d21fcb843..ee5a6342e7 100644
--- a/exporter/opentelemetry-exporter-prometheus-remote-write/src/opentelemetry/exporter/prometheus_remote_write/version.py
+++ b/exporter/opentelemetry-exporter-prometheus-remote-write/src/opentelemetry/exporter/prometheus_remote_write/version.py
@@ -12,4 +12,4 @@
# See the License for the specific language governing permissions and
# limitations under the License.
-__version__ = "0.48b0.dev"
+__version__ = "0.49b0.dev"
diff --git a/exporter/opentelemetry-exporter-richconsole/pyproject.toml b/exporter/opentelemetry-exporter-richconsole/pyproject.toml
index 6d38226160..eb00eb0437 100644
--- a/exporter/opentelemetry-exporter-richconsole/pyproject.toml
+++ b/exporter/opentelemetry-exporter-richconsole/pyproject.toml
@@ -27,7 +27,7 @@ classifiers = [
dependencies = [
"opentelemetry-api ~= 1.12",
"opentelemetry-sdk ~= 1.12",
- "opentelemetry-semantic-conventions == 0.48b0.dev",
+ "opentelemetry-semantic-conventions == 0.49b0.dev",
"rich>=10.0.0",
]
diff --git a/exporter/opentelemetry-exporter-richconsole/src/opentelemetry/exporter/richconsole/version.py b/exporter/opentelemetry-exporter-richconsole/src/opentelemetry/exporter/richconsole/version.py
index 4d21fcb843..ee5a6342e7 100644
--- a/exporter/opentelemetry-exporter-richconsole/src/opentelemetry/exporter/richconsole/version.py
+++ b/exporter/opentelemetry-exporter-richconsole/src/opentelemetry/exporter/richconsole/version.py
@@ -12,4 +12,4 @@
# See the License for the specific language governing permissions and
# limitations under the License.
-__version__ = "0.48b0.dev"
+__version__ = "0.49b0.dev"
diff --git a/instrumentation/opentelemetry-instrumentation-aio-pika/pyproject.toml b/instrumentation/opentelemetry-instrumentation-aio-pika/pyproject.toml
index c8be384fe6..65dfe3c7ac 100644
--- a/instrumentation/opentelemetry-instrumentation-aio-pika/pyproject.toml
+++ b/instrumentation/opentelemetry-instrumentation-aio-pika/pyproject.toml
@@ -26,7 +26,7 @@ classifiers = [
]
dependencies = [
"opentelemetry-api ~= 1.5",
- "opentelemetry-instrumentation == 0.48b0.dev",
+ "opentelemetry-instrumentation == 0.49b0.dev",
"wrapt >= 1.0.0, < 2.0.0",
]
diff --git a/instrumentation/opentelemetry-instrumentation-aio-pika/src/opentelemetry/instrumentation/aio_pika/version.py b/instrumentation/opentelemetry-instrumentation-aio-pika/src/opentelemetry/instrumentation/aio_pika/version.py
index 4d21fcb843..ee5a6342e7 100644
--- a/instrumentation/opentelemetry-instrumentation-aio-pika/src/opentelemetry/instrumentation/aio_pika/version.py
+++ b/instrumentation/opentelemetry-instrumentation-aio-pika/src/opentelemetry/instrumentation/aio_pika/version.py
@@ -12,4 +12,4 @@
# See the License for the specific language governing permissions and
# limitations under the License.
-__version__ = "0.48b0.dev"
+__version__ = "0.49b0.dev"
diff --git a/instrumentation/opentelemetry-instrumentation-aiohttp-client/pyproject.toml b/instrumentation/opentelemetry-instrumentation-aiohttp-client/pyproject.toml
index cfc53f723a..fbe663a50b 100644
--- a/instrumentation/opentelemetry-instrumentation-aiohttp-client/pyproject.toml
+++ b/instrumentation/opentelemetry-instrumentation-aiohttp-client/pyproject.toml
@@ -26,9 +26,9 @@ classifiers = [
]
dependencies = [
"opentelemetry-api ~= 1.12",
- "opentelemetry-instrumentation == 0.48b0.dev",
- "opentelemetry-semantic-conventions == 0.48b0.dev",
- "opentelemetry-util-http == 0.48b0.dev",
+ "opentelemetry-instrumentation == 0.49b0.dev",
+ "opentelemetry-semantic-conventions == 0.49b0.dev",
+ "opentelemetry-util-http == 0.49b0.dev",
"wrapt >= 1.0.0, < 2.0.0",
]
diff --git a/instrumentation/opentelemetry-instrumentation-aiohttp-client/src/opentelemetry/instrumentation/aiohttp_client/version.py b/instrumentation/opentelemetry-instrumentation-aiohttp-client/src/opentelemetry/instrumentation/aiohttp_client/version.py
index aa0c1a911f..49b83ce95e 100644
--- a/instrumentation/opentelemetry-instrumentation-aiohttp-client/src/opentelemetry/instrumentation/aiohttp_client/version.py
+++ b/instrumentation/opentelemetry-instrumentation-aiohttp-client/src/opentelemetry/instrumentation/aiohttp_client/version.py
@@ -12,4 +12,4 @@
# See the License for the specific language governing permissions and
# limitations under the License.
-__version__ = "0.48b0.dev"
+__version__ = "0.49b0.dev"
diff --git a/instrumentation/opentelemetry-instrumentation-aiohttp-server/pyproject.toml b/instrumentation/opentelemetry-instrumentation-aiohttp-server/pyproject.toml
index 6d62bd7956..a8e912e68d 100644
--- a/instrumentation/opentelemetry-instrumentation-aiohttp-server/pyproject.toml
+++ b/instrumentation/opentelemetry-instrumentation-aiohttp-server/pyproject.toml
@@ -26,9 +26,9 @@ classifiers = [
]
dependencies = [
"opentelemetry-api ~= 1.12",
- "opentelemetry-instrumentation == 0.48b0.dev",
- "opentelemetry-semantic-conventions == 0.48b0.dev",
- "opentelemetry-util-http == 0.48b0.dev",
+ "opentelemetry-instrumentation == 0.49b0.dev",
+ "opentelemetry-semantic-conventions == 0.49b0.dev",
+ "opentelemetry-util-http == 0.49b0.dev",
"wrapt >= 1.0.0, < 2.0.0",
]
diff --git a/instrumentation/opentelemetry-instrumentation-aiohttp-server/src/opentelemetry/instrumentation/aiohttp_server/version.py b/instrumentation/opentelemetry-instrumentation-aiohttp-server/src/opentelemetry/instrumentation/aiohttp_server/version.py
index 4d21fcb843..ee5a6342e7 100644
--- a/instrumentation/opentelemetry-instrumentation-aiohttp-server/src/opentelemetry/instrumentation/aiohttp_server/version.py
+++ b/instrumentation/opentelemetry-instrumentation-aiohttp-server/src/opentelemetry/instrumentation/aiohttp_server/version.py
@@ -12,4 +12,4 @@
# See the License for the specific language governing permissions and
# limitations under the License.
-__version__ = "0.48b0.dev"
+__version__ = "0.49b0.dev"
diff --git a/instrumentation/opentelemetry-instrumentation-aiopg/pyproject.toml b/instrumentation/opentelemetry-instrumentation-aiopg/pyproject.toml
index 404bc9c445..3a583db3dd 100644
--- a/instrumentation/opentelemetry-instrumentation-aiopg/pyproject.toml
+++ b/instrumentation/opentelemetry-instrumentation-aiopg/pyproject.toml
@@ -26,8 +26,8 @@ classifiers = [
]
dependencies = [
"opentelemetry-api ~= 1.12",
- "opentelemetry-instrumentation == 0.48b0.dev",
- "opentelemetry-instrumentation-dbapi == 0.48b0.dev",
+ "opentelemetry-instrumentation == 0.49b0.dev",
+ "opentelemetry-instrumentation-dbapi == 0.49b0.dev",
"wrapt >= 1.0.0, < 2.0.0",
]
diff --git a/instrumentation/opentelemetry-instrumentation-aiopg/src/opentelemetry/instrumentation/aiopg/version.py b/instrumentation/opentelemetry-instrumentation-aiopg/src/opentelemetry/instrumentation/aiopg/version.py
index 4d21fcb843..ee5a6342e7 100644
--- a/instrumentation/opentelemetry-instrumentation-aiopg/src/opentelemetry/instrumentation/aiopg/version.py
+++ b/instrumentation/opentelemetry-instrumentation-aiopg/src/opentelemetry/instrumentation/aiopg/version.py
@@ -12,4 +12,4 @@
# See the License for the specific language governing permissions and
# limitations under the License.
-__version__ = "0.48b0.dev"
+__version__ = "0.49b0.dev"
diff --git a/instrumentation/opentelemetry-instrumentation-asgi/pyproject.toml b/instrumentation/opentelemetry-instrumentation-asgi/pyproject.toml
index 480ca75df7..45c436aad4 100644
--- a/instrumentation/opentelemetry-instrumentation-asgi/pyproject.toml
+++ b/instrumentation/opentelemetry-instrumentation-asgi/pyproject.toml
@@ -27,9 +27,9 @@ classifiers = [
dependencies = [
"asgiref ~= 3.0",
"opentelemetry-api ~= 1.12",
- "opentelemetry-instrumentation == 0.48b0.dev",
- "opentelemetry-semantic-conventions == 0.48b0.dev",
- "opentelemetry-util-http == 0.48b0.dev",
+ "opentelemetry-instrumentation == 0.49b0.dev",
+ "opentelemetry-semantic-conventions == 0.49b0.dev",
+ "opentelemetry-util-http == 0.49b0.dev",
]
[project.optional-dependencies]
diff --git a/instrumentation/opentelemetry-instrumentation-asgi/src/opentelemetry/instrumentation/asgi/version.py b/instrumentation/opentelemetry-instrumentation-asgi/src/opentelemetry/instrumentation/asgi/version.py
index 4d21fcb843..ee5a6342e7 100644
--- a/instrumentation/opentelemetry-instrumentation-asgi/src/opentelemetry/instrumentation/asgi/version.py
+++ b/instrumentation/opentelemetry-instrumentation-asgi/src/opentelemetry/instrumentation/asgi/version.py
@@ -12,4 +12,4 @@
# See the License for the specific language governing permissions and
# limitations under the License.
-__version__ = "0.48b0.dev"
+__version__ = "0.49b0.dev"
diff --git a/instrumentation/opentelemetry-instrumentation-asyncio/pyproject.toml b/instrumentation/opentelemetry-instrumentation-asyncio/pyproject.toml
index cda5403ef5..36ed960392 100644
--- a/instrumentation/opentelemetry-instrumentation-asyncio/pyproject.toml
+++ b/instrumentation/opentelemetry-instrumentation-asyncio/pyproject.toml
@@ -26,8 +26,8 @@ classifiers = [
]
dependencies = [
"opentelemetry-api ~= 1.14",
- "opentelemetry-instrumentation == 0.48b0.dev",
- "opentelemetry-semantic-conventions == 0.48b0.dev",
+ "opentelemetry-instrumentation == 0.49b0.dev",
+ "opentelemetry-semantic-conventions == 0.49b0.dev",
"wrapt >= 1.0.0, < 2.0.0",
]
diff --git a/instrumentation/opentelemetry-instrumentation-asyncio/src/opentelemetry/instrumentation/asyncio/version.py b/instrumentation/opentelemetry-instrumentation-asyncio/src/opentelemetry/instrumentation/asyncio/version.py
index 4d21fcb843..ee5a6342e7 100644
--- a/instrumentation/opentelemetry-instrumentation-asyncio/src/opentelemetry/instrumentation/asyncio/version.py
+++ b/instrumentation/opentelemetry-instrumentation-asyncio/src/opentelemetry/instrumentation/asyncio/version.py
@@ -12,4 +12,4 @@
# See the License for the specific language governing permissions and
# limitations under the License.
-__version__ = "0.48b0.dev"
+__version__ = "0.49b0.dev"
diff --git a/instrumentation/opentelemetry-instrumentation-asyncpg/pyproject.toml b/instrumentation/opentelemetry-instrumentation-asyncpg/pyproject.toml
index 820c86070d..5a6632a028 100644
--- a/instrumentation/opentelemetry-instrumentation-asyncpg/pyproject.toml
+++ b/instrumentation/opentelemetry-instrumentation-asyncpg/pyproject.toml
@@ -26,8 +26,8 @@ classifiers = [
]
dependencies = [
"opentelemetry-api ~= 1.12",
- "opentelemetry-instrumentation == 0.48b0.dev",
- "opentelemetry-semantic-conventions == 0.48b0.dev",
+ "opentelemetry-instrumentation == 0.49b0.dev",
+ "opentelemetry-semantic-conventions == 0.49b0.dev",
]
[project.optional-dependencies]
diff --git a/instrumentation/opentelemetry-instrumentation-asyncpg/src/opentelemetry/instrumentation/asyncpg/version.py b/instrumentation/opentelemetry-instrumentation-asyncpg/src/opentelemetry/instrumentation/asyncpg/version.py
index 4d21fcb843..ee5a6342e7 100644
--- a/instrumentation/opentelemetry-instrumentation-asyncpg/src/opentelemetry/instrumentation/asyncpg/version.py
+++ b/instrumentation/opentelemetry-instrumentation-asyncpg/src/opentelemetry/instrumentation/asyncpg/version.py
@@ -12,4 +12,4 @@
# See the License for the specific language governing permissions and
# limitations under the License.
-__version__ = "0.48b0.dev"
+__version__ = "0.49b0.dev"
diff --git a/instrumentation/opentelemetry-instrumentation-aws-lambda/pyproject.toml b/instrumentation/opentelemetry-instrumentation-aws-lambda/pyproject.toml
index b512faa3eb..debc3ce033 100644
--- a/instrumentation/opentelemetry-instrumentation-aws-lambda/pyproject.toml
+++ b/instrumentation/opentelemetry-instrumentation-aws-lambda/pyproject.toml
@@ -25,9 +25,9 @@ classifiers = [
"Programming Language :: Python :: 3.12",
]
dependencies = [
- "opentelemetry-instrumentation == 0.48b0.dev",
+ "opentelemetry-instrumentation == 0.49b0.dev",
"opentelemetry-propagator-aws-xray ~= 1.0.1",
- "opentelemetry-semantic-conventions == 0.48b0.dev",
+ "opentelemetry-semantic-conventions == 0.49b0.dev",
]
[project.optional-dependencies]
diff --git a/instrumentation/opentelemetry-instrumentation-aws-lambda/src/opentelemetry/instrumentation/aws_lambda/version.py b/instrumentation/opentelemetry-instrumentation-aws-lambda/src/opentelemetry/instrumentation/aws_lambda/version.py
index 4d21fcb843..ee5a6342e7 100644
--- a/instrumentation/opentelemetry-instrumentation-aws-lambda/src/opentelemetry/instrumentation/aws_lambda/version.py
+++ b/instrumentation/opentelemetry-instrumentation-aws-lambda/src/opentelemetry/instrumentation/aws_lambda/version.py
@@ -12,4 +12,4 @@
# See the License for the specific language governing permissions and
# limitations under the License.
-__version__ = "0.48b0.dev"
+__version__ = "0.49b0.dev"
diff --git a/instrumentation/opentelemetry-instrumentation-boto/pyproject.toml b/instrumentation/opentelemetry-instrumentation-boto/pyproject.toml
index 3abda7b175..a2bdba302f 100644
--- a/instrumentation/opentelemetry-instrumentation-boto/pyproject.toml
+++ b/instrumentation/opentelemetry-instrumentation-boto/pyproject.toml
@@ -25,8 +25,8 @@ classifiers = [
]
dependencies = [
"opentelemetry-api ~= 1.12",
- "opentelemetry-instrumentation == 0.48b0.dev",
- "opentelemetry-semantic-conventions == 0.48b0.dev",
+ "opentelemetry-instrumentation == 0.49b0.dev",
+ "opentelemetry-semantic-conventions == 0.49b0.dev",
]
[project.optional-dependencies]
diff --git a/instrumentation/opentelemetry-instrumentation-boto/src/opentelemetry/instrumentation/boto/version.py b/instrumentation/opentelemetry-instrumentation-boto/src/opentelemetry/instrumentation/boto/version.py
index 4d21fcb843..ee5a6342e7 100644
--- a/instrumentation/opentelemetry-instrumentation-boto/src/opentelemetry/instrumentation/boto/version.py
+++ b/instrumentation/opentelemetry-instrumentation-boto/src/opentelemetry/instrumentation/boto/version.py
@@ -12,4 +12,4 @@
# See the License for the specific language governing permissions and
# limitations under the License.
-__version__ = "0.48b0.dev"
+__version__ = "0.49b0.dev"
diff --git a/instrumentation/opentelemetry-instrumentation-boto3sqs/pyproject.toml b/instrumentation/opentelemetry-instrumentation-boto3sqs/pyproject.toml
index cbbf9cd679..72dc38cbec 100644
--- a/instrumentation/opentelemetry-instrumentation-boto3sqs/pyproject.toml
+++ b/instrumentation/opentelemetry-instrumentation-boto3sqs/pyproject.toml
@@ -26,8 +26,8 @@ classifiers = [
]
dependencies = [
"opentelemetry-api ~= 1.12",
- "opentelemetry-instrumentation == 0.48b0.dev",
- "opentelemetry-semantic-conventions == 0.48b0.dev",
+ "opentelemetry-instrumentation == 0.49b0.dev",
+ "opentelemetry-semantic-conventions == 0.49b0.dev",
"wrapt >= 1.0.0, < 2.0.0",
]
diff --git a/instrumentation/opentelemetry-instrumentation-boto3sqs/src/opentelemetry/instrumentation/boto3sqs/version.py b/instrumentation/opentelemetry-instrumentation-boto3sqs/src/opentelemetry/instrumentation/boto3sqs/version.py
index 4d21fcb843..ee5a6342e7 100644
--- a/instrumentation/opentelemetry-instrumentation-boto3sqs/src/opentelemetry/instrumentation/boto3sqs/version.py
+++ b/instrumentation/opentelemetry-instrumentation-boto3sqs/src/opentelemetry/instrumentation/boto3sqs/version.py
@@ -12,4 +12,4 @@
# See the License for the specific language governing permissions and
# limitations under the License.
-__version__ = "0.48b0.dev"
+__version__ = "0.49b0.dev"
diff --git a/instrumentation/opentelemetry-instrumentation-botocore/pyproject.toml b/instrumentation/opentelemetry-instrumentation-botocore/pyproject.toml
index f286e7fc7b..797145b728 100644
--- a/instrumentation/opentelemetry-instrumentation-botocore/pyproject.toml
+++ b/instrumentation/opentelemetry-instrumentation-botocore/pyproject.toml
@@ -26,8 +26,8 @@ classifiers = [
]
dependencies = [
"opentelemetry-api ~= 1.12",
- "opentelemetry-instrumentation == 0.48b0.dev",
- "opentelemetry-semantic-conventions == 0.48b0.dev",
+ "opentelemetry-instrumentation == 0.49b0.dev",
+ "opentelemetry-semantic-conventions == 0.49b0.dev",
"opentelemetry-propagator-aws-xray ~= 1.0.1",
]
diff --git a/instrumentation/opentelemetry-instrumentation-botocore/src/opentelemetry/instrumentation/botocore/version.py b/instrumentation/opentelemetry-instrumentation-botocore/src/opentelemetry/instrumentation/botocore/version.py
index 4d21fcb843..ee5a6342e7 100644
--- a/instrumentation/opentelemetry-instrumentation-botocore/src/opentelemetry/instrumentation/botocore/version.py
+++ b/instrumentation/opentelemetry-instrumentation-botocore/src/opentelemetry/instrumentation/botocore/version.py
@@ -12,4 +12,4 @@
# See the License for the specific language governing permissions and
# limitations under the License.
-__version__ = "0.48b0.dev"
+__version__ = "0.49b0.dev"
diff --git a/instrumentation/opentelemetry-instrumentation-cassandra/pyproject.toml b/instrumentation/opentelemetry-instrumentation-cassandra/pyproject.toml
index b2ee19bdd2..3e785d1e8b 100644
--- a/instrumentation/opentelemetry-instrumentation-cassandra/pyproject.toml
+++ b/instrumentation/opentelemetry-instrumentation-cassandra/pyproject.toml
@@ -26,8 +26,8 @@ classifiers = [
]
dependencies = [
"opentelemetry-api ~= 1.12",
- "opentelemetry-instrumentation == 0.48b0.dev",
- "opentelemetry-semantic-conventions == 0.48b0.dev",
+ "opentelemetry-instrumentation == 0.49b0.dev",
+ "opentelemetry-semantic-conventions == 0.49b0.dev",
"wrapt >= 1.0.0, < 2.0.0",
]
diff --git a/instrumentation/opentelemetry-instrumentation-cassandra/src/opentelemetry/instrumentation/cassandra/version.py b/instrumentation/opentelemetry-instrumentation-cassandra/src/opentelemetry/instrumentation/cassandra/version.py
index 4d21fcb843..ee5a6342e7 100644
--- a/instrumentation/opentelemetry-instrumentation-cassandra/src/opentelemetry/instrumentation/cassandra/version.py
+++ b/instrumentation/opentelemetry-instrumentation-cassandra/src/opentelemetry/instrumentation/cassandra/version.py
@@ -12,4 +12,4 @@
# See the License for the specific language governing permissions and
# limitations under the License.
-__version__ = "0.48b0.dev"
+__version__ = "0.49b0.dev"
diff --git a/instrumentation/opentelemetry-instrumentation-celery/pyproject.toml b/instrumentation/opentelemetry-instrumentation-celery/pyproject.toml
index 0d302a4206..9f0f594581 100644
--- a/instrumentation/opentelemetry-instrumentation-celery/pyproject.toml
+++ b/instrumentation/opentelemetry-instrumentation-celery/pyproject.toml
@@ -26,8 +26,8 @@ classifiers = [
]
dependencies = [
"opentelemetry-api ~= 1.12",
- "opentelemetry-instrumentation == 0.48b0.dev",
- "opentelemetry-semantic-conventions == 0.48b0.dev",
+ "opentelemetry-instrumentation == 0.49b0.dev",
+ "opentelemetry-semantic-conventions == 0.49b0.dev",
]
[project.optional-dependencies]
diff --git a/instrumentation/opentelemetry-instrumentation-celery/src/opentelemetry/instrumentation/celery/version.py b/instrumentation/opentelemetry-instrumentation-celery/src/opentelemetry/instrumentation/celery/version.py
index 4d21fcb843..ee5a6342e7 100644
--- a/instrumentation/opentelemetry-instrumentation-celery/src/opentelemetry/instrumentation/celery/version.py
+++ b/instrumentation/opentelemetry-instrumentation-celery/src/opentelemetry/instrumentation/celery/version.py
@@ -12,4 +12,4 @@
# See the License for the specific language governing permissions and
# limitations under the License.
-__version__ = "0.48b0.dev"
+__version__ = "0.49b0.dev"
diff --git a/instrumentation/opentelemetry-instrumentation-confluent-kafka/pyproject.toml b/instrumentation/opentelemetry-instrumentation-confluent-kafka/pyproject.toml
index 13433ba9e2..2edfdeb038 100644
--- a/instrumentation/opentelemetry-instrumentation-confluent-kafka/pyproject.toml
+++ b/instrumentation/opentelemetry-instrumentation-confluent-kafka/pyproject.toml
@@ -25,7 +25,7 @@ classifiers = [
"Programming Language :: Python :: 3.12",
]
dependencies = [
- "opentelemetry-instrumentation == 0.48b0.dev",
+ "opentelemetry-instrumentation == 0.49b0.dev",
"opentelemetry-api ~= 1.12",
"wrapt >= 1.0.0, < 2.0.0",
]
diff --git a/instrumentation/opentelemetry-instrumentation-confluent-kafka/src/opentelemetry/instrumentation/confluent_kafka/version.py b/instrumentation/opentelemetry-instrumentation-confluent-kafka/src/opentelemetry/instrumentation/confluent_kafka/version.py
index 4d21fcb843..ee5a6342e7 100644
--- a/instrumentation/opentelemetry-instrumentation-confluent-kafka/src/opentelemetry/instrumentation/confluent_kafka/version.py
+++ b/instrumentation/opentelemetry-instrumentation-confluent-kafka/src/opentelemetry/instrumentation/confluent_kafka/version.py
@@ -12,4 +12,4 @@
# See the License for the specific language governing permissions and
# limitations under the License.
-__version__ = "0.48b0.dev"
+__version__ = "0.49b0.dev"
diff --git a/instrumentation/opentelemetry-instrumentation-dbapi/pyproject.toml b/instrumentation/opentelemetry-instrumentation-dbapi/pyproject.toml
index 991c7bb8af..bfa63dbcad 100644
--- a/instrumentation/opentelemetry-instrumentation-dbapi/pyproject.toml
+++ b/instrumentation/opentelemetry-instrumentation-dbapi/pyproject.toml
@@ -26,8 +26,8 @@ classifiers = [
]
dependencies = [
"opentelemetry-api ~= 1.12",
- "opentelemetry-instrumentation == 0.48b0.dev",
- "opentelemetry-semantic-conventions == 0.48b0.dev",
+ "opentelemetry-instrumentation == 0.49b0.dev",
+ "opentelemetry-semantic-conventions == 0.49b0.dev",
"wrapt >= 1.0.0, < 2.0.0",
]
diff --git a/instrumentation/opentelemetry-instrumentation-dbapi/src/opentelemetry/instrumentation/dbapi/version.py b/instrumentation/opentelemetry-instrumentation-dbapi/src/opentelemetry/instrumentation/dbapi/version.py
index e0bef4b1e3..79e27849a4 100644
--- a/instrumentation/opentelemetry-instrumentation-dbapi/src/opentelemetry/instrumentation/dbapi/version.py
+++ b/instrumentation/opentelemetry-instrumentation-dbapi/src/opentelemetry/instrumentation/dbapi/version.py
@@ -12,6 +12,6 @@
# See the License for the specific language governing permissions and
# limitations under the License.
-__version__ = "0.48b0.dev"
+__version__ = "0.49b0.dev"
_instruments = tuple()
diff --git a/instrumentation/opentelemetry-instrumentation-django/pyproject.toml b/instrumentation/opentelemetry-instrumentation-django/pyproject.toml
index a8b53820bc..27cdf157c4 100644
--- a/instrumentation/opentelemetry-instrumentation-django/pyproject.toml
+++ b/instrumentation/opentelemetry-instrumentation-django/pyproject.toml
@@ -26,15 +26,15 @@ classifiers = [
]
dependencies = [
"opentelemetry-api ~= 1.12",
- "opentelemetry-instrumentation == 0.48b0.dev",
- "opentelemetry-instrumentation-wsgi == 0.48b0.dev",
- "opentelemetry-semantic-conventions == 0.48b0.dev",
- "opentelemetry-util-http == 0.48b0.dev",
+ "opentelemetry-instrumentation == 0.49b0.dev",
+ "opentelemetry-instrumentation-wsgi == 0.49b0.dev",
+ "opentelemetry-semantic-conventions == 0.49b0.dev",
+ "opentelemetry-util-http == 0.49b0.dev",
]
[project.optional-dependencies]
asgi = [
- "opentelemetry-instrumentation-asgi == 0.48b0.dev",
+ "opentelemetry-instrumentation-asgi == 0.49b0.dev",
]
instruments = [
"django >= 1.10",
diff --git a/instrumentation/opentelemetry-instrumentation-django/src/opentelemetry/instrumentation/django/version.py b/instrumentation/opentelemetry-instrumentation-django/src/opentelemetry/instrumentation/django/version.py
index 4d21fcb843..ee5a6342e7 100644
--- a/instrumentation/opentelemetry-instrumentation-django/src/opentelemetry/instrumentation/django/version.py
+++ b/instrumentation/opentelemetry-instrumentation-django/src/opentelemetry/instrumentation/django/version.py
@@ -12,4 +12,4 @@
# See the License for the specific language governing permissions and
# limitations under the License.
-__version__ = "0.48b0.dev"
+__version__ = "0.49b0.dev"
diff --git a/instrumentation/opentelemetry-instrumentation-elasticsearch/pyproject.toml b/instrumentation/opentelemetry-instrumentation-elasticsearch/pyproject.toml
index 29d7bec6cc..e086d2c335 100644
--- a/instrumentation/opentelemetry-instrumentation-elasticsearch/pyproject.toml
+++ b/instrumentation/opentelemetry-instrumentation-elasticsearch/pyproject.toml
@@ -26,8 +26,8 @@ classifiers = [
]
dependencies = [
"opentelemetry-api ~= 1.12",
- "opentelemetry-instrumentation == 0.48b0.dev",
- "opentelemetry-semantic-conventions == 0.48b0.dev",
+ "opentelemetry-instrumentation == 0.49b0.dev",
+ "opentelemetry-semantic-conventions == 0.49b0.dev",
"wrapt >= 1.0.0, < 2.0.0",
]
diff --git a/instrumentation/opentelemetry-instrumentation-elasticsearch/src/opentelemetry/instrumentation/elasticsearch/version.py b/instrumentation/opentelemetry-instrumentation-elasticsearch/src/opentelemetry/instrumentation/elasticsearch/version.py
index 4d21fcb843..ee5a6342e7 100644
--- a/instrumentation/opentelemetry-instrumentation-elasticsearch/src/opentelemetry/instrumentation/elasticsearch/version.py
+++ b/instrumentation/opentelemetry-instrumentation-elasticsearch/src/opentelemetry/instrumentation/elasticsearch/version.py
@@ -12,4 +12,4 @@
# See the License for the specific language governing permissions and
# limitations under the License.
-__version__ = "0.48b0.dev"
+__version__ = "0.49b0.dev"
diff --git a/instrumentation/opentelemetry-instrumentation-falcon/pyproject.toml b/instrumentation/opentelemetry-instrumentation-falcon/pyproject.toml
index 6f505f60ae..f118ff4296 100644
--- a/instrumentation/opentelemetry-instrumentation-falcon/pyproject.toml
+++ b/instrumentation/opentelemetry-instrumentation-falcon/pyproject.toml
@@ -26,10 +26,10 @@ classifiers = [
]
dependencies = [
"opentelemetry-api ~= 1.12",
- "opentelemetry-instrumentation == 0.48b0.dev",
- "opentelemetry-instrumentation-wsgi == 0.48b0.dev",
- "opentelemetry-semantic-conventions == 0.48b0.dev",
- "opentelemetry-util-http == 0.48b0.dev",
+ "opentelemetry-instrumentation == 0.49b0.dev",
+ "opentelemetry-instrumentation-wsgi == 0.49b0.dev",
+ "opentelemetry-semantic-conventions == 0.49b0.dev",
+ "opentelemetry-util-http == 0.49b0.dev",
"packaging >= 20.0",
]
diff --git a/instrumentation/opentelemetry-instrumentation-falcon/src/opentelemetry/instrumentation/falcon/version.py b/instrumentation/opentelemetry-instrumentation-falcon/src/opentelemetry/instrumentation/falcon/version.py
index 4d21fcb843..ee5a6342e7 100644
--- a/instrumentation/opentelemetry-instrumentation-falcon/src/opentelemetry/instrumentation/falcon/version.py
+++ b/instrumentation/opentelemetry-instrumentation-falcon/src/opentelemetry/instrumentation/falcon/version.py
@@ -12,4 +12,4 @@
# See the License for the specific language governing permissions and
# limitations under the License.
-__version__ = "0.48b0.dev"
+__version__ = "0.49b0.dev"
diff --git a/instrumentation/opentelemetry-instrumentation-fastapi/pyproject.toml b/instrumentation/opentelemetry-instrumentation-fastapi/pyproject.toml
index 3017dc040a..89f6602e86 100644
--- a/instrumentation/opentelemetry-instrumentation-fastapi/pyproject.toml
+++ b/instrumentation/opentelemetry-instrumentation-fastapi/pyproject.toml
@@ -26,10 +26,10 @@ classifiers = [
]
dependencies = [
"opentelemetry-api ~= 1.12",
- "opentelemetry-instrumentation == 0.48b0.dev",
- "opentelemetry-instrumentation-asgi == 0.48b0.dev",
- "opentelemetry-semantic-conventions == 0.48b0.dev",
- "opentelemetry-util-http == 0.48b0.dev",
+ "opentelemetry-instrumentation == 0.49b0.dev",
+ "opentelemetry-instrumentation-asgi == 0.49b0.dev",
+ "opentelemetry-semantic-conventions == 0.49b0.dev",
+ "opentelemetry-util-http == 0.49b0.dev",
]
[project.optional-dependencies]
diff --git a/instrumentation/opentelemetry-instrumentation-fastapi/src/opentelemetry/instrumentation/fastapi/version.py b/instrumentation/opentelemetry-instrumentation-fastapi/src/opentelemetry/instrumentation/fastapi/version.py
index 4d21fcb843..ee5a6342e7 100644
--- a/instrumentation/opentelemetry-instrumentation-fastapi/src/opentelemetry/instrumentation/fastapi/version.py
+++ b/instrumentation/opentelemetry-instrumentation-fastapi/src/opentelemetry/instrumentation/fastapi/version.py
@@ -12,4 +12,4 @@
# See the License for the specific language governing permissions and
# limitations under the License.
-__version__ = "0.48b0.dev"
+__version__ = "0.49b0.dev"
diff --git a/instrumentation/opentelemetry-instrumentation-flask/pyproject.toml b/instrumentation/opentelemetry-instrumentation-flask/pyproject.toml
index ffafdbacc6..0e74ca331f 100644
--- a/instrumentation/opentelemetry-instrumentation-flask/pyproject.toml
+++ b/instrumentation/opentelemetry-instrumentation-flask/pyproject.toml
@@ -26,10 +26,10 @@ classifiers = [
]
dependencies = [
"opentelemetry-api ~= 1.12",
- "opentelemetry-instrumentation == 0.48b0.dev",
- "opentelemetry-instrumentation-wsgi == 0.48b0.dev",
- "opentelemetry-semantic-conventions == 0.48b0.dev",
- "opentelemetry-util-http == 0.48b0.dev",
+ "opentelemetry-instrumentation == 0.49b0.dev",
+ "opentelemetry-instrumentation-wsgi == 0.49b0.dev",
+ "opentelemetry-semantic-conventions == 0.49b0.dev",
+ "opentelemetry-util-http == 0.49b0.dev",
"packaging >= 21.0",
"importlib-metadata >= 4.0",
]
diff --git a/instrumentation/opentelemetry-instrumentation-flask/src/opentelemetry/instrumentation/flask/version.py b/instrumentation/opentelemetry-instrumentation-flask/src/opentelemetry/instrumentation/flask/version.py
index 4d21fcb843..ee5a6342e7 100644
--- a/instrumentation/opentelemetry-instrumentation-flask/src/opentelemetry/instrumentation/flask/version.py
+++ b/instrumentation/opentelemetry-instrumentation-flask/src/opentelemetry/instrumentation/flask/version.py
@@ -12,4 +12,4 @@
# See the License for the specific language governing permissions and
# limitations under the License.
-__version__ = "0.48b0.dev"
+__version__ = "0.49b0.dev"
diff --git a/instrumentation/opentelemetry-instrumentation-grpc/pyproject.toml b/instrumentation/opentelemetry-instrumentation-grpc/pyproject.toml
index d0a7d54298..e1956aeeea 100644
--- a/instrumentation/opentelemetry-instrumentation-grpc/pyproject.toml
+++ b/instrumentation/opentelemetry-instrumentation-grpc/pyproject.toml
@@ -26,8 +26,8 @@ classifiers = [
]
dependencies = [
"opentelemetry-api ~= 1.12",
- "opentelemetry-instrumentation == 0.48b0.dev",
- "opentelemetry-semantic-conventions == 0.48b0.dev",
+ "opentelemetry-instrumentation == 0.49b0.dev",
+ "opentelemetry-semantic-conventions == 0.49b0.dev",
"wrapt >= 1.0.0, < 2.0.0",
]
diff --git a/instrumentation/opentelemetry-instrumentation-grpc/src/opentelemetry/instrumentation/grpc/version.py b/instrumentation/opentelemetry-instrumentation-grpc/src/opentelemetry/instrumentation/grpc/version.py
index 4d21fcb843..ee5a6342e7 100644
--- a/instrumentation/opentelemetry-instrumentation-grpc/src/opentelemetry/instrumentation/grpc/version.py
+++ b/instrumentation/opentelemetry-instrumentation-grpc/src/opentelemetry/instrumentation/grpc/version.py
@@ -12,4 +12,4 @@
# See the License for the specific language governing permissions and
# limitations under the License.
-__version__ = "0.48b0.dev"
+__version__ = "0.49b0.dev"
diff --git a/instrumentation/opentelemetry-instrumentation-httpx/pyproject.toml b/instrumentation/opentelemetry-instrumentation-httpx/pyproject.toml
index 5e4629e281..599091716b 100644
--- a/instrumentation/opentelemetry-instrumentation-httpx/pyproject.toml
+++ b/instrumentation/opentelemetry-instrumentation-httpx/pyproject.toml
@@ -26,9 +26,9 @@ classifiers = [
]
dependencies = [
"opentelemetry-api ~= 1.12",
- "opentelemetry-instrumentation == 0.48b0.dev",
- "opentelemetry-semantic-conventions == 0.48b0.dev",
- "opentelemetry-util-http == 0.48b0.dev",
+ "opentelemetry-instrumentation == 0.49b0.dev",
+ "opentelemetry-semantic-conventions == 0.49b0.dev",
+ "opentelemetry-util-http == 0.49b0.dev",
]
[project.optional-dependencies]
diff --git a/instrumentation/opentelemetry-instrumentation-httpx/src/opentelemetry/instrumentation/httpx/version.py b/instrumentation/opentelemetry-instrumentation-httpx/src/opentelemetry/instrumentation/httpx/version.py
index 4d21fcb843..ee5a6342e7 100644
--- a/instrumentation/opentelemetry-instrumentation-httpx/src/opentelemetry/instrumentation/httpx/version.py
+++ b/instrumentation/opentelemetry-instrumentation-httpx/src/opentelemetry/instrumentation/httpx/version.py
@@ -12,4 +12,4 @@
# See the License for the specific language governing permissions and
# limitations under the License.
-__version__ = "0.48b0.dev"
+__version__ = "0.49b0.dev"
diff --git a/instrumentation/opentelemetry-instrumentation-jinja2/pyproject.toml b/instrumentation/opentelemetry-instrumentation-jinja2/pyproject.toml
index f74b8ca488..40159c3485 100644
--- a/instrumentation/opentelemetry-instrumentation-jinja2/pyproject.toml
+++ b/instrumentation/opentelemetry-instrumentation-jinja2/pyproject.toml
@@ -26,7 +26,7 @@ classifiers = [
]
dependencies = [
"opentelemetry-api ~= 1.12",
- "opentelemetry-instrumentation == 0.48b0.dev",
+ "opentelemetry-instrumentation == 0.49b0.dev",
"wrapt >= 1.0.0, < 2.0.0",
]
diff --git a/instrumentation/opentelemetry-instrumentation-jinja2/src/opentelemetry/instrumentation/jinja2/version.py b/instrumentation/opentelemetry-instrumentation-jinja2/src/opentelemetry/instrumentation/jinja2/version.py
index 4d21fcb843..ee5a6342e7 100644
--- a/instrumentation/opentelemetry-instrumentation-jinja2/src/opentelemetry/instrumentation/jinja2/version.py
+++ b/instrumentation/opentelemetry-instrumentation-jinja2/src/opentelemetry/instrumentation/jinja2/version.py
@@ -12,4 +12,4 @@
# See the License for the specific language governing permissions and
# limitations under the License.
-__version__ = "0.48b0.dev"
+__version__ = "0.49b0.dev"
diff --git a/instrumentation/opentelemetry-instrumentation-kafka-python/pyproject.toml b/instrumentation/opentelemetry-instrumentation-kafka-python/pyproject.toml
index c256c71b94..d47672fa07 100644
--- a/instrumentation/opentelemetry-instrumentation-kafka-python/pyproject.toml
+++ b/instrumentation/opentelemetry-instrumentation-kafka-python/pyproject.toml
@@ -26,8 +26,8 @@ classifiers = [
]
dependencies = [
"opentelemetry-api ~= 1.5",
- "opentelemetry-instrumentation == 0.48b0.dev",
- "opentelemetry-semantic-conventions == 0.48b0.dev",
+ "opentelemetry-instrumentation == 0.49b0.dev",
+ "opentelemetry-semantic-conventions == 0.49b0.dev",
]
[project.optional-dependencies]
diff --git a/instrumentation/opentelemetry-instrumentation-kafka-python/src/opentelemetry/instrumentation/kafka/version.py b/instrumentation/opentelemetry-instrumentation-kafka-python/src/opentelemetry/instrumentation/kafka/version.py
index 4d21fcb843..ee5a6342e7 100644
--- a/instrumentation/opentelemetry-instrumentation-kafka-python/src/opentelemetry/instrumentation/kafka/version.py
+++ b/instrumentation/opentelemetry-instrumentation-kafka-python/src/opentelemetry/instrumentation/kafka/version.py
@@ -12,4 +12,4 @@
# See the License for the specific language governing permissions and
# limitations under the License.
-__version__ = "0.48b0.dev"
+__version__ = "0.49b0.dev"
diff --git a/instrumentation/opentelemetry-instrumentation-logging/pyproject.toml b/instrumentation/opentelemetry-instrumentation-logging/pyproject.toml
index 2c1b2ad897..62656bea22 100644
--- a/instrumentation/opentelemetry-instrumentation-logging/pyproject.toml
+++ b/instrumentation/opentelemetry-instrumentation-logging/pyproject.toml
@@ -26,7 +26,7 @@ classifiers = [
]
dependencies = [
"opentelemetry-api ~= 1.12",
- "opentelemetry-instrumentation == 0.48b0.dev",
+ "opentelemetry-instrumentation == 0.49b0.dev",
]
[project.optional-dependencies]
diff --git a/instrumentation/opentelemetry-instrumentation-logging/src/opentelemetry/instrumentation/logging/version.py b/instrumentation/opentelemetry-instrumentation-logging/src/opentelemetry/instrumentation/logging/version.py
index e0bef4b1e3..79e27849a4 100644
--- a/instrumentation/opentelemetry-instrumentation-logging/src/opentelemetry/instrumentation/logging/version.py
+++ b/instrumentation/opentelemetry-instrumentation-logging/src/opentelemetry/instrumentation/logging/version.py
@@ -12,6 +12,6 @@
# See the License for the specific language governing permissions and
# limitations under the License.
-__version__ = "0.48b0.dev"
+__version__ = "0.49b0.dev"
_instruments = tuple()
diff --git a/instrumentation/opentelemetry-instrumentation-mysql/pyproject.toml b/instrumentation/opentelemetry-instrumentation-mysql/pyproject.toml
index 3c7d0c9166..629ab5325e 100644
--- a/instrumentation/opentelemetry-instrumentation-mysql/pyproject.toml
+++ b/instrumentation/opentelemetry-instrumentation-mysql/pyproject.toml
@@ -26,8 +26,8 @@ classifiers = [
]
dependencies = [
"opentelemetry-api ~= 1.12",
- "opentelemetry-instrumentation == 0.48b0.dev",
- "opentelemetry-instrumentation-dbapi == 0.48b0.dev",
+ "opentelemetry-instrumentation == 0.49b0.dev",
+ "opentelemetry-instrumentation-dbapi == 0.49b0.dev",
]
[project.optional-dependencies]
diff --git a/instrumentation/opentelemetry-instrumentation-mysql/src/opentelemetry/instrumentation/mysql/version.py b/instrumentation/opentelemetry-instrumentation-mysql/src/opentelemetry/instrumentation/mysql/version.py
index 4d21fcb843..ee5a6342e7 100644
--- a/instrumentation/opentelemetry-instrumentation-mysql/src/opentelemetry/instrumentation/mysql/version.py
+++ b/instrumentation/opentelemetry-instrumentation-mysql/src/opentelemetry/instrumentation/mysql/version.py
@@ -12,4 +12,4 @@
# See the License for the specific language governing permissions and
# limitations under the License.
-__version__ = "0.48b0.dev"
+__version__ = "0.49b0.dev"
diff --git a/instrumentation/opentelemetry-instrumentation-mysqlclient/pyproject.toml b/instrumentation/opentelemetry-instrumentation-mysqlclient/pyproject.toml
index 0ede691e36..0cc4553384 100644
--- a/instrumentation/opentelemetry-instrumentation-mysqlclient/pyproject.toml
+++ b/instrumentation/opentelemetry-instrumentation-mysqlclient/pyproject.toml
@@ -26,8 +26,8 @@ classifiers = [
]
dependencies = [
"opentelemetry-api ~= 1.12",
- "opentelemetry-instrumentation == 0.48b0.dev",
- "opentelemetry-instrumentation-dbapi == 0.48b0.dev",
+ "opentelemetry-instrumentation == 0.49b0.dev",
+ "opentelemetry-instrumentation-dbapi == 0.49b0.dev",
]
[project.optional-dependencies]
diff --git a/instrumentation/opentelemetry-instrumentation-mysqlclient/src/opentelemetry/instrumentation/mysqlclient/version.py b/instrumentation/opentelemetry-instrumentation-mysqlclient/src/opentelemetry/instrumentation/mysqlclient/version.py
index 4d21fcb843..ee5a6342e7 100644
--- a/instrumentation/opentelemetry-instrumentation-mysqlclient/src/opentelemetry/instrumentation/mysqlclient/version.py
+++ b/instrumentation/opentelemetry-instrumentation-mysqlclient/src/opentelemetry/instrumentation/mysqlclient/version.py
@@ -12,4 +12,4 @@
# See the License for the specific language governing permissions and
# limitations under the License.
-__version__ = "0.48b0.dev"
+__version__ = "0.49b0.dev"
diff --git a/instrumentation/opentelemetry-instrumentation-pika/pyproject.toml b/instrumentation/opentelemetry-instrumentation-pika/pyproject.toml
index 145439b242..bc01323ee4 100644
--- a/instrumentation/opentelemetry-instrumentation-pika/pyproject.toml
+++ b/instrumentation/opentelemetry-instrumentation-pika/pyproject.toml
@@ -25,7 +25,7 @@ classifiers = [
"Programming Language :: Python :: 3.12",
]
dependencies = [
- "opentelemetry-instrumentation == 0.48b0.dev",
+ "opentelemetry-instrumentation == 0.49b0.dev",
"opentelemetry-api ~= 1.5",
"packaging >= 20.0",
"wrapt >= 1.0.0, < 2.0.0",
diff --git a/instrumentation/opentelemetry-instrumentation-pika/src/opentelemetry/instrumentation/pika/version.py b/instrumentation/opentelemetry-instrumentation-pika/src/opentelemetry/instrumentation/pika/version.py
index 4d21fcb843..ee5a6342e7 100644
--- a/instrumentation/opentelemetry-instrumentation-pika/src/opentelemetry/instrumentation/pika/version.py
+++ b/instrumentation/opentelemetry-instrumentation-pika/src/opentelemetry/instrumentation/pika/version.py
@@ -12,4 +12,4 @@
# See the License for the specific language governing permissions and
# limitations under the License.
-__version__ = "0.48b0.dev"
+__version__ = "0.49b0.dev"
diff --git a/instrumentation/opentelemetry-instrumentation-psycopg/pyproject.toml b/instrumentation/opentelemetry-instrumentation-psycopg/pyproject.toml
index 717257821d..513064ae7f 100644
--- a/instrumentation/opentelemetry-instrumentation-psycopg/pyproject.toml
+++ b/instrumentation/opentelemetry-instrumentation-psycopg/pyproject.toml
@@ -27,8 +27,8 @@ classifiers = [
]
dependencies = [
"opentelemetry-api ~= 1.12",
- "opentelemetry-instrumentation == 0.48b0.dev",
- "opentelemetry-instrumentation-dbapi == 0.48b0.dev",
+ "opentelemetry-instrumentation == 0.49b0.dev",
+ "opentelemetry-instrumentation-dbapi == 0.49b0.dev",
]
[project.optional-dependencies]
diff --git a/instrumentation/opentelemetry-instrumentation-psycopg/src/opentelemetry/instrumentation/psycopg/version.py b/instrumentation/opentelemetry-instrumentation-psycopg/src/opentelemetry/instrumentation/psycopg/version.py
index 4d21fcb843..ee5a6342e7 100644
--- a/instrumentation/opentelemetry-instrumentation-psycopg/src/opentelemetry/instrumentation/psycopg/version.py
+++ b/instrumentation/opentelemetry-instrumentation-psycopg/src/opentelemetry/instrumentation/psycopg/version.py
@@ -12,4 +12,4 @@
# See the License for the specific language governing permissions and
# limitations under the License.
-__version__ = "0.48b0.dev"
+__version__ = "0.49b0.dev"
diff --git a/instrumentation/opentelemetry-instrumentation-psycopg2/pyproject.toml b/instrumentation/opentelemetry-instrumentation-psycopg2/pyproject.toml
index 7db83dcc5c..592c15b4db 100644
--- a/instrumentation/opentelemetry-instrumentation-psycopg2/pyproject.toml
+++ b/instrumentation/opentelemetry-instrumentation-psycopg2/pyproject.toml
@@ -26,8 +26,8 @@ classifiers = [
]
dependencies = [
"opentelemetry-api ~= 1.12",
- "opentelemetry-instrumentation == 0.48b0.dev",
- "opentelemetry-instrumentation-dbapi == 0.48b0.dev",
+ "opentelemetry-instrumentation == 0.49b0.dev",
+ "opentelemetry-instrumentation-dbapi == 0.49b0.dev",
]
[project.optional-dependencies]
diff --git a/instrumentation/opentelemetry-instrumentation-psycopg2/src/opentelemetry/instrumentation/psycopg2/version.py b/instrumentation/opentelemetry-instrumentation-psycopg2/src/opentelemetry/instrumentation/psycopg2/version.py
index 4d21fcb843..ee5a6342e7 100644
--- a/instrumentation/opentelemetry-instrumentation-psycopg2/src/opentelemetry/instrumentation/psycopg2/version.py
+++ b/instrumentation/opentelemetry-instrumentation-psycopg2/src/opentelemetry/instrumentation/psycopg2/version.py
@@ -12,4 +12,4 @@
# See the License for the specific language governing permissions and
# limitations under the License.
-__version__ = "0.48b0.dev"
+__version__ = "0.49b0.dev"
diff --git a/instrumentation/opentelemetry-instrumentation-pymemcache/pyproject.toml b/instrumentation/opentelemetry-instrumentation-pymemcache/pyproject.toml
index 47df236c42..c20ffd3dee 100644
--- a/instrumentation/opentelemetry-instrumentation-pymemcache/pyproject.toml
+++ b/instrumentation/opentelemetry-instrumentation-pymemcache/pyproject.toml
@@ -26,8 +26,8 @@ classifiers = [
]
dependencies = [
"opentelemetry-api ~= 1.12",
- "opentelemetry-instrumentation == 0.48b0.dev",
- "opentelemetry-semantic-conventions == 0.48b0.dev",
+ "opentelemetry-instrumentation == 0.49b0.dev",
+ "opentelemetry-semantic-conventions == 0.49b0.dev",
"wrapt >= 1.0.0, < 2.0.0",
]
diff --git a/instrumentation/opentelemetry-instrumentation-pymemcache/src/opentelemetry/instrumentation/pymemcache/version.py b/instrumentation/opentelemetry-instrumentation-pymemcache/src/opentelemetry/instrumentation/pymemcache/version.py
index 4d21fcb843..ee5a6342e7 100644
--- a/instrumentation/opentelemetry-instrumentation-pymemcache/src/opentelemetry/instrumentation/pymemcache/version.py
+++ b/instrumentation/opentelemetry-instrumentation-pymemcache/src/opentelemetry/instrumentation/pymemcache/version.py
@@ -12,4 +12,4 @@
# See the License for the specific language governing permissions and
# limitations under the License.
-__version__ = "0.48b0.dev"
+__version__ = "0.49b0.dev"
diff --git a/instrumentation/opentelemetry-instrumentation-pymongo/pyproject.toml b/instrumentation/opentelemetry-instrumentation-pymongo/pyproject.toml
index ccd75ffeaa..61f4fd2b72 100644
--- a/instrumentation/opentelemetry-instrumentation-pymongo/pyproject.toml
+++ b/instrumentation/opentelemetry-instrumentation-pymongo/pyproject.toml
@@ -26,8 +26,8 @@ classifiers = [
]
dependencies = [
"opentelemetry-api ~= 1.12",
- "opentelemetry-instrumentation == 0.48b0.dev",
- "opentelemetry-semantic-conventions == 0.48b0.dev",
+ "opentelemetry-instrumentation == 0.49b0.dev",
+ "opentelemetry-semantic-conventions == 0.49b0.dev",
]
[project.optional-dependencies]
diff --git a/instrumentation/opentelemetry-instrumentation-pymongo/src/opentelemetry/instrumentation/pymongo/version.py b/instrumentation/opentelemetry-instrumentation-pymongo/src/opentelemetry/instrumentation/pymongo/version.py
index 4d21fcb843..ee5a6342e7 100644
--- a/instrumentation/opentelemetry-instrumentation-pymongo/src/opentelemetry/instrumentation/pymongo/version.py
+++ b/instrumentation/opentelemetry-instrumentation-pymongo/src/opentelemetry/instrumentation/pymongo/version.py
@@ -12,4 +12,4 @@
# See the License for the specific language governing permissions and
# limitations under the License.
-__version__ = "0.48b0.dev"
+__version__ = "0.49b0.dev"
diff --git a/instrumentation/opentelemetry-instrumentation-pymysql/pyproject.toml b/instrumentation/opentelemetry-instrumentation-pymysql/pyproject.toml
index 08ee94fd9e..9e1bc1a881 100644
--- a/instrumentation/opentelemetry-instrumentation-pymysql/pyproject.toml
+++ b/instrumentation/opentelemetry-instrumentation-pymysql/pyproject.toml
@@ -26,8 +26,8 @@ classifiers = [
]
dependencies = [
"opentelemetry-api ~= 1.12",
- "opentelemetry-instrumentation == 0.48b0.dev",
- "opentelemetry-instrumentation-dbapi == 0.48b0.dev",
+ "opentelemetry-instrumentation == 0.49b0.dev",
+ "opentelemetry-instrumentation-dbapi == 0.49b0.dev",
]
[project.optional-dependencies]
diff --git a/instrumentation/opentelemetry-instrumentation-pymysql/src/opentelemetry/instrumentation/pymysql/version.py b/instrumentation/opentelemetry-instrumentation-pymysql/src/opentelemetry/instrumentation/pymysql/version.py
index 4d21fcb843..ee5a6342e7 100644
--- a/instrumentation/opentelemetry-instrumentation-pymysql/src/opentelemetry/instrumentation/pymysql/version.py
+++ b/instrumentation/opentelemetry-instrumentation-pymysql/src/opentelemetry/instrumentation/pymysql/version.py
@@ -12,4 +12,4 @@
# See the License for the specific language governing permissions and
# limitations under the License.
-__version__ = "0.48b0.dev"
+__version__ = "0.49b0.dev"
diff --git a/instrumentation/opentelemetry-instrumentation-pyramid/pyproject.toml b/instrumentation/opentelemetry-instrumentation-pyramid/pyproject.toml
index 9da43f444c..2a559e6c60 100644
--- a/instrumentation/opentelemetry-instrumentation-pyramid/pyproject.toml
+++ b/instrumentation/opentelemetry-instrumentation-pyramid/pyproject.toml
@@ -26,10 +26,10 @@ classifiers = [
]
dependencies = [
"opentelemetry-api ~= 1.12",
- "opentelemetry-instrumentation == 0.48b0.dev",
- "opentelemetry-instrumentation-wsgi == 0.48b0.dev",
- "opentelemetry-semantic-conventions == 0.48b0.dev",
- "opentelemetry-util-http == 0.48b0.dev",
+ "opentelemetry-instrumentation == 0.49b0.dev",
+ "opentelemetry-instrumentation-wsgi == 0.49b0.dev",
+ "opentelemetry-semantic-conventions == 0.49b0.dev",
+ "opentelemetry-util-http == 0.49b0.dev",
"wrapt >= 1.0.0, < 2.0.0",
]
diff --git a/instrumentation/opentelemetry-instrumentation-pyramid/src/opentelemetry/instrumentation/pyramid/version.py b/instrumentation/opentelemetry-instrumentation-pyramid/src/opentelemetry/instrumentation/pyramid/version.py
index 4d21fcb843..ee5a6342e7 100644
--- a/instrumentation/opentelemetry-instrumentation-pyramid/src/opentelemetry/instrumentation/pyramid/version.py
+++ b/instrumentation/opentelemetry-instrumentation-pyramid/src/opentelemetry/instrumentation/pyramid/version.py
@@ -12,4 +12,4 @@
# See the License for the specific language governing permissions and
# limitations under the License.
-__version__ = "0.48b0.dev"
+__version__ = "0.49b0.dev"
diff --git a/instrumentation/opentelemetry-instrumentation-redis/pyproject.toml b/instrumentation/opentelemetry-instrumentation-redis/pyproject.toml
index d39bda20a5..c262363fab 100644
--- a/instrumentation/opentelemetry-instrumentation-redis/pyproject.toml
+++ b/instrumentation/opentelemetry-instrumentation-redis/pyproject.toml
@@ -26,8 +26,8 @@ classifiers = [
]
dependencies = [
"opentelemetry-api ~= 1.12",
- "opentelemetry-instrumentation == 0.48b0.dev",
- "opentelemetry-semantic-conventions == 0.48b0.dev",
+ "opentelemetry-instrumentation == 0.49b0.dev",
+ "opentelemetry-semantic-conventions == 0.49b0.dev",
"wrapt >= 1.12.1",
]
diff --git a/instrumentation/opentelemetry-instrumentation-redis/src/opentelemetry/instrumentation/redis/version.py b/instrumentation/opentelemetry-instrumentation-redis/src/opentelemetry/instrumentation/redis/version.py
index 4d21fcb843..ee5a6342e7 100644
--- a/instrumentation/opentelemetry-instrumentation-redis/src/opentelemetry/instrumentation/redis/version.py
+++ b/instrumentation/opentelemetry-instrumentation-redis/src/opentelemetry/instrumentation/redis/version.py
@@ -12,4 +12,4 @@
# See the License for the specific language governing permissions and
# limitations under the License.
-__version__ = "0.48b0.dev"
+__version__ = "0.49b0.dev"
diff --git a/instrumentation/opentelemetry-instrumentation-remoulade/pyproject.toml b/instrumentation/opentelemetry-instrumentation-remoulade/pyproject.toml
index 8b2b3679a9..7f3041b887 100644
--- a/instrumentation/opentelemetry-instrumentation-remoulade/pyproject.toml
+++ b/instrumentation/opentelemetry-instrumentation-remoulade/pyproject.toml
@@ -26,8 +26,8 @@ classifiers = [
]
dependencies = [
"opentelemetry-api ~= 1.12",
- "opentelemetry-instrumentation == 0.48b0.dev",
- "opentelemetry-semantic-conventions == 0.48b0.dev",
+ "opentelemetry-instrumentation == 0.49b0.dev",
+ "opentelemetry-semantic-conventions == 0.49b0.dev",
]
[project.optional-dependencies]
diff --git a/instrumentation/opentelemetry-instrumentation-remoulade/src/opentelemetry/instrumentation/remoulade/version.py b/instrumentation/opentelemetry-instrumentation-remoulade/src/opentelemetry/instrumentation/remoulade/version.py
index 4d21fcb843..ee5a6342e7 100644
--- a/instrumentation/opentelemetry-instrumentation-remoulade/src/opentelemetry/instrumentation/remoulade/version.py
+++ b/instrumentation/opentelemetry-instrumentation-remoulade/src/opentelemetry/instrumentation/remoulade/version.py
@@ -12,4 +12,4 @@
# See the License for the specific language governing permissions and
# limitations under the License.
-__version__ = "0.48b0.dev"
+__version__ = "0.49b0.dev"
diff --git a/instrumentation/opentelemetry-instrumentation-requests/pyproject.toml b/instrumentation/opentelemetry-instrumentation-requests/pyproject.toml
index 88996d2540..dafe3b4d3a 100644
--- a/instrumentation/opentelemetry-instrumentation-requests/pyproject.toml
+++ b/instrumentation/opentelemetry-instrumentation-requests/pyproject.toml
@@ -26,9 +26,9 @@ classifiers = [
]
dependencies = [
"opentelemetry-api ~= 1.12",
- "opentelemetry-instrumentation == 0.48b0.dev",
- "opentelemetry-semantic-conventions == 0.48b0.dev",
- "opentelemetry-util-http == 0.48b0.dev",
+ "opentelemetry-instrumentation == 0.49b0.dev",
+ "opentelemetry-semantic-conventions == 0.49b0.dev",
+ "opentelemetry-util-http == 0.49b0.dev",
]
[project.optional-dependencies]
diff --git a/instrumentation/opentelemetry-instrumentation-requests/src/opentelemetry/instrumentation/requests/version.py b/instrumentation/opentelemetry-instrumentation-requests/src/opentelemetry/instrumentation/requests/version.py
index 4d21fcb843..ee5a6342e7 100644
--- a/instrumentation/opentelemetry-instrumentation-requests/src/opentelemetry/instrumentation/requests/version.py
+++ b/instrumentation/opentelemetry-instrumentation-requests/src/opentelemetry/instrumentation/requests/version.py
@@ -12,4 +12,4 @@
# See the License for the specific language governing permissions and
# limitations under the License.
-__version__ = "0.48b0.dev"
+__version__ = "0.49b0.dev"
diff --git a/instrumentation/opentelemetry-instrumentation-sqlalchemy/pyproject.toml b/instrumentation/opentelemetry-instrumentation-sqlalchemy/pyproject.toml
index 21021fb590..d6cc3f71d9 100644
--- a/instrumentation/opentelemetry-instrumentation-sqlalchemy/pyproject.toml
+++ b/instrumentation/opentelemetry-instrumentation-sqlalchemy/pyproject.toml
@@ -26,8 +26,8 @@ classifiers = [
]
dependencies = [
"opentelemetry-api ~= 1.12",
- "opentelemetry-instrumentation == 0.48b0.dev",
- "opentelemetry-semantic-conventions == 0.48b0.dev",
+ "opentelemetry-instrumentation == 0.49b0.dev",
+ "opentelemetry-semantic-conventions == 0.49b0.dev",
"packaging >= 21.0",
"wrapt >= 1.11.2",
]
diff --git a/instrumentation/opentelemetry-instrumentation-sqlalchemy/src/opentelemetry/instrumentation/sqlalchemy/version.py b/instrumentation/opentelemetry-instrumentation-sqlalchemy/src/opentelemetry/instrumentation/sqlalchemy/version.py
index 4d21fcb843..ee5a6342e7 100644
--- a/instrumentation/opentelemetry-instrumentation-sqlalchemy/src/opentelemetry/instrumentation/sqlalchemy/version.py
+++ b/instrumentation/opentelemetry-instrumentation-sqlalchemy/src/opentelemetry/instrumentation/sqlalchemy/version.py
@@ -12,4 +12,4 @@
# See the License for the specific language governing permissions and
# limitations under the License.
-__version__ = "0.48b0.dev"
+__version__ = "0.49b0.dev"
diff --git a/instrumentation/opentelemetry-instrumentation-sqlite3/pyproject.toml b/instrumentation/opentelemetry-instrumentation-sqlite3/pyproject.toml
index e86fb99235..60ec47b16e 100644
--- a/instrumentation/opentelemetry-instrumentation-sqlite3/pyproject.toml
+++ b/instrumentation/opentelemetry-instrumentation-sqlite3/pyproject.toml
@@ -26,8 +26,8 @@ classifiers = [
]
dependencies = [
"opentelemetry-api ~= 1.12",
- "opentelemetry-instrumentation == 0.48b0.dev",
- "opentelemetry-instrumentation-dbapi == 0.48b0.dev",
+ "opentelemetry-instrumentation == 0.49b0.dev",
+ "opentelemetry-instrumentation-dbapi == 0.49b0.dev",
]
[project.optional-dependencies]
diff --git a/instrumentation/opentelemetry-instrumentation-sqlite3/src/opentelemetry/instrumentation/sqlite3/version.py b/instrumentation/opentelemetry-instrumentation-sqlite3/src/opentelemetry/instrumentation/sqlite3/version.py
index e0bef4b1e3..79e27849a4 100644
--- a/instrumentation/opentelemetry-instrumentation-sqlite3/src/opentelemetry/instrumentation/sqlite3/version.py
+++ b/instrumentation/opentelemetry-instrumentation-sqlite3/src/opentelemetry/instrumentation/sqlite3/version.py
@@ -12,6 +12,6 @@
# See the License for the specific language governing permissions and
# limitations under the License.
-__version__ = "0.48b0.dev"
+__version__ = "0.49b0.dev"
_instruments = tuple()
diff --git a/instrumentation/opentelemetry-instrumentation-starlette/pyproject.toml b/instrumentation/opentelemetry-instrumentation-starlette/pyproject.toml
index 6e6d370b53..9cdd968ca0 100644
--- a/instrumentation/opentelemetry-instrumentation-starlette/pyproject.toml
+++ b/instrumentation/opentelemetry-instrumentation-starlette/pyproject.toml
@@ -26,10 +26,10 @@ classifiers = [
]
dependencies = [
"opentelemetry-api ~= 1.12",
- "opentelemetry-instrumentation == 0.48b0.dev",
- "opentelemetry-instrumentation-asgi == 0.48b0.dev",
- "opentelemetry-semantic-conventions == 0.48b0.dev",
- "opentelemetry-util-http == 0.48b0.dev",
+ "opentelemetry-instrumentation == 0.49b0.dev",
+ "opentelemetry-instrumentation-asgi == 0.49b0.dev",
+ "opentelemetry-semantic-conventions == 0.49b0.dev",
+ "opentelemetry-util-http == 0.49b0.dev",
]
[project.optional-dependencies]
diff --git a/instrumentation/opentelemetry-instrumentation-starlette/src/opentelemetry/instrumentation/starlette/version.py b/instrumentation/opentelemetry-instrumentation-starlette/src/opentelemetry/instrumentation/starlette/version.py
index 4d21fcb843..ee5a6342e7 100644
--- a/instrumentation/opentelemetry-instrumentation-starlette/src/opentelemetry/instrumentation/starlette/version.py
+++ b/instrumentation/opentelemetry-instrumentation-starlette/src/opentelemetry/instrumentation/starlette/version.py
@@ -12,4 +12,4 @@
# See the License for the specific language governing permissions and
# limitations under the License.
-__version__ = "0.48b0.dev"
+__version__ = "0.49b0.dev"
diff --git a/instrumentation/opentelemetry-instrumentation-system-metrics/pyproject.toml b/instrumentation/opentelemetry-instrumentation-system-metrics/pyproject.toml
index 6a1e83912f..a405c668f7 100644
--- a/instrumentation/opentelemetry-instrumentation-system-metrics/pyproject.toml
+++ b/instrumentation/opentelemetry-instrumentation-system-metrics/pyproject.toml
@@ -25,7 +25,7 @@ classifiers = [
"Programming Language :: Python :: 3.12",
]
dependencies = [
- "opentelemetry-instrumentation == 0.48b0.dev",
+ "opentelemetry-instrumentation == 0.49b0.dev",
"opentelemetry-api ~= 1.11",
"psutil >= 5.9.0, < 7",
]
diff --git a/instrumentation/opentelemetry-instrumentation-system-metrics/src/opentelemetry/instrumentation/system_metrics/version.py b/instrumentation/opentelemetry-instrumentation-system-metrics/src/opentelemetry/instrumentation/system_metrics/version.py
index 4d21fcb843..ee5a6342e7 100644
--- a/instrumentation/opentelemetry-instrumentation-system-metrics/src/opentelemetry/instrumentation/system_metrics/version.py
+++ b/instrumentation/opentelemetry-instrumentation-system-metrics/src/opentelemetry/instrumentation/system_metrics/version.py
@@ -12,4 +12,4 @@
# See the License for the specific language governing permissions and
# limitations under the License.
-__version__ = "0.48b0.dev"
+__version__ = "0.49b0.dev"
diff --git a/instrumentation/opentelemetry-instrumentation-threading/pyproject.toml b/instrumentation/opentelemetry-instrumentation-threading/pyproject.toml
index 16088e7de3..43f92d2034 100644
--- a/instrumentation/opentelemetry-instrumentation-threading/pyproject.toml
+++ b/instrumentation/opentelemetry-instrumentation-threading/pyproject.toml
@@ -26,7 +26,7 @@ classifiers = [
]
dependencies = [
"opentelemetry-api ~= 1.12",
- "opentelemetry-instrumentation == 0.48b0.dev",
+ "opentelemetry-instrumentation == 0.49b0.dev",
"wrapt >= 1.0.0, < 2.0.0",
]
diff --git a/instrumentation/opentelemetry-instrumentation-threading/src/opentelemetry/instrumentation/threading/version.py b/instrumentation/opentelemetry-instrumentation-threading/src/opentelemetry/instrumentation/threading/version.py
index 4d21fcb843..ee5a6342e7 100644
--- a/instrumentation/opentelemetry-instrumentation-threading/src/opentelemetry/instrumentation/threading/version.py
+++ b/instrumentation/opentelemetry-instrumentation-threading/src/opentelemetry/instrumentation/threading/version.py
@@ -12,4 +12,4 @@
# See the License for the specific language governing permissions and
# limitations under the License.
-__version__ = "0.48b0.dev"
+__version__ = "0.49b0.dev"
diff --git a/instrumentation/opentelemetry-instrumentation-tornado/pyproject.toml b/instrumentation/opentelemetry-instrumentation-tornado/pyproject.toml
index 0096deb8fd..f3f9a4b4fc 100644
--- a/instrumentation/opentelemetry-instrumentation-tornado/pyproject.toml
+++ b/instrumentation/opentelemetry-instrumentation-tornado/pyproject.toml
@@ -25,9 +25,9 @@ classifiers = [
]
dependencies = [
"opentelemetry-api ~= 1.12",
- "opentelemetry-instrumentation == 0.48b0.dev",
- "opentelemetry-semantic-conventions == 0.48b0.dev",
- "opentelemetry-util-http == 0.48b0.dev",
+ "opentelemetry-instrumentation == 0.49b0.dev",
+ "opentelemetry-semantic-conventions == 0.49b0.dev",
+ "opentelemetry-util-http == 0.49b0.dev",
]
[project.optional-dependencies]
diff --git a/instrumentation/opentelemetry-instrumentation-tornado/src/opentelemetry/instrumentation/tornado/version.py b/instrumentation/opentelemetry-instrumentation-tornado/src/opentelemetry/instrumentation/tornado/version.py
index 4d21fcb843..ee5a6342e7 100644
--- a/instrumentation/opentelemetry-instrumentation-tornado/src/opentelemetry/instrumentation/tornado/version.py
+++ b/instrumentation/opentelemetry-instrumentation-tornado/src/opentelemetry/instrumentation/tornado/version.py
@@ -12,4 +12,4 @@
# See the License for the specific language governing permissions and
# limitations under the License.
-__version__ = "0.48b0.dev"
+__version__ = "0.49b0.dev"
diff --git a/instrumentation/opentelemetry-instrumentation-tortoiseorm/pyproject.toml b/instrumentation/opentelemetry-instrumentation-tortoiseorm/pyproject.toml
index 04d81e1894..82ccbc6a79 100644
--- a/instrumentation/opentelemetry-instrumentation-tortoiseorm/pyproject.toml
+++ b/instrumentation/opentelemetry-instrumentation-tortoiseorm/pyproject.toml
@@ -26,8 +26,8 @@ classifiers = [
]
dependencies = [
"opentelemetry-api ~= 1.12",
- "opentelemetry-instrumentation == 0.48b0.dev",
- "opentelemetry-semantic-conventions == 0.48b0.dev",
+ "opentelemetry-instrumentation == 0.49b0.dev",
+ "opentelemetry-semantic-conventions == 0.49b0.dev",
]
[project.optional-dependencies]
diff --git a/instrumentation/opentelemetry-instrumentation-tortoiseorm/src/opentelemetry/instrumentation/tortoiseorm/version.py b/instrumentation/opentelemetry-instrumentation-tortoiseorm/src/opentelemetry/instrumentation/tortoiseorm/version.py
index 4d21fcb843..ee5a6342e7 100644
--- a/instrumentation/opentelemetry-instrumentation-tortoiseorm/src/opentelemetry/instrumentation/tortoiseorm/version.py
+++ b/instrumentation/opentelemetry-instrumentation-tortoiseorm/src/opentelemetry/instrumentation/tortoiseorm/version.py
@@ -12,4 +12,4 @@
# See the License for the specific language governing permissions and
# limitations under the License.
-__version__ = "0.48b0.dev"
+__version__ = "0.49b0.dev"
diff --git a/instrumentation/opentelemetry-instrumentation-urllib/pyproject.toml b/instrumentation/opentelemetry-instrumentation-urllib/pyproject.toml
index 4f0d2681f9..97b611b095 100644
--- a/instrumentation/opentelemetry-instrumentation-urllib/pyproject.toml
+++ b/instrumentation/opentelemetry-instrumentation-urllib/pyproject.toml
@@ -26,9 +26,9 @@ classifiers = [
]
dependencies = [
"opentelemetry-api ~= 1.12",
- "opentelemetry-instrumentation == 0.48b0.dev",
- "opentelemetry-semantic-conventions == 0.48b0.dev",
- "opentelemetry-util-http == 0.48b0.dev",
+ "opentelemetry-instrumentation == 0.49b0.dev",
+ "opentelemetry-semantic-conventions == 0.49b0.dev",
+ "opentelemetry-util-http == 0.49b0.dev",
]
[project.optional-dependencies]
diff --git a/instrumentation/opentelemetry-instrumentation-urllib/src/opentelemetry/instrumentation/urllib/version.py b/instrumentation/opentelemetry-instrumentation-urllib/src/opentelemetry/instrumentation/urllib/version.py
index e0bef4b1e3..79e27849a4 100644
--- a/instrumentation/opentelemetry-instrumentation-urllib/src/opentelemetry/instrumentation/urllib/version.py
+++ b/instrumentation/opentelemetry-instrumentation-urllib/src/opentelemetry/instrumentation/urllib/version.py
@@ -12,6 +12,6 @@
# See the License for the specific language governing permissions and
# limitations under the License.
-__version__ = "0.48b0.dev"
+__version__ = "0.49b0.dev"
_instruments = tuple()
diff --git a/instrumentation/opentelemetry-instrumentation-urllib3/pyproject.toml b/instrumentation/opentelemetry-instrumentation-urllib3/pyproject.toml
index 03c9f26fbc..3c1eaaa6d0 100644
--- a/instrumentation/opentelemetry-instrumentation-urllib3/pyproject.toml
+++ b/instrumentation/opentelemetry-instrumentation-urllib3/pyproject.toml
@@ -26,9 +26,9 @@ classifiers = [
]
dependencies = [
"opentelemetry-api ~= 1.12",
- "opentelemetry-instrumentation == 0.48b0.dev",
- "opentelemetry-semantic-conventions == 0.48b0.dev",
- "opentelemetry-util-http == 0.48b0.dev",
+ "opentelemetry-instrumentation == 0.49b0.dev",
+ "opentelemetry-semantic-conventions == 0.49b0.dev",
+ "opentelemetry-util-http == 0.49b0.dev",
"wrapt >= 1.0.0, < 2.0.0",
]
diff --git a/instrumentation/opentelemetry-instrumentation-urllib3/src/opentelemetry/instrumentation/urllib3/version.py b/instrumentation/opentelemetry-instrumentation-urllib3/src/opentelemetry/instrumentation/urllib3/version.py
index 4d21fcb843..ee5a6342e7 100644
--- a/instrumentation/opentelemetry-instrumentation-urllib3/src/opentelemetry/instrumentation/urllib3/version.py
+++ b/instrumentation/opentelemetry-instrumentation-urllib3/src/opentelemetry/instrumentation/urllib3/version.py
@@ -12,4 +12,4 @@
# See the License for the specific language governing permissions and
# limitations under the License.
-__version__ = "0.48b0.dev"
+__version__ = "0.49b0.dev"
diff --git a/instrumentation/opentelemetry-instrumentation-wsgi/pyproject.toml b/instrumentation/opentelemetry-instrumentation-wsgi/pyproject.toml
index b38f1829aa..a5e81ee8e5 100644
--- a/instrumentation/opentelemetry-instrumentation-wsgi/pyproject.toml
+++ b/instrumentation/opentelemetry-instrumentation-wsgi/pyproject.toml
@@ -26,9 +26,9 @@ classifiers = [
]
dependencies = [
"opentelemetry-api ~= 1.12",
- "opentelemetry-instrumentation == 0.48b0.dev",
- "opentelemetry-semantic-conventions == 0.48b0.dev",
- "opentelemetry-util-http == 0.48b0.dev",
+ "opentelemetry-instrumentation == 0.49b0.dev",
+ "opentelemetry-semantic-conventions == 0.49b0.dev",
+ "opentelemetry-util-http == 0.49b0.dev",
]
[project.optional-dependencies]
diff --git a/instrumentation/opentelemetry-instrumentation-wsgi/src/opentelemetry/instrumentation/wsgi/version.py b/instrumentation/opentelemetry-instrumentation-wsgi/src/opentelemetry/instrumentation/wsgi/version.py
index 4d21fcb843..ee5a6342e7 100644
--- a/instrumentation/opentelemetry-instrumentation-wsgi/src/opentelemetry/instrumentation/wsgi/version.py
+++ b/instrumentation/opentelemetry-instrumentation-wsgi/src/opentelemetry/instrumentation/wsgi/version.py
@@ -12,4 +12,4 @@
# See the License for the specific language governing permissions and
# limitations under the License.
-__version__ = "0.48b0.dev"
+__version__ = "0.49b0.dev"
diff --git a/opentelemetry-contrib-instrumentations/pyproject.toml b/opentelemetry-contrib-instrumentations/pyproject.toml
index 6c7716bad2..9c40f9c2a3 100644
--- a/opentelemetry-contrib-instrumentations/pyproject.toml
+++ b/opentelemetry-contrib-instrumentations/pyproject.toml
@@ -29,53 +29,53 @@ classifiers = [
"Programming Language :: Python :: 3.12",
]
dependencies = [
- "opentelemetry-instrumentation-aio-pika==0.48b0.dev",
- "opentelemetry-instrumentation-aiohttp-client==0.48b0.dev",
- "opentelemetry-instrumentation-aiohttp-server==0.48b0.dev",
- "opentelemetry-instrumentation-aiopg==0.48b0.dev",
- "opentelemetry-instrumentation-asgi==0.48b0.dev",
- "opentelemetry-instrumentation-asyncio==0.48b0.dev",
- "opentelemetry-instrumentation-asyncpg==0.48b0.dev",
- "opentelemetry-instrumentation-aws-lambda==0.48b0.dev",
- "opentelemetry-instrumentation-boto==0.48b0.dev",
- "opentelemetry-instrumentation-boto3sqs==0.48b0.dev",
- "opentelemetry-instrumentation-botocore==0.48b0.dev",
- "opentelemetry-instrumentation-cassandra==0.48b0.dev",
- "opentelemetry-instrumentation-celery==0.48b0.dev",
- "opentelemetry-instrumentation-confluent-kafka==0.48b0.dev",
- "opentelemetry-instrumentation-dbapi==0.48b0.dev",
- "opentelemetry-instrumentation-django==0.48b0.dev",
- "opentelemetry-instrumentation-elasticsearch==0.48b0.dev",
- "opentelemetry-instrumentation-falcon==0.48b0.dev",
- "opentelemetry-instrumentation-fastapi==0.48b0.dev",
- "opentelemetry-instrumentation-flask==0.48b0.dev",
- "opentelemetry-instrumentation-grpc==0.48b0.dev",
- "opentelemetry-instrumentation-httpx==0.48b0.dev",
- "opentelemetry-instrumentation-jinja2==0.48b0.dev",
- "opentelemetry-instrumentation-kafka-python==0.48b0.dev",
- "opentelemetry-instrumentation-logging==0.48b0.dev",
- "opentelemetry-instrumentation-mysql==0.48b0.dev",
- "opentelemetry-instrumentation-mysqlclient==0.48b0.dev",
- "opentelemetry-instrumentation-pika==0.48b0.dev",
- "opentelemetry-instrumentation-psycopg==0.48b0.dev",
- "opentelemetry-instrumentation-psycopg2==0.48b0.dev",
- "opentelemetry-instrumentation-pymemcache==0.48b0.dev",
- "opentelemetry-instrumentation-pymongo==0.48b0.dev",
- "opentelemetry-instrumentation-pymysql==0.48b0.dev",
- "opentelemetry-instrumentation-pyramid==0.48b0.dev",
- "opentelemetry-instrumentation-redis==0.48b0.dev",
- "opentelemetry-instrumentation-remoulade==0.48b0.dev",
- "opentelemetry-instrumentation-requests==0.48b0.dev",
- "opentelemetry-instrumentation-sqlalchemy==0.48b0.dev",
- "opentelemetry-instrumentation-sqlite3==0.48b0.dev",
- "opentelemetry-instrumentation-starlette==0.48b0.dev",
- "opentelemetry-instrumentation-system-metrics==0.48b0.dev",
- "opentelemetry-instrumentation-threading==0.48b0.dev",
- "opentelemetry-instrumentation-tornado==0.48b0.dev",
- "opentelemetry-instrumentation-tortoiseorm==0.48b0.dev",
- "opentelemetry-instrumentation-urllib==0.48b0.dev",
- "opentelemetry-instrumentation-urllib3==0.48b0.dev",
- "opentelemetry-instrumentation-wsgi==0.48b0.dev",
+ "opentelemetry-instrumentation-aio-pika==0.49b0.dev",
+ "opentelemetry-instrumentation-aiohttp-client==0.49b0.dev",
+ "opentelemetry-instrumentation-aiohttp-server==0.49b0.dev",
+ "opentelemetry-instrumentation-aiopg==0.49b0.dev",
+ "opentelemetry-instrumentation-asgi==0.49b0.dev",
+ "opentelemetry-instrumentation-asyncio==0.49b0.dev",
+ "opentelemetry-instrumentation-asyncpg==0.49b0.dev",
+ "opentelemetry-instrumentation-aws-lambda==0.49b0.dev",
+ "opentelemetry-instrumentation-boto==0.49b0.dev",
+ "opentelemetry-instrumentation-boto3sqs==0.49b0.dev",
+ "opentelemetry-instrumentation-botocore==0.49b0.dev",
+ "opentelemetry-instrumentation-cassandra==0.49b0.dev",
+ "opentelemetry-instrumentation-celery==0.49b0.dev",
+ "opentelemetry-instrumentation-confluent-kafka==0.49b0.dev",
+ "opentelemetry-instrumentation-dbapi==0.49b0.dev",
+ "opentelemetry-instrumentation-django==0.49b0.dev",
+ "opentelemetry-instrumentation-elasticsearch==0.49b0.dev",
+ "opentelemetry-instrumentation-falcon==0.49b0.dev",
+ "opentelemetry-instrumentation-fastapi==0.49b0.dev",
+ "opentelemetry-instrumentation-flask==0.49b0.dev",
+ "opentelemetry-instrumentation-grpc==0.49b0.dev",
+ "opentelemetry-instrumentation-httpx==0.49b0.dev",
+ "opentelemetry-instrumentation-jinja2==0.49b0.dev",
+ "opentelemetry-instrumentation-kafka-python==0.49b0.dev",
+ "opentelemetry-instrumentation-logging==0.49b0.dev",
+ "opentelemetry-instrumentation-mysql==0.49b0.dev",
+ "opentelemetry-instrumentation-mysqlclient==0.49b0.dev",
+ "opentelemetry-instrumentation-pika==0.49b0.dev",
+ "opentelemetry-instrumentation-psycopg==0.49b0.dev",
+ "opentelemetry-instrumentation-psycopg2==0.49b0.dev",
+ "opentelemetry-instrumentation-pymemcache==0.49b0.dev",
+ "opentelemetry-instrumentation-pymongo==0.49b0.dev",
+ "opentelemetry-instrumentation-pymysql==0.49b0.dev",
+ "opentelemetry-instrumentation-pyramid==0.49b0.dev",
+ "opentelemetry-instrumentation-redis==0.49b0.dev",
+ "opentelemetry-instrumentation-remoulade==0.49b0.dev",
+ "opentelemetry-instrumentation-requests==0.49b0.dev",
+ "opentelemetry-instrumentation-sqlalchemy==0.49b0.dev",
+ "opentelemetry-instrumentation-sqlite3==0.49b0.dev",
+ "opentelemetry-instrumentation-starlette==0.49b0.dev",
+ "opentelemetry-instrumentation-system-metrics==0.49b0.dev",
+ "opentelemetry-instrumentation-threading==0.49b0.dev",
+ "opentelemetry-instrumentation-tornado==0.49b0.dev",
+ "opentelemetry-instrumentation-tortoiseorm==0.49b0.dev",
+ "opentelemetry-instrumentation-urllib==0.49b0.dev",
+ "opentelemetry-instrumentation-urllib3==0.49b0.dev",
+ "opentelemetry-instrumentation-wsgi==0.49b0.dev",
]
[project.urls]
diff --git a/opentelemetry-contrib-instrumentations/src/opentelemetry/contrib-instrumentations/version.py b/opentelemetry-contrib-instrumentations/src/opentelemetry/contrib-instrumentations/version.py
index 4d21fcb843..ee5a6342e7 100644
--- a/opentelemetry-contrib-instrumentations/src/opentelemetry/contrib-instrumentations/version.py
+++ b/opentelemetry-contrib-instrumentations/src/opentelemetry/contrib-instrumentations/version.py
@@ -12,4 +12,4 @@
# See the License for the specific language governing permissions and
# limitations under the License.
-__version__ = "0.48b0.dev"
+__version__ = "0.49b0.dev"
diff --git a/opentelemetry-distro/pyproject.toml b/opentelemetry-distro/pyproject.toml
index 2397e9182a..686eeaba95 100644
--- a/opentelemetry-distro/pyproject.toml
+++ b/opentelemetry-distro/pyproject.toml
@@ -27,13 +27,13 @@ classifiers = [
]
dependencies = [
"opentelemetry-api ~= 1.12",
- "opentelemetry-instrumentation == 0.48b0.dev",
+ "opentelemetry-instrumentation == 0.49b0.dev",
"opentelemetry-sdk ~= 1.13",
]
[project.optional-dependencies]
otlp = [
- "opentelemetry-exporter-otlp == 1.27.0.dev",
+ "opentelemetry-exporter-otlp == 1.28.0.dev",
]
[project.entry-points.opentelemetry_configurator]
diff --git a/opentelemetry-distro/src/opentelemetry/distro/version.py b/opentelemetry-distro/src/opentelemetry/distro/version.py
index 4d21fcb843..ee5a6342e7 100644
--- a/opentelemetry-distro/src/opentelemetry/distro/version.py
+++ b/opentelemetry-distro/src/opentelemetry/distro/version.py
@@ -12,4 +12,4 @@
# See the License for the specific language governing permissions and
# limitations under the License.
-__version__ = "0.48b0.dev"
+__version__ = "0.49b0.dev"
diff --git a/opentelemetry-instrumentation/src/opentelemetry/instrumentation/bootstrap_gen.py b/opentelemetry-instrumentation/src/opentelemetry/instrumentation/bootstrap_gen.py
index c31863bd31..8c4293f261 100644
--- a/opentelemetry-instrumentation/src/opentelemetry/instrumentation/bootstrap_gen.py
+++ b/opentelemetry-instrumentation/src/opentelemetry/instrumentation/bootstrap_gen.py
@@ -18,179 +18,179 @@
libraries = [
{
"library": "aio_pika >= 7.2.0, < 10.0.0",
- "instrumentation": "opentelemetry-instrumentation-aio-pika==0.48b0.dev",
+ "instrumentation": "opentelemetry-instrumentation-aio-pika==0.49b0.dev",
},
{
"library": "aiohttp ~= 3.0",
- "instrumentation": "opentelemetry-instrumentation-aiohttp-client==0.48b0.dev",
+ "instrumentation": "opentelemetry-instrumentation-aiohttp-client==0.49b0.dev",
},
{
"library": "aiohttp ~= 3.0",
- "instrumentation": "opentelemetry-instrumentation-aiohttp-server==0.48b0.dev",
+ "instrumentation": "opentelemetry-instrumentation-aiohttp-server==0.49b0.dev",
},
{
"library": "aiopg >= 0.13.0, < 2.0.0",
- "instrumentation": "opentelemetry-instrumentation-aiopg==0.48b0.dev",
+ "instrumentation": "opentelemetry-instrumentation-aiopg==0.49b0.dev",
},
{
"library": "asgiref ~= 3.0",
- "instrumentation": "opentelemetry-instrumentation-asgi==0.48b0.dev",
+ "instrumentation": "opentelemetry-instrumentation-asgi==0.49b0.dev",
},
{
"library": "asyncpg >= 0.12.0",
- "instrumentation": "opentelemetry-instrumentation-asyncpg==0.48b0.dev",
+ "instrumentation": "opentelemetry-instrumentation-asyncpg==0.49b0.dev",
},
{
"library": "boto~=2.0",
- "instrumentation": "opentelemetry-instrumentation-boto==0.48b0.dev",
+ "instrumentation": "opentelemetry-instrumentation-boto==0.49b0.dev",
},
{
"library": "boto3 ~= 1.0",
- "instrumentation": "opentelemetry-instrumentation-boto3sqs==0.48b0.dev",
+ "instrumentation": "opentelemetry-instrumentation-boto3sqs==0.49b0.dev",
},
{
"library": "botocore ~= 1.0",
- "instrumentation": "opentelemetry-instrumentation-botocore==0.48b0.dev",
+ "instrumentation": "opentelemetry-instrumentation-botocore==0.49b0.dev",
},
{
"library": "cassandra-driver ~= 3.25",
- "instrumentation": "opentelemetry-instrumentation-cassandra==0.48b0.dev",
+ "instrumentation": "opentelemetry-instrumentation-cassandra==0.49b0.dev",
},
{
"library": "scylla-driver ~= 3.25",
- "instrumentation": "opentelemetry-instrumentation-cassandra==0.48b0.dev",
+ "instrumentation": "opentelemetry-instrumentation-cassandra==0.49b0.dev",
},
{
"library": "celery >= 4.0, < 6.0",
- "instrumentation": "opentelemetry-instrumentation-celery==0.48b0.dev",
+ "instrumentation": "opentelemetry-instrumentation-celery==0.49b0.dev",
},
{
"library": "confluent-kafka >= 1.8.2, <= 2.4.0",
- "instrumentation": "opentelemetry-instrumentation-confluent-kafka==0.48b0.dev",
+ "instrumentation": "opentelemetry-instrumentation-confluent-kafka==0.49b0.dev",
},
{
"library": "django >= 1.10",
- "instrumentation": "opentelemetry-instrumentation-django==0.48b0.dev",
+ "instrumentation": "opentelemetry-instrumentation-django==0.49b0.dev",
},
{
"library": "elasticsearch >= 6.0",
- "instrumentation": "opentelemetry-instrumentation-elasticsearch==0.48b0.dev",
+ "instrumentation": "opentelemetry-instrumentation-elasticsearch==0.49b0.dev",
},
{
"library": "falcon >= 1.4.1, < 3.1.2",
- "instrumentation": "opentelemetry-instrumentation-falcon==0.48b0.dev",
+ "instrumentation": "opentelemetry-instrumentation-falcon==0.49b0.dev",
},
{
"library": "fastapi ~= 0.58",
- "instrumentation": "opentelemetry-instrumentation-fastapi==0.48b0.dev",
+ "instrumentation": "opentelemetry-instrumentation-fastapi==0.49b0.dev",
},
{
"library": "flask >= 1.0",
- "instrumentation": "opentelemetry-instrumentation-flask==0.48b0.dev",
+ "instrumentation": "opentelemetry-instrumentation-flask==0.49b0.dev",
},
{
"library": "grpcio ~= 1.27",
- "instrumentation": "opentelemetry-instrumentation-grpc==0.48b0.dev",
+ "instrumentation": "opentelemetry-instrumentation-grpc==0.49b0.dev",
},
{
"library": "httpx >= 0.18.0",
- "instrumentation": "opentelemetry-instrumentation-httpx==0.48b0.dev",
+ "instrumentation": "opentelemetry-instrumentation-httpx==0.49b0.dev",
},
{
"library": "jinja2 >= 2.7, < 4.0",
- "instrumentation": "opentelemetry-instrumentation-jinja2==0.48b0.dev",
+ "instrumentation": "opentelemetry-instrumentation-jinja2==0.49b0.dev",
},
{
"library": "kafka-python >= 2.0, < 3.0",
- "instrumentation": "opentelemetry-instrumentation-kafka-python==0.48b0.dev",
+ "instrumentation": "opentelemetry-instrumentation-kafka-python==0.49b0.dev",
},
{
"library": "kafka-python-ng >= 2.0, < 3.0",
- "instrumentation": "opentelemetry-instrumentation-kafka-python==0.48b0.dev",
+ "instrumentation": "opentelemetry-instrumentation-kafka-python==0.49b0.dev",
},
{
"library": "mysql-connector-python >= 8.0, < 10.0",
- "instrumentation": "opentelemetry-instrumentation-mysql==0.48b0.dev",
+ "instrumentation": "opentelemetry-instrumentation-mysql==0.49b0.dev",
},
{
"library": "mysqlclient < 3",
- "instrumentation": "opentelemetry-instrumentation-mysqlclient==0.48b0.dev",
+ "instrumentation": "opentelemetry-instrumentation-mysqlclient==0.49b0.dev",
},
{
"library": "pika >= 0.12.0",
- "instrumentation": "opentelemetry-instrumentation-pika==0.48b0.dev",
+ "instrumentation": "opentelemetry-instrumentation-pika==0.49b0.dev",
},
{
"library": "psycopg >= 3.1.0",
- "instrumentation": "opentelemetry-instrumentation-psycopg==0.48b0.dev",
+ "instrumentation": "opentelemetry-instrumentation-psycopg==0.49b0.dev",
},
{
"library": "psycopg2 >= 2.7.3.1",
- "instrumentation": "opentelemetry-instrumentation-psycopg2==0.48b0.dev",
+ "instrumentation": "opentelemetry-instrumentation-psycopg2==0.49b0.dev",
},
{
"library": "pymemcache >= 1.3.5, < 5",
- "instrumentation": "opentelemetry-instrumentation-pymemcache==0.48b0.dev",
+ "instrumentation": "opentelemetry-instrumentation-pymemcache==0.49b0.dev",
},
{
"library": "pymongo >= 3.1, < 5.0",
- "instrumentation": "opentelemetry-instrumentation-pymongo==0.48b0.dev",
+ "instrumentation": "opentelemetry-instrumentation-pymongo==0.49b0.dev",
},
{
"library": "PyMySQL < 2",
- "instrumentation": "opentelemetry-instrumentation-pymysql==0.48b0.dev",
+ "instrumentation": "opentelemetry-instrumentation-pymysql==0.49b0.dev",
},
{
"library": "pyramid >= 1.7",
- "instrumentation": "opentelemetry-instrumentation-pyramid==0.48b0.dev",
+ "instrumentation": "opentelemetry-instrumentation-pyramid==0.49b0.dev",
},
{
"library": "redis >= 2.6",
- "instrumentation": "opentelemetry-instrumentation-redis==0.48b0.dev",
+ "instrumentation": "opentelemetry-instrumentation-redis==0.49b0.dev",
},
{
"library": "remoulade >= 0.50",
- "instrumentation": "opentelemetry-instrumentation-remoulade==0.48b0.dev",
+ "instrumentation": "opentelemetry-instrumentation-remoulade==0.49b0.dev",
},
{
"library": "requests ~= 2.0",
- "instrumentation": "opentelemetry-instrumentation-requests==0.48b0.dev",
+ "instrumentation": "opentelemetry-instrumentation-requests==0.49b0.dev",
},
{
"library": "sqlalchemy",
- "instrumentation": "opentelemetry-instrumentation-sqlalchemy==0.48b0.dev",
+ "instrumentation": "opentelemetry-instrumentation-sqlalchemy==0.49b0.dev",
},
{
"library": "starlette ~= 0.13.0",
- "instrumentation": "opentelemetry-instrumentation-starlette==0.48b0.dev",
+ "instrumentation": "opentelemetry-instrumentation-starlette==0.49b0.dev",
},
{
"library": "psutil >= 5",
- "instrumentation": "opentelemetry-instrumentation-system-metrics==0.48b0.dev",
+ "instrumentation": "opentelemetry-instrumentation-system-metrics==0.49b0.dev",
},
{
"library": "tornado >= 5.1.1",
- "instrumentation": "opentelemetry-instrumentation-tornado==0.48b0.dev",
+ "instrumentation": "opentelemetry-instrumentation-tornado==0.49b0.dev",
},
{
"library": "tortoise-orm >= 0.17.0",
- "instrumentation": "opentelemetry-instrumentation-tortoiseorm==0.48b0.dev",
+ "instrumentation": "opentelemetry-instrumentation-tortoiseorm==0.49b0.dev",
},
{
"library": "pydantic >= 1.10.2",
- "instrumentation": "opentelemetry-instrumentation-tortoiseorm==0.48b0.dev",
+ "instrumentation": "opentelemetry-instrumentation-tortoiseorm==0.49b0.dev",
},
{
"library": "urllib3 >= 1.0.0, < 3.0.0",
- "instrumentation": "opentelemetry-instrumentation-urllib3==0.48b0.dev",
+ "instrumentation": "opentelemetry-instrumentation-urllib3==0.49b0.dev",
},
]
default_instrumentations = [
- "opentelemetry-instrumentation-asyncio==0.48b0.dev",
- "opentelemetry-instrumentation-dbapi==0.48b0.dev",
- "opentelemetry-instrumentation-logging==0.48b0.dev",
- "opentelemetry-instrumentation-sqlite3==0.48b0.dev",
- "opentelemetry-instrumentation-threading==0.48b0.dev",
- "opentelemetry-instrumentation-urllib==0.48b0.dev",
- "opentelemetry-instrumentation-wsgi==0.48b0.dev",
+ "opentelemetry-instrumentation-asyncio==0.49b0.dev",
+ "opentelemetry-instrumentation-dbapi==0.49b0.dev",
+ "opentelemetry-instrumentation-logging==0.49b0.dev",
+ "opentelemetry-instrumentation-sqlite3==0.49b0.dev",
+ "opentelemetry-instrumentation-threading==0.49b0.dev",
+ "opentelemetry-instrumentation-urllib==0.49b0.dev",
+ "opentelemetry-instrumentation-wsgi==0.49b0.dev",
]
diff --git a/opentelemetry-instrumentation/src/opentelemetry/instrumentation/version.py b/opentelemetry-instrumentation/src/opentelemetry/instrumentation/version.py
index 4d21fcb843..ee5a6342e7 100644
--- a/opentelemetry-instrumentation/src/opentelemetry/instrumentation/version.py
+++ b/opentelemetry-instrumentation/src/opentelemetry/instrumentation/version.py
@@ -12,4 +12,4 @@
# See the License for the specific language governing permissions and
# limitations under the License.
-__version__ = "0.48b0.dev"
+__version__ = "0.49b0.dev"
diff --git a/processor/opentelemetry-processor-baggage/src/opentelemetry/processor/baggage/version.py b/processor/opentelemetry-processor-baggage/src/opentelemetry/processor/baggage/version.py
index 4d21fcb843..ee5a6342e7 100644
--- a/processor/opentelemetry-processor-baggage/src/opentelemetry/processor/baggage/version.py
+++ b/processor/opentelemetry-processor-baggage/src/opentelemetry/processor/baggage/version.py
@@ -12,4 +12,4 @@
# See the License for the specific language governing permissions and
# limitations under the License.
-__version__ = "0.48b0.dev"
+__version__ = "0.49b0.dev"
diff --git a/propagator/opentelemetry-propagator-ot-trace/src/opentelemetry/propagators/ot_trace/version.py b/propagator/opentelemetry-propagator-ot-trace/src/opentelemetry/propagators/ot_trace/version.py
index 4d21fcb843..ee5a6342e7 100644
--- a/propagator/opentelemetry-propagator-ot-trace/src/opentelemetry/propagators/ot_trace/version.py
+++ b/propagator/opentelemetry-propagator-ot-trace/src/opentelemetry/propagators/ot_trace/version.py
@@ -12,4 +12,4 @@
# See the License for the specific language governing permissions and
# limitations under the License.
-__version__ = "0.48b0.dev"
+__version__ = "0.49b0.dev"
diff --git a/resource/opentelemetry-resource-detector-container/src/opentelemetry/resource/detector/container/version.py b/resource/opentelemetry-resource-detector-container/src/opentelemetry/resource/detector/container/version.py
index 4d21fcb843..ee5a6342e7 100644
--- a/resource/opentelemetry-resource-detector-container/src/opentelemetry/resource/detector/container/version.py
+++ b/resource/opentelemetry-resource-detector-container/src/opentelemetry/resource/detector/container/version.py
@@ -12,4 +12,4 @@
# See the License for the specific language governing permissions and
# limitations under the License.
-__version__ = "0.48b0.dev"
+__version__ = "0.49b0.dev"
diff --git a/util/opentelemetry-util-http/src/opentelemetry/util/http/version.py b/util/opentelemetry-util-http/src/opentelemetry/util/http/version.py
index 4d21fcb843..ee5a6342e7 100644
--- a/util/opentelemetry-util-http/src/opentelemetry/util/http/version.py
+++ b/util/opentelemetry-util-http/src/opentelemetry/util/http/version.py
@@ -12,4 +12,4 @@
# See the License for the specific language governing permissions and
# limitations under the License.
-__version__ = "0.48b0.dev"
+__version__ = "0.49b0.dev"
From f8a4f1ebf8b22a983c4bc8937268c2fc2b61beb9 Mon Sep 17 00:00:00 2001
From: OpenTelemetry Bot <107717825+opentelemetrybot@users.noreply.github.com>
Date: Wed, 28 Aug 2024 17:54:08 -0500
Subject: [PATCH 11/33] Copy change log updates from release/v1.27.x-0.48bx
(#2839)
---
CHANGELOG.md | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/CHANGELOG.md b/CHANGELOG.md
index 2a18ea7858..d4c03d3b38 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -7,7 +7,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
## Unreleased
-## Version 1.27.0/0.48b0 (2024-08-26)
+## Version 1.27.0/0.48b0 ()
### Added
From f7878e761373f70a67acac1c8efa16e89b9c1974 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Em=C3=ADdio=20Neto?=
<9735060+emdneto@users.noreply.github.com>
Date: Thu, 29 Aug 2024 14:07:04 -0300
Subject: [PATCH 12/33] fix core repo sha in workflows (#2842)
---
.github/workflows/lint_0.yml | 2 +-
.github/workflows/misc_0.yml | 2 +-
.github/workflows/test_0.yml | 2 +-
.github/workflows/test_1.yml | 2 +-
4 files changed, 4 insertions(+), 4 deletions(-)
diff --git a/.github/workflows/lint_0.yml b/.github/workflows/lint_0.yml
index fa4f2e981a..b5d20541e5 100644
--- a/.github/workflows/lint_0.yml
+++ b/.github/workflows/lint_0.yml
@@ -10,7 +10,7 @@ on:
pull_request:
env:
- CORE_REPO_SHA: 8368b6305b4246aafa4ffa7d4890a692d1010b6e
+ CORE_REPO_SHA: main
CONTRIB_REPO_SHA: main
PIP_EXISTS_ACTION: w
diff --git a/.github/workflows/misc_0.yml b/.github/workflows/misc_0.yml
index 51cb5afea0..3c3f7bfacf 100644
--- a/.github/workflows/misc_0.yml
+++ b/.github/workflows/misc_0.yml
@@ -10,7 +10,7 @@ on:
pull_request:
env:
- CORE_REPO_SHA: 8368b6305b4246aafa4ffa7d4890a692d1010b6e
+ CORE_REPO_SHA: main
CONTRIB_REPO_SHA: main
PIP_EXISTS_ACTION: w
diff --git a/.github/workflows/test_0.yml b/.github/workflows/test_0.yml
index d216e840ae..d251737227 100644
--- a/.github/workflows/test_0.yml
+++ b/.github/workflows/test_0.yml
@@ -10,7 +10,7 @@ on:
pull_request:
env:
- CORE_REPO_SHA: 8368b6305b4246aafa4ffa7d4890a692d1010b6e
+ CORE_REPO_SHA: main
CONTRIB_REPO_SHA: main
PIP_EXISTS_ACTION: w
diff --git a/.github/workflows/test_1.yml b/.github/workflows/test_1.yml
index dc3afb6464..f7e71dd6b6 100644
--- a/.github/workflows/test_1.yml
+++ b/.github/workflows/test_1.yml
@@ -10,7 +10,7 @@ on:
pull_request:
env:
- CORE_REPO_SHA: 8368b6305b4246aafa4ffa7d4890a692d1010b6e
+ CORE_REPO_SHA: main
CONTRIB_REPO_SHA: main
PIP_EXISTS_ACTION: w
From 98958b6f1ef09d332e13ea1d7bc308f8e9edd351 Mon Sep 17 00:00:00 2001
From: JianQiao
Date: Fri, 30 Aug 2024 18:42:33 +0800
Subject: [PATCH 13/33] Fix description of http.server.duration and
http.server.request.duration (#2817)
* fix httpserverduration and httpserverrequestduration
Signed-off-by: Steven Pan
* add change log
---------
Signed-off-by: Steven Pan
---
CHANGELOG.md | 2 ++
.../instrumentation/aiohttp_server/__init__.py | 2 +-
.../src/opentelemetry/instrumentation/asgi/__init__.py | 2 +-
.../src/opentelemetry/instrumentation/django/__init__.py | 2 +-
.../src/opentelemetry/instrumentation/falcon/__init__.py | 2 +-
.../src/opentelemetry/instrumentation/flask/__init__.py | 8 ++++----
.../opentelemetry/instrumentation/pyramid/callbacks.py | 2 +-
.../src/opentelemetry/instrumentation/tornado/__init__.py | 2 +-
.../src/opentelemetry/instrumentation/wsgi/__init__.py | 4 ++--
9 files changed, 14 insertions(+), 12 deletions(-)
diff --git a/CHANGELOG.md b/CHANGELOG.md
index d4c03d3b38..003f8054f6 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -46,6 +46,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
([#2563](https://github.com/open-telemetry/opentelemetry-python-contrib/pull/2563))
- `opentelemetry-instrumentation` fix `http.host` new http semantic convention mapping to depend on `kind` of span
([#2814](https://github.com/open-telemetry/opentelemetry-python-contrib/pull/2814))
+- `opentelemetry-instrumentation` Fix the description of `http.server.duration` and `http.server.request.duration`
+ ([#2753](https://github.com/open-telemetry/opentelemetry-python-contrib/pull/2753))
## Version 1.26.0/0.47b0 (2024-07-23)
diff --git a/instrumentation/opentelemetry-instrumentation-aiohttp-server/src/opentelemetry/instrumentation/aiohttp_server/__init__.py b/instrumentation/opentelemetry-instrumentation-aiohttp-server/src/opentelemetry/instrumentation/aiohttp_server/__init__.py
index 659ff24af6..6db7719c76 100644
--- a/instrumentation/opentelemetry-instrumentation-aiohttp-server/src/opentelemetry/instrumentation/aiohttp_server/__init__.py
+++ b/instrumentation/opentelemetry-instrumentation-aiohttp-server/src/opentelemetry/instrumentation/aiohttp_server/__init__.py
@@ -207,7 +207,7 @@ async def middleware(request, handler):
duration_histogram = meter.create_histogram(
name=MetricInstruments.HTTP_SERVER_DURATION,
unit="ms",
- description="Duration of HTTP server requests.",
+ description="Measures the duration of inbound HTTP requests.",
)
active_requests_counter = meter.create_up_down_counter(
diff --git a/instrumentation/opentelemetry-instrumentation-asgi/src/opentelemetry/instrumentation/asgi/__init__.py b/instrumentation/opentelemetry-instrumentation-asgi/src/opentelemetry/instrumentation/asgi/__init__.py
index 295eb2a043..420fd512d6 100644
--- a/instrumentation/opentelemetry-instrumentation-asgi/src/opentelemetry/instrumentation/asgi/__init__.py
+++ b/instrumentation/opentelemetry-instrumentation-asgi/src/opentelemetry/instrumentation/asgi/__init__.py
@@ -579,7 +579,7 @@ def __init__(
self.duration_histogram_old = self.meter.create_histogram(
name=MetricInstruments.HTTP_SERVER_DURATION,
unit="ms",
- description="Duration of HTTP server requests.",
+ description="Measures the duration of inbound HTTP requests.",
)
self.duration_histogram_new = None
if _report_new(sem_conv_opt_in_mode):
diff --git a/instrumentation/opentelemetry-instrumentation-django/src/opentelemetry/instrumentation/django/__init__.py b/instrumentation/opentelemetry-instrumentation-django/src/opentelemetry/instrumentation/django/__init__.py
index 651df12043..d37c45993c 100644
--- a/instrumentation/opentelemetry-instrumentation-django/src/opentelemetry/instrumentation/django/__init__.py
+++ b/instrumentation/opentelemetry-instrumentation-django/src/opentelemetry/instrumentation/django/__init__.py
@@ -344,7 +344,7 @@ def _instrument(self, **kwargs):
_DjangoMiddleware._duration_histogram_old = meter.create_histogram(
name=MetricInstruments.HTTP_SERVER_DURATION,
unit="ms",
- description="Duration of HTTP server requests.",
+ description="Measures the duration of inbound HTTP requests.",
)
_DjangoMiddleware._duration_histogram_new = None
if _report_new(sem_conv_opt_in_mode):
diff --git a/instrumentation/opentelemetry-instrumentation-falcon/src/opentelemetry/instrumentation/falcon/__init__.py b/instrumentation/opentelemetry-instrumentation-falcon/src/opentelemetry/instrumentation/falcon/__init__.py
index 1a252b9a16..2dce5f1ef5 100644
--- a/instrumentation/opentelemetry-instrumentation-falcon/src/opentelemetry/instrumentation/falcon/__init__.py
+++ b/instrumentation/opentelemetry-instrumentation-falcon/src/opentelemetry/instrumentation/falcon/__init__.py
@@ -268,7 +268,7 @@ def __init__(self, *args, **kwargs):
self.duration_histogram = self._otel_meter.create_histogram(
name=MetricInstruments.HTTP_SERVER_DURATION,
unit="ms",
- description="Duration of HTTP server requests.",
+ description="Measures the duration of inbound HTTP requests.",
)
self.active_requests_counter = self._otel_meter.create_up_down_counter(
name=MetricInstruments.HTTP_SERVER_ACTIVE_REQUESTS,
diff --git a/instrumentation/opentelemetry-instrumentation-flask/src/opentelemetry/instrumentation/flask/__init__.py b/instrumentation/opentelemetry-instrumentation-flask/src/opentelemetry/instrumentation/flask/__init__.py
index 0093715ae1..192e044655 100644
--- a/instrumentation/opentelemetry-instrumentation-flask/src/opentelemetry/instrumentation/flask/__init__.py
+++ b/instrumentation/opentelemetry-instrumentation-flask/src/opentelemetry/instrumentation/flask/__init__.py
@@ -568,14 +568,14 @@ def __init__(self, *args, **kwargs):
duration_histogram_old = meter.create_histogram(
name=MetricInstruments.HTTP_SERVER_DURATION,
unit="ms",
- description="measures the duration of the inbound HTTP request",
+ description="Measures the duration of inbound HTTP requests.",
)
duration_histogram_new = None
if _report_new(_InstrumentedFlask._sem_conv_opt_in_mode):
duration_histogram_new = meter.create_histogram(
name=HTTP_SERVER_REQUEST_DURATION,
unit="s",
- description="measures the duration of the inbound HTTP request",
+ description="Duration of HTTP server requests.",
)
active_requests_counter = meter.create_up_down_counter(
name=MetricInstruments.HTTP_SERVER_ACTIVE_REQUESTS,
@@ -701,14 +701,14 @@ def instrument_app(
duration_histogram_old = meter.create_histogram(
name=MetricInstruments.HTTP_SERVER_DURATION,
unit="ms",
- description="measures the duration of the inbound HTTP request",
+ description="Measures the duration of inbound HTTP requests.",
)
duration_histogram_new = None
if _report_new(sem_conv_opt_in_mode):
duration_histogram_new = meter.create_histogram(
name=HTTP_SERVER_REQUEST_DURATION,
unit="s",
- description="measures the duration of the inbound HTTP request",
+ description="Duration of HTTP server requests.",
)
active_requests_counter = meter.create_up_down_counter(
name=MetricInstruments.HTTP_SERVER_ACTIVE_REQUESTS,
diff --git a/instrumentation/opentelemetry-instrumentation-pyramid/src/opentelemetry/instrumentation/pyramid/callbacks.py b/instrumentation/opentelemetry-instrumentation-pyramid/src/opentelemetry/instrumentation/pyramid/callbacks.py
index 09f1645384..6a526f2235 100644
--- a/instrumentation/opentelemetry-instrumentation-pyramid/src/opentelemetry/instrumentation/pyramid/callbacks.py
+++ b/instrumentation/opentelemetry-instrumentation-pyramid/src/opentelemetry/instrumentation/pyramid/callbacks.py
@@ -141,7 +141,7 @@ def trace_tween_factory(handler, registry):
duration_histogram = meter.create_histogram(
name=MetricInstruments.HTTP_SERVER_DURATION,
unit="ms",
- description="Duration of HTTP server requests.",
+ description="Measures the duration of inbound HTTP requests.",
)
active_requests_counter = meter.create_up_down_counter(
name=MetricInstruments.HTTP_SERVER_ACTIVE_REQUESTS,
diff --git a/instrumentation/opentelemetry-instrumentation-tornado/src/opentelemetry/instrumentation/tornado/__init__.py b/instrumentation/opentelemetry-instrumentation-tornado/src/opentelemetry/instrumentation/tornado/__init__.py
index 1b56db3876..0b5e06b526 100644
--- a/instrumentation/opentelemetry-instrumentation-tornado/src/opentelemetry/instrumentation/tornado/__init__.py
+++ b/instrumentation/opentelemetry-instrumentation-tornado/src/opentelemetry/instrumentation/tornado/__init__.py
@@ -296,7 +296,7 @@ def _create_server_histograms(meter) -> Dict[str, Histogram]:
MetricInstruments.HTTP_SERVER_DURATION: meter.create_histogram(
name=MetricInstruments.HTTP_SERVER_DURATION,
unit="ms",
- description="Duration of HTTP server requests.",
+ description="Measures the duration of inbound HTTP requests.",
),
MetricInstruments.HTTP_SERVER_REQUEST_SIZE: meter.create_histogram(
name=MetricInstruments.HTTP_SERVER_REQUEST_SIZE,
diff --git a/instrumentation/opentelemetry-instrumentation-wsgi/src/opentelemetry/instrumentation/wsgi/__init__.py b/instrumentation/opentelemetry-instrumentation-wsgi/src/opentelemetry/instrumentation/wsgi/__init__.py
index 88704f35ab..c0384d594b 100644
--- a/instrumentation/opentelemetry-instrumentation-wsgi/src/opentelemetry/instrumentation/wsgi/__init__.py
+++ b/instrumentation/opentelemetry-instrumentation-wsgi/src/opentelemetry/instrumentation/wsgi/__init__.py
@@ -571,14 +571,14 @@ def __init__(
self.duration_histogram_old = self.meter.create_histogram(
name=MetricInstruments.HTTP_SERVER_DURATION,
unit="ms",
- description="measures the duration of the inbound HTTP request",
+ description="Measures the duration of inbound HTTP requests.",
)
self.duration_histogram_new = None
if _report_new(sem_conv_opt_in_mode):
self.duration_histogram_new = self.meter.create_histogram(
name=HTTP_SERVER_REQUEST_DURATION,
unit="s",
- description="measures the duration of the inbound HTTP request",
+ description="Duration of HTTP server requests.",
)
# We don't need a separate active request counter for old/new semantic conventions
# because the new attributes are a subset of the old attributes
From f5868df7f898d5134d8e38b81ee99b5a2d04bc36 Mon Sep 17 00:00:00 2001
From: Karoline Pauls <43616133+karolinepauls@users.noreply.github.com>
Date: Mon, 2 Sep 2024 16:06:57 +0100
Subject: [PATCH 14/33] opentelemetry-instrumentation-asyncio: package name
typo (#2844)
---
.../src/opentelemetry/instrumentation/asyncio/__init__.py | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/instrumentation/opentelemetry-instrumentation-asyncio/src/opentelemetry/instrumentation/asyncio/__init__.py b/instrumentation/opentelemetry-instrumentation-asyncio/src/opentelemetry/instrumentation/asyncio/__init__.py
index ae10560861..e83f384a8c 100644
--- a/instrumentation/opentelemetry-instrumentation-asyncio/src/opentelemetry/instrumentation/asyncio/__init__.py
+++ b/instrumentation/opentelemetry-instrumentation-asyncio/src/opentelemetry/instrumentation/asyncio/__init__.py
@@ -14,7 +14,7 @@
"""
.. asyncio: https://github.com/python/asyncio
-The opentelemetry-instrumentation-asycnio package allows tracing asyncio applications.
+The opentelemetry-instrumentation-asyncio package allows tracing asyncio applications.
The metric for coroutine, future, is generated even if there is no setting to generate a span.
Run instrumented application
From 40c3363e9d30dbafac81f7ee43576552050e5b06 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Em=C3=ADdio=20Neto?=
<9735060+emdneto@users.noreply.github.com>
Date: Tue, 3 Sep 2024 16:28:53 -0300
Subject: [PATCH 15/33] bump asgiref to 3.8.1 in test-requirements (#2841)
Co-authored-by: Riccardo Magliocchetti
---
.../test-requirements.txt | 2 +-
.../opentelemetry-exporter-richconsole/test-requirements.txt | 2 +-
.../test-requirements-0.txt | 2 +-
.../test-requirements-1.txt | 2 +-
.../test-requirements-2.txt | 2 +-
.../test-requirements-3.txt | 2 +-
.../test-requirements.txt | 2 +-
.../test-requirements.txt | 2 +-
.../opentelemetry-instrumentation-aiopg/test-requirements.txt | 2 +-
.../opentelemetry-instrumentation-asgi/test-requirements.txt | 2 +-
.../test-requirements.txt | 2 +-
.../test-requirements.txt | 2 +-
.../test-requirements.txt | 2 +-
.../opentelemetry-instrumentation-boto/test-requirements.txt | 2 +-
.../test-requirements.txt | 2 +-
.../test-requirements.txt | 2 +-
.../test-requirements.txt | 2 +-
.../test-requirements-0.txt | 2 +-
.../test-requirements-1.txt | 2 +-
.../test-requirements.txt | 2 +-
.../opentelemetry-instrumentation-dbapi/test-requirements.txt | 2 +-
.../test-requirements-0.txt | 2 +-
.../test-requirements-1.txt | 2 +-
.../test-requirements-2.txt | 2 +-
.../test-requirements-3.txt | 2 +-
.../test-requirements-0.txt | 2 +-
.../test-requirements-1.txt | 2 +-
.../test-requirements-2.txt | 2 +-
.../test-requirements-0.txt | 2 +-
.../test-requirements-1.txt | 2 +-
.../test-requirements-2.txt | 2 +-
.../test-requirements.txt | 2 +-
.../test-requirements-0.txt | 2 +-
.../test-requirements-1.txt | 2 +-
.../test-requirements-2.txt | 2 +-
.../test-requirements-0.txt | 2 +-
.../test-requirements-1.txt | 2 +-
.../test-requirements-0.txt | 2 +-
.../test-requirements-1.txt | 2 +-
.../test-requirements.txt | 2 +-
.../test-requirements-ng.txt | 2 +-
.../test-requirements.txt | 2 +-
.../test-requirements.txt | 2 +-
.../test-requirements-0.txt | 2 +-
.../test-requirements-1.txt | 2 +-
.../test-requirements.txt | 2 +-
.../test-requirements-0.txt | 2 +-
.../test-requirements-1.txt | 2 +-
.../test-requirements-0.txt | 2 +-
.../test-requirements-1.txt | 2 +-
.../test-requirements.txt | 2 +-
.../test-requirements-0.txt | 2 +-
.../test-requirements-1.txt | 2 +-
.../test-requirements-2.txt | 2 +-
.../test-requirements-3.txt | 2 +-
.../test-requirements-4.txt | 2 +-
.../test-requirements.txt | 2 +-
.../test-requirements.txt | 2 +-
.../test-requirements.txt | 2 +-
.../opentelemetry-instrumentation-redis/test-requirements.txt | 2 +-
.../test-requirements.txt | 2 +-
.../test-requirements.txt | 2 +-
.../test-requirements-0.txt | 2 +-
.../test-requirements-1.txt | 2 +-
.../test-requirements.txt | 2 +-
.../test-requirements.txt | 2 +-
.../test-requirements.txt | 2 +-
.../test-requirements.txt | 2 +-
.../test-requirements.txt | 2 +-
.../test-requirements.txt | 2 +-
.../test-requirements.txt | 2 +-
.../test-requirements-0.txt | 2 +-
.../test-requirements-1.txt | 2 +-
.../opentelemetry-instrumentation-wsgi/test-requirements.txt | 2 +-
opentelemetry-distro/test-requirements.txt | 2 +-
opentelemetry-instrumentation/test-requirements.txt | 2 +-
.../opentelemetry-propagator-aws-xray/test-requirements.txt | 2 +-
.../opentelemetry-propagator-ot-trace/test-requirements.txt | 2 +-
.../test-requirements.txt | 2 +-
.../test-requirements.txt | 2 +-
.../opentelemetry-sdk-extension-aws/test-requirements.txt | 2 +-
tox.ini | 2 +-
util/opentelemetry-util-http/test-requirements.txt | 4 ++--
83 files changed, 84 insertions(+), 84 deletions(-)
diff --git a/exporter/opentelemetry-exporter-prometheus-remote-write/test-requirements.txt b/exporter/opentelemetry-exporter-prometheus-remote-write/test-requirements.txt
index f7e66ddd13..5836dc9764 100644
--- a/exporter/opentelemetry-exporter-prometheus-remote-write/test-requirements.txt
+++ b/exporter/opentelemetry-exporter-prometheus-remote-write/test-requirements.txt
@@ -1,4 +1,4 @@
-asgiref==3.7.2
+asgiref==3.8.1
certifi==2024.7.4
charset-normalizer==3.3.2
# We can drop this after bumping baseline to pypy-39
diff --git a/exporter/opentelemetry-exporter-richconsole/test-requirements.txt b/exporter/opentelemetry-exporter-richconsole/test-requirements.txt
index dee47c7880..0ef562821f 100644
--- a/exporter/opentelemetry-exporter-richconsole/test-requirements.txt
+++ b/exporter/opentelemetry-exporter-richconsole/test-requirements.txt
@@ -1,4 +1,4 @@
-asgiref==3.7.2
+asgiref==3.8.1
Deprecated==1.2.14
flaky==3.7.0
importlib-metadata==6.11.0
diff --git a/instrumentation/opentelemetry-instrumentation-aio-pika/test-requirements-0.txt b/instrumentation/opentelemetry-instrumentation-aio-pika/test-requirements-0.txt
index a08f6427db..de853e16c9 100644
--- a/instrumentation/opentelemetry-instrumentation-aio-pika/test-requirements-0.txt
+++ b/instrumentation/opentelemetry-instrumentation-aio-pika/test-requirements-0.txt
@@ -1,6 +1,6 @@
aio-pika==7.2.0
aiormq==6.2.3
-asgiref==3.7.2
+asgiref==3.8.1
Deprecated==1.2.14
idna==3.7
importlib-metadata==6.11.0
diff --git a/instrumentation/opentelemetry-instrumentation-aio-pika/test-requirements-1.txt b/instrumentation/opentelemetry-instrumentation-aio-pika/test-requirements-1.txt
index 99b5fdfd1f..dbfb89fe82 100644
--- a/instrumentation/opentelemetry-instrumentation-aio-pika/test-requirements-1.txt
+++ b/instrumentation/opentelemetry-instrumentation-aio-pika/test-requirements-1.txt
@@ -1,6 +1,6 @@
aio-pika==8.3.0
aiormq==6.6.4
-asgiref==3.7.2
+asgiref==3.8.1
Deprecated==1.2.14
idna==3.7
importlib-metadata==6.11.0
diff --git a/instrumentation/opentelemetry-instrumentation-aio-pika/test-requirements-2.txt b/instrumentation/opentelemetry-instrumentation-aio-pika/test-requirements-2.txt
index 7051299461..6a95bd69f0 100644
--- a/instrumentation/opentelemetry-instrumentation-aio-pika/test-requirements-2.txt
+++ b/instrumentation/opentelemetry-instrumentation-aio-pika/test-requirements-2.txt
@@ -1,6 +1,6 @@
aio-pika==9.0.5
aiormq==6.7.1
-asgiref==3.7.2
+asgiref==3.8.1
Deprecated==1.2.14
idna==3.7
importlib-metadata==6.11.0
diff --git a/instrumentation/opentelemetry-instrumentation-aio-pika/test-requirements-3.txt b/instrumentation/opentelemetry-instrumentation-aio-pika/test-requirements-3.txt
index de5e8b310f..82e742a1f4 100644
--- a/instrumentation/opentelemetry-instrumentation-aio-pika/test-requirements-3.txt
+++ b/instrumentation/opentelemetry-instrumentation-aio-pika/test-requirements-3.txt
@@ -1,6 +1,6 @@
aio-pika==9.4.1
aiormq==6.8.0
-asgiref==3.7.2
+asgiref==3.8.1
Deprecated==1.2.14
idna==3.7
importlib-metadata==6.11.0
diff --git a/instrumentation/opentelemetry-instrumentation-aiohttp-client/test-requirements.txt b/instrumentation/opentelemetry-instrumentation-aiohttp-client/test-requirements.txt
index be0311238f..dee4736133 100644
--- a/instrumentation/opentelemetry-instrumentation-aiohttp-client/test-requirements.txt
+++ b/instrumentation/opentelemetry-instrumentation-aiohttp-client/test-requirements.txt
@@ -1,6 +1,6 @@
aiohttp==3.10.2
aiosignal==1.3.1
-asgiref==3.7.2
+asgiref==3.8.1
async-timeout==4.0.3
blinker==1.7.0
certifi==2024.7.4
diff --git a/instrumentation/opentelemetry-instrumentation-aiohttp-server/test-requirements.txt b/instrumentation/opentelemetry-instrumentation-aiohttp-server/test-requirements.txt
index 9cd6a3c111..e6dff52db9 100644
--- a/instrumentation/opentelemetry-instrumentation-aiohttp-server/test-requirements.txt
+++ b/instrumentation/opentelemetry-instrumentation-aiohttp-server/test-requirements.txt
@@ -1,6 +1,6 @@
aiohttp==3.10.2
aiosignal==1.3.1
-asgiref==3.7.2
+asgiref==3.8.1
async-timeout==4.0.3
Deprecated==1.2.14
frozenlist==1.4.1
diff --git a/instrumentation/opentelemetry-instrumentation-aiopg/test-requirements.txt b/instrumentation/opentelemetry-instrumentation-aiopg/test-requirements.txt
index bc61c3d6fc..1443104081 100644
--- a/instrumentation/opentelemetry-instrumentation-aiopg/test-requirements.txt
+++ b/instrumentation/opentelemetry-instrumentation-aiopg/test-requirements.txt
@@ -1,5 +1,5 @@
aiopg==1.4.0
-asgiref==3.7.2
+asgiref==3.8.1
async-timeout==4.0.3
Deprecated==1.2.14
importlib-metadata==6.11.0
diff --git a/instrumentation/opentelemetry-instrumentation-asgi/test-requirements.txt b/instrumentation/opentelemetry-instrumentation-asgi/test-requirements.txt
index ebe439d1d2..18a11500e1 100644
--- a/instrumentation/opentelemetry-instrumentation-asgi/test-requirements.txt
+++ b/instrumentation/opentelemetry-instrumentation-asgi/test-requirements.txt
@@ -1,4 +1,4 @@
-asgiref==3.7.2
+asgiref==3.8.1
Deprecated==1.2.14
importlib-metadata==6.11.0
iniconfig==2.0.0
diff --git a/instrumentation/opentelemetry-instrumentation-asyncio/test-requirements.txt b/instrumentation/opentelemetry-instrumentation-asyncio/test-requirements.txt
index a196e8d4e3..7f20d1497c 100644
--- a/instrumentation/opentelemetry-instrumentation-asyncio/test-requirements.txt
+++ b/instrumentation/opentelemetry-instrumentation-asyncio/test-requirements.txt
@@ -1,4 +1,4 @@
-asgiref==3.7.2
+asgiref==3.8.1
Deprecated==1.2.14
importlib-metadata==6.11.0
iniconfig==2.0.0
diff --git a/instrumentation/opentelemetry-instrumentation-asyncpg/test-requirements.txt b/instrumentation/opentelemetry-instrumentation-asyncpg/test-requirements.txt
index badc61cde8..60cef50a7a 100644
--- a/instrumentation/opentelemetry-instrumentation-asyncpg/test-requirements.txt
+++ b/instrumentation/opentelemetry-instrumentation-asyncpg/test-requirements.txt
@@ -1,4 +1,4 @@
-asgiref==3.7.2
+asgiref==3.8.1
async-timeout==4.0.3
asyncpg==0.29.0
Deprecated==1.2.14
diff --git a/instrumentation/opentelemetry-instrumentation-aws-lambda/test-requirements.txt b/instrumentation/opentelemetry-instrumentation-aws-lambda/test-requirements.txt
index 6540349a2e..8d9fe19483 100644
--- a/instrumentation/opentelemetry-instrumentation-aws-lambda/test-requirements.txt
+++ b/instrumentation/opentelemetry-instrumentation-aws-lambda/test-requirements.txt
@@ -1,4 +1,4 @@
-asgiref==3.7.2
+asgiref==3.8.1
Deprecated==1.2.14
importlib-metadata==6.11.0
iniconfig==2.0.0
diff --git a/instrumentation/opentelemetry-instrumentation-boto/test-requirements.txt b/instrumentation/opentelemetry-instrumentation-boto/test-requirements.txt
index ab4819b538..fe6467d1c4 100644
--- a/instrumentation/opentelemetry-instrumentation-boto/test-requirements.txt
+++ b/instrumentation/opentelemetry-instrumentation-boto/test-requirements.txt
@@ -1,4 +1,4 @@
-asgiref==3.7.2
+asgiref==3.8.1
boto==2.49.0
boto3==1.34.44
botocore==1.34.44
diff --git a/instrumentation/opentelemetry-instrumentation-boto3sqs/test-requirements.txt b/instrumentation/opentelemetry-instrumentation-boto3sqs/test-requirements.txt
index c5942b6a72..d8a9c38315 100644
--- a/instrumentation/opentelemetry-instrumentation-boto3sqs/test-requirements.txt
+++ b/instrumentation/opentelemetry-instrumentation-boto3sqs/test-requirements.txt
@@ -1,4 +1,4 @@
-asgiref==3.7.2
+asgiref==3.8.1
boto3==1.34.44
botocore==1.34.44
Deprecated==1.2.14
diff --git a/instrumentation/opentelemetry-instrumentation-botocore/test-requirements.txt b/instrumentation/opentelemetry-instrumentation-botocore/test-requirements.txt
index e45fa6ba44..a89fdf2e30 100644
--- a/instrumentation/opentelemetry-instrumentation-botocore/test-requirements.txt
+++ b/instrumentation/opentelemetry-instrumentation-botocore/test-requirements.txt
@@ -1,4 +1,4 @@
-asgiref==3.7.2
+asgiref==3.8.1
aws-xray-sdk==2.12.1
boto3==1.28.80
botocore==1.31.80
diff --git a/instrumentation/opentelemetry-instrumentation-cassandra/test-requirements.txt b/instrumentation/opentelemetry-instrumentation-cassandra/test-requirements.txt
index dc2090627d..189b2f65d0 100644
--- a/instrumentation/opentelemetry-instrumentation-cassandra/test-requirements.txt
+++ b/instrumentation/opentelemetry-instrumentation-cassandra/test-requirements.txt
@@ -1,4 +1,4 @@
-asgiref==3.7.2
+asgiref==3.8.1
cassandra-driver==3.29.0
click==8.1.7
Deprecated==1.2.14
diff --git a/instrumentation/opentelemetry-instrumentation-celery/test-requirements-0.txt b/instrumentation/opentelemetry-instrumentation-celery/test-requirements-0.txt
index 401921f5e4..fcf838fc32 100644
--- a/instrumentation/opentelemetry-instrumentation-celery/test-requirements-0.txt
+++ b/instrumentation/opentelemetry-instrumentation-celery/test-requirements-0.txt
@@ -1,5 +1,5 @@
amqp==5.2.0
-asgiref==3.7.2
+asgiref==3.8.1
backports.zoneinfo==0.2.1
billiard==4.2.0
celery==5.3.6
diff --git a/instrumentation/opentelemetry-instrumentation-celery/test-requirements-1.txt b/instrumentation/opentelemetry-instrumentation-celery/test-requirements-1.txt
index 1c5aad2c07..76b2f03d12 100644
--- a/instrumentation/opentelemetry-instrumentation-celery/test-requirements-1.txt
+++ b/instrumentation/opentelemetry-instrumentation-celery/test-requirements-1.txt
@@ -1,5 +1,5 @@
amqp==5.2.0
-asgiref==3.7.2
+asgiref==3.8.1
billiard==4.2.0
celery==5.3.6
click==8.1.7
diff --git a/instrumentation/opentelemetry-instrumentation-confluent-kafka/test-requirements.txt b/instrumentation/opentelemetry-instrumentation-confluent-kafka/test-requirements.txt
index 5400e507f5..f78f498620 100644
--- a/instrumentation/opentelemetry-instrumentation-confluent-kafka/test-requirements.txt
+++ b/instrumentation/opentelemetry-instrumentation-confluent-kafka/test-requirements.txt
@@ -1,4 +1,4 @@
-asgiref==3.7.2
+asgiref==3.8.1
confluent-kafka==2.4.0
Deprecated==1.2.14
importlib-metadata==6.11.0
diff --git a/instrumentation/opentelemetry-instrumentation-dbapi/test-requirements.txt b/instrumentation/opentelemetry-instrumentation-dbapi/test-requirements.txt
index 0d98d28069..f76b488d90 100644
--- a/instrumentation/opentelemetry-instrumentation-dbapi/test-requirements.txt
+++ b/instrumentation/opentelemetry-instrumentation-dbapi/test-requirements.txt
@@ -1,4 +1,4 @@
-asgiref==3.7.2
+asgiref==3.8.1
Deprecated==1.2.14
importlib-metadata==6.11.0
iniconfig==2.0.0
diff --git a/instrumentation/opentelemetry-instrumentation-django/test-requirements-0.txt b/instrumentation/opentelemetry-instrumentation-django/test-requirements-0.txt
index 5f22f2cadb..9d7ee964fe 100644
--- a/instrumentation/opentelemetry-instrumentation-django/test-requirements-0.txt
+++ b/instrumentation/opentelemetry-instrumentation-django/test-requirements-0.txt
@@ -1,4 +1,4 @@
-asgiref==3.7.2
+asgiref==3.8.1
Deprecated==1.2.14
Django==2.2.28
importlib-metadata==6.11.0
diff --git a/instrumentation/opentelemetry-instrumentation-django/test-requirements-1.txt b/instrumentation/opentelemetry-instrumentation-django/test-requirements-1.txt
index 0a042a1bf5..9c21d2dfd4 100644
--- a/instrumentation/opentelemetry-instrumentation-django/test-requirements-1.txt
+++ b/instrumentation/opentelemetry-instrumentation-django/test-requirements-1.txt
@@ -1,4 +1,4 @@
-asgiref==3.7.2
+asgiref==3.8.1
Deprecated==1.2.14
Django==3.2.25
importlib-metadata==6.11.0
diff --git a/instrumentation/opentelemetry-instrumentation-django/test-requirements-2.txt b/instrumentation/opentelemetry-instrumentation-django/test-requirements-2.txt
index 4f49efb39e..d3a55aae34 100644
--- a/instrumentation/opentelemetry-instrumentation-django/test-requirements-2.txt
+++ b/instrumentation/opentelemetry-instrumentation-django/test-requirements-2.txt
@@ -1,4 +1,4 @@
-asgiref==3.7.2
+asgiref==3.8.1
backports.zoneinfo==0.2.1
Deprecated==1.2.14
Django==4.2.15
diff --git a/instrumentation/opentelemetry-instrumentation-django/test-requirements-3.txt b/instrumentation/opentelemetry-instrumentation-django/test-requirements-3.txt
index 9be1266014..89923379d3 100644
--- a/instrumentation/opentelemetry-instrumentation-django/test-requirements-3.txt
+++ b/instrumentation/opentelemetry-instrumentation-django/test-requirements-3.txt
@@ -1,4 +1,4 @@
-asgiref==3.7.2
+asgiref==3.8.1
Deprecated==1.2.14
Django==4.2.15
importlib-metadata==6.11.0
diff --git a/instrumentation/opentelemetry-instrumentation-elasticsearch/test-requirements-0.txt b/instrumentation/opentelemetry-instrumentation-elasticsearch/test-requirements-0.txt
index 07ea98e4d6..55eabe1ef5 100644
--- a/instrumentation/opentelemetry-instrumentation-elasticsearch/test-requirements-0.txt
+++ b/instrumentation/opentelemetry-instrumentation-elasticsearch/test-requirements-0.txt
@@ -1,4 +1,4 @@
-asgiref==3.7.2
+asgiref==3.8.1
Deprecated==1.2.14
elasticsearch==6.8.2
elasticsearch-dsl==6.4.0
diff --git a/instrumentation/opentelemetry-instrumentation-elasticsearch/test-requirements-1.txt b/instrumentation/opentelemetry-instrumentation-elasticsearch/test-requirements-1.txt
index 228601485d..2fab7287ad 100644
--- a/instrumentation/opentelemetry-instrumentation-elasticsearch/test-requirements-1.txt
+++ b/instrumentation/opentelemetry-instrumentation-elasticsearch/test-requirements-1.txt
@@ -1,4 +1,4 @@
-asgiref==3.7.2
+asgiref==3.8.1
Deprecated==1.2.14
elasticsearch==7.17.9
elasticsearch-dsl==7.4.1
diff --git a/instrumentation/opentelemetry-instrumentation-elasticsearch/test-requirements-2.txt b/instrumentation/opentelemetry-instrumentation-elasticsearch/test-requirements-2.txt
index 272675c119..5f2ccd41ac 100644
--- a/instrumentation/opentelemetry-instrumentation-elasticsearch/test-requirements-2.txt
+++ b/instrumentation/opentelemetry-instrumentation-elasticsearch/test-requirements-2.txt
@@ -1,4 +1,4 @@
-asgiref==3.7.2
+asgiref==3.8.1
Deprecated==1.2.14
elasticsearch==8.13.1
elasticsearch-dsl==8.13.1
diff --git a/instrumentation/opentelemetry-instrumentation-falcon/test-requirements-0.txt b/instrumentation/opentelemetry-instrumentation-falcon/test-requirements-0.txt
index d0f6381b42..6967c57b6d 100644
--- a/instrumentation/opentelemetry-instrumentation-falcon/test-requirements-0.txt
+++ b/instrumentation/opentelemetry-instrumentation-falcon/test-requirements-0.txt
@@ -1,4 +1,4 @@
-asgiref==3.7.2
+asgiref==3.8.1
Deprecated==1.2.14
falcon==1.4.1
importlib-metadata==6.11.0
diff --git a/instrumentation/opentelemetry-instrumentation-falcon/test-requirements-1.txt b/instrumentation/opentelemetry-instrumentation-falcon/test-requirements-1.txt
index 5a84f224f1..e535925b14 100644
--- a/instrumentation/opentelemetry-instrumentation-falcon/test-requirements-1.txt
+++ b/instrumentation/opentelemetry-instrumentation-falcon/test-requirements-1.txt
@@ -1,4 +1,4 @@
-asgiref==3.7.2
+asgiref==3.8.1
Deprecated==1.2.14
falcon==2.0.0
importlib-metadata==6.11.0
diff --git a/instrumentation/opentelemetry-instrumentation-falcon/test-requirements-2.txt b/instrumentation/opentelemetry-instrumentation-falcon/test-requirements-2.txt
index 0790e8a4cb..30d21e2773 100644
--- a/instrumentation/opentelemetry-instrumentation-falcon/test-requirements-2.txt
+++ b/instrumentation/opentelemetry-instrumentation-falcon/test-requirements-2.txt
@@ -1,4 +1,4 @@
-asgiref==3.7.2
+asgiref==3.8.1
Deprecated==1.2.14
falcon==3.1.1
importlib-metadata==6.11.0
diff --git a/instrumentation/opentelemetry-instrumentation-fastapi/test-requirements.txt b/instrumentation/opentelemetry-instrumentation-fastapi/test-requirements.txt
index 00242d5410..927e68f94e 100644
--- a/instrumentation/opentelemetry-instrumentation-fastapi/test-requirements.txt
+++ b/instrumentation/opentelemetry-instrumentation-fastapi/test-requirements.txt
@@ -1,6 +1,6 @@
annotated-types==0.6.0
anyio==4.3.0
-asgiref==3.7.2
+asgiref==3.8.1
certifi==2024.7.4
charset-normalizer==3.3.2
Deprecated==1.2.14
diff --git a/instrumentation/opentelemetry-instrumentation-flask/test-requirements-0.txt b/instrumentation/opentelemetry-instrumentation-flask/test-requirements-0.txt
index a222e011a7..0bd176848d 100644
--- a/instrumentation/opentelemetry-instrumentation-flask/test-requirements-0.txt
+++ b/instrumentation/opentelemetry-instrumentation-flask/test-requirements-0.txt
@@ -1,4 +1,4 @@
-asgiref==3.7.2
+asgiref==3.8.1
click==8.1.7
Deprecated==1.2.14
Flask==2.1.3
diff --git a/instrumentation/opentelemetry-instrumentation-flask/test-requirements-1.txt b/instrumentation/opentelemetry-instrumentation-flask/test-requirements-1.txt
index e799218273..d73ab497b5 100644
--- a/instrumentation/opentelemetry-instrumentation-flask/test-requirements-1.txt
+++ b/instrumentation/opentelemetry-instrumentation-flask/test-requirements-1.txt
@@ -1,4 +1,4 @@
-asgiref==3.7.2
+asgiref==3.8.1
click==8.1.7
Deprecated==1.2.14
Flask==2.2.0
diff --git a/instrumentation/opentelemetry-instrumentation-flask/test-requirements-2.txt b/instrumentation/opentelemetry-instrumentation-flask/test-requirements-2.txt
index 91ae64700c..299a347d66 100644
--- a/instrumentation/opentelemetry-instrumentation-flask/test-requirements-2.txt
+++ b/instrumentation/opentelemetry-instrumentation-flask/test-requirements-2.txt
@@ -1,4 +1,4 @@
-asgiref==3.7.2
+asgiref==3.8.1
blinker==1.7.0
click==8.1.7
Deprecated==1.2.14
diff --git a/instrumentation/opentelemetry-instrumentation-grpc/test-requirements-0.txt b/instrumentation/opentelemetry-instrumentation-grpc/test-requirements-0.txt
index 457c285715..83ec6e8e70 100644
--- a/instrumentation/opentelemetry-instrumentation-grpc/test-requirements-0.txt
+++ b/instrumentation/opentelemetry-instrumentation-grpc/test-requirements-0.txt
@@ -1,4 +1,4 @@
-asgiref==3.7.2
+asgiref==3.8.1
Deprecated==1.2.14
grpcio==1.62.0
importlib-metadata==6.11.0
diff --git a/instrumentation/opentelemetry-instrumentation-grpc/test-requirements-1.txt b/instrumentation/opentelemetry-instrumentation-grpc/test-requirements-1.txt
index 221359e184..d77d67148a 100644
--- a/instrumentation/opentelemetry-instrumentation-grpc/test-requirements-1.txt
+++ b/instrumentation/opentelemetry-instrumentation-grpc/test-requirements-1.txt
@@ -1,4 +1,4 @@
-asgiref==3.7.2
+asgiref==3.8.1
Deprecated==1.2.14
grpcio==1.63.0
importlib-metadata==6.11.0
diff --git a/instrumentation/opentelemetry-instrumentation-httpx/test-requirements-0.txt b/instrumentation/opentelemetry-instrumentation-httpx/test-requirements-0.txt
index 35ebe6b954..28b475a3a4 100644
--- a/instrumentation/opentelemetry-instrumentation-httpx/test-requirements-0.txt
+++ b/instrumentation/opentelemetry-instrumentation-httpx/test-requirements-0.txt
@@ -1,5 +1,5 @@
anyio==3.7.1
-asgiref==3.7.2
+asgiref==3.8.1
certifi==2024.7.4
Deprecated==1.2.14
exceptiongroup==1.2.0
diff --git a/instrumentation/opentelemetry-instrumentation-httpx/test-requirements-1.txt b/instrumentation/opentelemetry-instrumentation-httpx/test-requirements-1.txt
index c70677f06b..42c032a546 100644
--- a/instrumentation/opentelemetry-instrumentation-httpx/test-requirements-1.txt
+++ b/instrumentation/opentelemetry-instrumentation-httpx/test-requirements-1.txt
@@ -1,5 +1,5 @@
anyio==4.3.0
-asgiref==3.7.2
+asgiref==3.8.1
certifi==2024.7.4
Deprecated==1.2.14
exceptiongroup==1.2.0
diff --git a/instrumentation/opentelemetry-instrumentation-jinja2/test-requirements.txt b/instrumentation/opentelemetry-instrumentation-jinja2/test-requirements.txt
index 05d94d6fb0..59eabe6997 100644
--- a/instrumentation/opentelemetry-instrumentation-jinja2/test-requirements.txt
+++ b/instrumentation/opentelemetry-instrumentation-jinja2/test-requirements.txt
@@ -1,4 +1,4 @@
-asgiref==3.7.2
+asgiref==3.8.1
Deprecated==1.2.14
importlib-metadata==6.11.0
iniconfig==2.0.0
diff --git a/instrumentation/opentelemetry-instrumentation-kafka-python/test-requirements-ng.txt b/instrumentation/opentelemetry-instrumentation-kafka-python/test-requirements-ng.txt
index 7b587031ec..05e169a7e3 100644
--- a/instrumentation/opentelemetry-instrumentation-kafka-python/test-requirements-ng.txt
+++ b/instrumentation/opentelemetry-instrumentation-kafka-python/test-requirements-ng.txt
@@ -1,4 +1,4 @@
-asgiref==3.7.2
+asgiref==3.8.1
Deprecated==1.2.14
importlib-metadata==6.11.0
iniconfig==2.0.0
diff --git a/instrumentation/opentelemetry-instrumentation-kafka-python/test-requirements.txt b/instrumentation/opentelemetry-instrumentation-kafka-python/test-requirements.txt
index 4adc515de7..6582cf875b 100644
--- a/instrumentation/opentelemetry-instrumentation-kafka-python/test-requirements.txt
+++ b/instrumentation/opentelemetry-instrumentation-kafka-python/test-requirements.txt
@@ -1,4 +1,4 @@
-asgiref==3.7.2
+asgiref==3.8.1
Deprecated==1.2.14
importlib-metadata==6.11.0
iniconfig==2.0.0
diff --git a/instrumentation/opentelemetry-instrumentation-logging/test-requirements.txt b/instrumentation/opentelemetry-instrumentation-logging/test-requirements.txt
index eca8ce5f34..c0d2f044c8 100644
--- a/instrumentation/opentelemetry-instrumentation-logging/test-requirements.txt
+++ b/instrumentation/opentelemetry-instrumentation-logging/test-requirements.txt
@@ -1,4 +1,4 @@
-asgiref==3.7.2
+asgiref==3.8.1
Deprecated==1.2.14
importlib-metadata==6.11.0
iniconfig==2.0.0
diff --git a/instrumentation/opentelemetry-instrumentation-mysql/test-requirements-0.txt b/instrumentation/opentelemetry-instrumentation-mysql/test-requirements-0.txt
index 75ee9797b8..bf93434850 100644
--- a/instrumentation/opentelemetry-instrumentation-mysql/test-requirements-0.txt
+++ b/instrumentation/opentelemetry-instrumentation-mysql/test-requirements-0.txt
@@ -1,4 +1,4 @@
-asgiref==3.7.2
+asgiref==3.8.1
Deprecated==1.2.14
importlib-metadata==6.11.0
iniconfig==2.0.0
diff --git a/instrumentation/opentelemetry-instrumentation-mysql/test-requirements-1.txt b/instrumentation/opentelemetry-instrumentation-mysql/test-requirements-1.txt
index dd609e594a..1a58c16a05 100644
--- a/instrumentation/opentelemetry-instrumentation-mysql/test-requirements-1.txt
+++ b/instrumentation/opentelemetry-instrumentation-mysql/test-requirements-1.txt
@@ -1,4 +1,4 @@
-asgiref==3.7.2
+asgiref==3.8.1
Deprecated==1.2.14
importlib-metadata==6.11.0
iniconfig==2.0.0
diff --git a/instrumentation/opentelemetry-instrumentation-mysqlclient/test-requirements.txt b/instrumentation/opentelemetry-instrumentation-mysqlclient/test-requirements.txt
index 534c7869cb..8c3ed72f35 100644
--- a/instrumentation/opentelemetry-instrumentation-mysqlclient/test-requirements.txt
+++ b/instrumentation/opentelemetry-instrumentation-mysqlclient/test-requirements.txt
@@ -1,4 +1,4 @@
-asgiref==3.7.2
+asgiref==3.8.1
Deprecated==1.2.14
importlib-metadata==6.11.0
iniconfig==2.0.0
diff --git a/instrumentation/opentelemetry-instrumentation-pika/test-requirements-0.txt b/instrumentation/opentelemetry-instrumentation-pika/test-requirements-0.txt
index cc874af2cc..e06bc0b395 100644
--- a/instrumentation/opentelemetry-instrumentation-pika/test-requirements-0.txt
+++ b/instrumentation/opentelemetry-instrumentation-pika/test-requirements-0.txt
@@ -1,4 +1,4 @@
-asgiref==3.7.2
+asgiref==3.8.1
Deprecated==1.2.14
importlib-metadata==6.11.0
iniconfig==2.0.0
diff --git a/instrumentation/opentelemetry-instrumentation-pika/test-requirements-1.txt b/instrumentation/opentelemetry-instrumentation-pika/test-requirements-1.txt
index 4a09147744..8928f655c8 100644
--- a/instrumentation/opentelemetry-instrumentation-pika/test-requirements-1.txt
+++ b/instrumentation/opentelemetry-instrumentation-pika/test-requirements-1.txt
@@ -1,4 +1,4 @@
-asgiref==3.7.2
+asgiref==3.8.1
Deprecated==1.2.14
importlib-metadata==6.11.0
iniconfig==2.0.0
diff --git a/instrumentation/opentelemetry-instrumentation-psycopg/test-requirements-0.txt b/instrumentation/opentelemetry-instrumentation-psycopg/test-requirements-0.txt
index e60531b112..42bbac77d9 100644
--- a/instrumentation/opentelemetry-instrumentation-psycopg/test-requirements-0.txt
+++ b/instrumentation/opentelemetry-instrumentation-psycopg/test-requirements-0.txt
@@ -1,4 +1,4 @@
-asgiref==3.7.2
+asgiref==3.8.1
backports.zoneinfo==0.2.1
Deprecated==1.2.14
importlib-metadata==6.11.0
diff --git a/instrumentation/opentelemetry-instrumentation-psycopg/test-requirements-1.txt b/instrumentation/opentelemetry-instrumentation-psycopg/test-requirements-1.txt
index 6ad211f9c0..1f7fb59f2d 100644
--- a/instrumentation/opentelemetry-instrumentation-psycopg/test-requirements-1.txt
+++ b/instrumentation/opentelemetry-instrumentation-psycopg/test-requirements-1.txt
@@ -1,4 +1,4 @@
-asgiref==3.7.2
+asgiref==3.8.1
Deprecated==1.2.14
importlib-metadata==6.11.0
iniconfig==2.0.0
diff --git a/instrumentation/opentelemetry-instrumentation-psycopg2/test-requirements.txt b/instrumentation/opentelemetry-instrumentation-psycopg2/test-requirements.txt
index 4d6682b3d6..aa98fa93d0 100644
--- a/instrumentation/opentelemetry-instrumentation-psycopg2/test-requirements.txt
+++ b/instrumentation/opentelemetry-instrumentation-psycopg2/test-requirements.txt
@@ -1,4 +1,4 @@
-asgiref==3.7.2
+asgiref==3.8.1
Deprecated==1.2.14
importlib-metadata==6.11.0
iniconfig==2.0.0
diff --git a/instrumentation/opentelemetry-instrumentation-pymemcache/test-requirements-0.txt b/instrumentation/opentelemetry-instrumentation-pymemcache/test-requirements-0.txt
index 28a62d84b4..2c6e0e2749 100644
--- a/instrumentation/opentelemetry-instrumentation-pymemcache/test-requirements-0.txt
+++ b/instrumentation/opentelemetry-instrumentation-pymemcache/test-requirements-0.txt
@@ -1,4 +1,4 @@
-asgiref==3.7.2
+asgiref==3.8.1
Deprecated==1.2.14
importlib-metadata==6.11.0
iniconfig==2.0.0
diff --git a/instrumentation/opentelemetry-instrumentation-pymemcache/test-requirements-1.txt b/instrumentation/opentelemetry-instrumentation-pymemcache/test-requirements-1.txt
index 4be0dbee52..36db8d4416 100644
--- a/instrumentation/opentelemetry-instrumentation-pymemcache/test-requirements-1.txt
+++ b/instrumentation/opentelemetry-instrumentation-pymemcache/test-requirements-1.txt
@@ -1,4 +1,4 @@
-asgiref==3.7.2
+asgiref==3.8.1
Deprecated==1.2.14
importlib-metadata==6.11.0
iniconfig==2.0.0
diff --git a/instrumentation/opentelemetry-instrumentation-pymemcache/test-requirements-2.txt b/instrumentation/opentelemetry-instrumentation-pymemcache/test-requirements-2.txt
index f07d79374a..3e0359f731 100644
--- a/instrumentation/opentelemetry-instrumentation-pymemcache/test-requirements-2.txt
+++ b/instrumentation/opentelemetry-instrumentation-pymemcache/test-requirements-2.txt
@@ -1,4 +1,4 @@
-asgiref==3.7.2
+asgiref==3.8.1
Deprecated==1.2.14
importlib-metadata==6.11.0
iniconfig==2.0.0
diff --git a/instrumentation/opentelemetry-instrumentation-pymemcache/test-requirements-3.txt b/instrumentation/opentelemetry-instrumentation-pymemcache/test-requirements-3.txt
index 4e4871147c..916c9c9c3a 100644
--- a/instrumentation/opentelemetry-instrumentation-pymemcache/test-requirements-3.txt
+++ b/instrumentation/opentelemetry-instrumentation-pymemcache/test-requirements-3.txt
@@ -1,4 +1,4 @@
-asgiref==3.7.2
+asgiref==3.8.1
Deprecated==1.2.14
importlib-metadata==6.11.0
iniconfig==2.0.0
diff --git a/instrumentation/opentelemetry-instrumentation-pymemcache/test-requirements-4.txt b/instrumentation/opentelemetry-instrumentation-pymemcache/test-requirements-4.txt
index 28fe27f0ef..e90a138ff8 100644
--- a/instrumentation/opentelemetry-instrumentation-pymemcache/test-requirements-4.txt
+++ b/instrumentation/opentelemetry-instrumentation-pymemcache/test-requirements-4.txt
@@ -1,4 +1,4 @@
-asgiref==3.7.2
+asgiref==3.8.1
Deprecated==1.2.14
importlib-metadata==6.11.0
iniconfig==2.0.0
diff --git a/instrumentation/opentelemetry-instrumentation-pymongo/test-requirements.txt b/instrumentation/opentelemetry-instrumentation-pymongo/test-requirements.txt
index eb41ee6bd9..6c8de553b6 100644
--- a/instrumentation/opentelemetry-instrumentation-pymongo/test-requirements.txt
+++ b/instrumentation/opentelemetry-instrumentation-pymongo/test-requirements.txt
@@ -1,4 +1,4 @@
-asgiref==3.7.2
+asgiref==3.8.1
Deprecated==1.2.14
dnspython==2.6.1
importlib-metadata==6.11.0
diff --git a/instrumentation/opentelemetry-instrumentation-pymysql/test-requirements.txt b/instrumentation/opentelemetry-instrumentation-pymysql/test-requirements.txt
index 8338f79b65..7ad69f2b81 100644
--- a/instrumentation/opentelemetry-instrumentation-pymysql/test-requirements.txt
+++ b/instrumentation/opentelemetry-instrumentation-pymysql/test-requirements.txt
@@ -1,4 +1,4 @@
-asgiref==3.7.2
+asgiref==3.8.1
Deprecated==1.2.14
importlib-metadata==6.11.0
iniconfig==2.0.0
diff --git a/instrumentation/opentelemetry-instrumentation-pyramid/test-requirements.txt b/instrumentation/opentelemetry-instrumentation-pyramid/test-requirements.txt
index aa387f8177..6f33f33449 100644
--- a/instrumentation/opentelemetry-instrumentation-pyramid/test-requirements.txt
+++ b/instrumentation/opentelemetry-instrumentation-pyramid/test-requirements.txt
@@ -1,4 +1,4 @@
-asgiref==3.7.2
+asgiref==3.8.1
Deprecated==1.2.14
hupper==1.12.1
importlib-metadata==6.11.0
diff --git a/instrumentation/opentelemetry-instrumentation-redis/test-requirements.txt b/instrumentation/opentelemetry-instrumentation-redis/test-requirements.txt
index 43d4bd9788..7b8d8459b7 100644
--- a/instrumentation/opentelemetry-instrumentation-redis/test-requirements.txt
+++ b/instrumentation/opentelemetry-instrumentation-redis/test-requirements.txt
@@ -1,4 +1,4 @@
-asgiref==3.7.2
+asgiref==3.8.1
async-timeout==4.0.3
Deprecated==1.2.14
fakeredis==2.23.3
diff --git a/instrumentation/opentelemetry-instrumentation-remoulade/test-requirements.txt b/instrumentation/opentelemetry-instrumentation-remoulade/test-requirements.txt
index 727c15ec4e..b850e46f9f 100644
--- a/instrumentation/opentelemetry-instrumentation-remoulade/test-requirements.txt
+++ b/instrumentation/opentelemetry-instrumentation-remoulade/test-requirements.txt
@@ -1,4 +1,4 @@
-asgiref==3.7.2
+asgiref==3.8.1
Deprecated==1.2.14
importlib-metadata==6.11.0
iniconfig==2.0.0
diff --git a/instrumentation/opentelemetry-instrumentation-requests/test-requirements.txt b/instrumentation/opentelemetry-instrumentation-requests/test-requirements.txt
index 03d0a793a6..9f40c6d5b2 100644
--- a/instrumentation/opentelemetry-instrumentation-requests/test-requirements.txt
+++ b/instrumentation/opentelemetry-instrumentation-requests/test-requirements.txt
@@ -1,4 +1,4 @@
-asgiref==3.7.2
+asgiref==3.8.1
certifi==2024.7.4
charset-normalizer==3.3.2
Deprecated==1.2.14
diff --git a/instrumentation/opentelemetry-instrumentation-sqlalchemy/test-requirements-0.txt b/instrumentation/opentelemetry-instrumentation-sqlalchemy/test-requirements-0.txt
index 407222e8f6..45992bc2e1 100644
--- a/instrumentation/opentelemetry-instrumentation-sqlalchemy/test-requirements-0.txt
+++ b/instrumentation/opentelemetry-instrumentation-sqlalchemy/test-requirements-0.txt
@@ -1,4 +1,4 @@
-asgiref==3.7.2
+asgiref==3.8.1
cffi==1.15.1
Deprecated==1.2.14
importlib-metadata==6.11.0
diff --git a/instrumentation/opentelemetry-instrumentation-sqlalchemy/test-requirements-1.txt b/instrumentation/opentelemetry-instrumentation-sqlalchemy/test-requirements-1.txt
index 9b1b15debc..eb1ee371b7 100644
--- a/instrumentation/opentelemetry-instrumentation-sqlalchemy/test-requirements-1.txt
+++ b/instrumentation/opentelemetry-instrumentation-sqlalchemy/test-requirements-1.txt
@@ -1,5 +1,5 @@
aiosqlite==0.20.0
-asgiref==3.7.2
+asgiref==3.8.1
Deprecated==1.2.14
greenlet==3.0.3
importlib-metadata==6.11.0
diff --git a/instrumentation/opentelemetry-instrumentation-sqlite3/test-requirements.txt b/instrumentation/opentelemetry-instrumentation-sqlite3/test-requirements.txt
index 8c98e702b4..e260861814 100644
--- a/instrumentation/opentelemetry-instrumentation-sqlite3/test-requirements.txt
+++ b/instrumentation/opentelemetry-instrumentation-sqlite3/test-requirements.txt
@@ -1,4 +1,4 @@
-asgiref==3.7.2
+asgiref==3.8.1
Deprecated==1.2.14
importlib-metadata==6.11.0
iniconfig==2.0.0
diff --git a/instrumentation/opentelemetry-instrumentation-starlette/test-requirements.txt b/instrumentation/opentelemetry-instrumentation-starlette/test-requirements.txt
index 1d5b91e188..d81a15a40c 100644
--- a/instrumentation/opentelemetry-instrumentation-starlette/test-requirements.txt
+++ b/instrumentation/opentelemetry-instrumentation-starlette/test-requirements.txt
@@ -1,5 +1,5 @@
anyio==4.3.0
-asgiref==3.7.2
+asgiref==3.8.1
certifi==2024.7.4
charset-normalizer==3.3.2
Deprecated==1.2.14
diff --git a/instrumentation/opentelemetry-instrumentation-system-metrics/test-requirements.txt b/instrumentation/opentelemetry-instrumentation-system-metrics/test-requirements.txt
index 506499ea13..76f2f2a4e7 100644
--- a/instrumentation/opentelemetry-instrumentation-system-metrics/test-requirements.txt
+++ b/instrumentation/opentelemetry-instrumentation-system-metrics/test-requirements.txt
@@ -1,4 +1,4 @@
-asgiref==3.7.2
+asgiref==3.8.1
Deprecated==1.2.14
importlib-metadata==6.11.0
iniconfig==2.0.0
diff --git a/instrumentation/opentelemetry-instrumentation-threading/test-requirements.txt b/instrumentation/opentelemetry-instrumentation-threading/test-requirements.txt
index 45ee66cf01..2d13857e9e 100644
--- a/instrumentation/opentelemetry-instrumentation-threading/test-requirements.txt
+++ b/instrumentation/opentelemetry-instrumentation-threading/test-requirements.txt
@@ -1,4 +1,4 @@
-asgiref==3.7.2
+asgiref==3.8.1
Deprecated==1.2.14
importlib-metadata==6.11.0
iniconfig==2.0.0
diff --git a/instrumentation/opentelemetry-instrumentation-tornado/test-requirements.txt b/instrumentation/opentelemetry-instrumentation-tornado/test-requirements.txt
index fb542966de..236c45f87b 100644
--- a/instrumentation/opentelemetry-instrumentation-tornado/test-requirements.txt
+++ b/instrumentation/opentelemetry-instrumentation-tornado/test-requirements.txt
@@ -1,4 +1,4 @@
-asgiref==3.7.2
+asgiref==3.8.1
blinker==1.7.0
certifi==2024.7.4
charset-normalizer==3.3.2
diff --git a/instrumentation/opentelemetry-instrumentation-tortoiseorm/test-requirements.txt b/instrumentation/opentelemetry-instrumentation-tortoiseorm/test-requirements.txt
index cb31845d66..31b044a2f3 100644
--- a/instrumentation/opentelemetry-instrumentation-tortoiseorm/test-requirements.txt
+++ b/instrumentation/opentelemetry-instrumentation-tortoiseorm/test-requirements.txt
@@ -1,6 +1,6 @@
aiosqlite==0.17.0
annotated-types==0.6.0
-asgiref==3.7.2
+asgiref==3.8.1
Deprecated==1.2.14
importlib-metadata==6.11.0
iniconfig==2.0.0
diff --git a/instrumentation/opentelemetry-instrumentation-urllib/test-requirements.txt b/instrumentation/opentelemetry-instrumentation-urllib/test-requirements.txt
index 9e11fb272f..06bc8322dc 100644
--- a/instrumentation/opentelemetry-instrumentation-urllib/test-requirements.txt
+++ b/instrumentation/opentelemetry-instrumentation-urllib/test-requirements.txt
@@ -1,4 +1,4 @@
-asgiref==3.7.2
+asgiref==3.8.1
Deprecated==1.2.14
httpretty==1.1.4
importlib-metadata==6.11.0
diff --git a/instrumentation/opentelemetry-instrumentation-urllib3/test-requirements-0.txt b/instrumentation/opentelemetry-instrumentation-urllib3/test-requirements-0.txt
index 1d6ebc18af..e7392b0c31 100644
--- a/instrumentation/opentelemetry-instrumentation-urllib3/test-requirements-0.txt
+++ b/instrumentation/opentelemetry-instrumentation-urllib3/test-requirements-0.txt
@@ -1,4 +1,4 @@
-asgiref==3.7.2
+asgiref==3.8.1
Deprecated==1.2.14
httpretty==1.1.4
importlib-metadata==6.11.0
diff --git a/instrumentation/opentelemetry-instrumentation-urllib3/test-requirements-1.txt b/instrumentation/opentelemetry-instrumentation-urllib3/test-requirements-1.txt
index 06df34d16b..21cb3acbe6 100644
--- a/instrumentation/opentelemetry-instrumentation-urllib3/test-requirements-1.txt
+++ b/instrumentation/opentelemetry-instrumentation-urllib3/test-requirements-1.txt
@@ -1,4 +1,4 @@
-asgiref==3.7.2
+asgiref==3.8.1
Deprecated==1.2.14
httpretty==1.1.4
importlib-metadata==6.11.0
diff --git a/instrumentation/opentelemetry-instrumentation-wsgi/test-requirements.txt b/instrumentation/opentelemetry-instrumentation-wsgi/test-requirements.txt
index 0f7c7ced73..d63bd5a637 100644
--- a/instrumentation/opentelemetry-instrumentation-wsgi/test-requirements.txt
+++ b/instrumentation/opentelemetry-instrumentation-wsgi/test-requirements.txt
@@ -1,4 +1,4 @@
-asgiref==3.7.2
+asgiref==3.8.1
Deprecated==1.2.14
importlib-metadata==6.11.0
iniconfig==2.0.0
diff --git a/opentelemetry-distro/test-requirements.txt b/opentelemetry-distro/test-requirements.txt
index d9190daa26..050054c39b 100644
--- a/opentelemetry-distro/test-requirements.txt
+++ b/opentelemetry-distro/test-requirements.txt
@@ -1,4 +1,4 @@
-asgiref==3.7.2
+asgiref==3.8.1
Deprecated==1.2.14
importlib-metadata==6.11.0
iniconfig==2.0.0
diff --git a/opentelemetry-instrumentation/test-requirements.txt b/opentelemetry-instrumentation/test-requirements.txt
index 6cd12fad24..31f1ef76ab 100644
--- a/opentelemetry-instrumentation/test-requirements.txt
+++ b/opentelemetry-instrumentation/test-requirements.txt
@@ -1,4 +1,4 @@
-asgiref==3.7.2
+asgiref==3.8.1
Deprecated==1.2.14
importlib-metadata==6.11.0
iniconfig==2.0.0
diff --git a/propagator/opentelemetry-propagator-aws-xray/test-requirements.txt b/propagator/opentelemetry-propagator-aws-xray/test-requirements.txt
index 8589a794a4..4587d87629 100644
--- a/propagator/opentelemetry-propagator-aws-xray/test-requirements.txt
+++ b/propagator/opentelemetry-propagator-aws-xray/test-requirements.txt
@@ -1,4 +1,4 @@
-asgiref==3.7.2
+asgiref==3.8.1
certifi==2024.7.4
charset-normalizer==3.3.2
Deprecated==1.2.14
diff --git a/propagator/opentelemetry-propagator-ot-trace/test-requirements.txt b/propagator/opentelemetry-propagator-ot-trace/test-requirements.txt
index 0a72c3c823..b556c4f0cc 100644
--- a/propagator/opentelemetry-propagator-ot-trace/test-requirements.txt
+++ b/propagator/opentelemetry-propagator-ot-trace/test-requirements.txt
@@ -1,4 +1,4 @@
-asgiref==3.7.2
+asgiref==3.8.1
Deprecated==1.2.14
importlib-metadata==6.11.0
iniconfig==2.0.0
diff --git a/resource/opentelemetry-resource-detector-azure/test-requirements.txt b/resource/opentelemetry-resource-detector-azure/test-requirements.txt
index 028c41e65d..2b29359fbb 100644
--- a/resource/opentelemetry-resource-detector-azure/test-requirements.txt
+++ b/resource/opentelemetry-resource-detector-azure/test-requirements.txt
@@ -1,4 +1,4 @@
-asgiref==3.7.2
+asgiref==3.8.1
Deprecated==1.2.14
importlib-metadata==6.11.0
iniconfig==2.0.0
diff --git a/resource/opentelemetry-resource-detector-container/test-requirements.txt b/resource/opentelemetry-resource-detector-container/test-requirements.txt
index 8a926fff71..f7b5b71fcf 100644
--- a/resource/opentelemetry-resource-detector-container/test-requirements.txt
+++ b/resource/opentelemetry-resource-detector-container/test-requirements.txt
@@ -1,4 +1,4 @@
-asgiref==3.7.2
+asgiref==3.8.1
Deprecated==1.2.14
importlib-metadata==6.11.0
iniconfig==2.0.0
diff --git a/sdk-extension/opentelemetry-sdk-extension-aws/test-requirements.txt b/sdk-extension/opentelemetry-sdk-extension-aws/test-requirements.txt
index 27199627a1..1fa968a8b3 100644
--- a/sdk-extension/opentelemetry-sdk-extension-aws/test-requirements.txt
+++ b/sdk-extension/opentelemetry-sdk-extension-aws/test-requirements.txt
@@ -1,4 +1,4 @@
-asgiref==3.7.2
+asgiref==3.8.1
Deprecated==1.2.14
importlib-metadata==6.11.0
iniconfig==2.0.0
diff --git a/tox.ini b/tox.ini
index 8552948b6b..600929a6ec 100644
--- a/tox.ini
+++ b/tox.ini
@@ -1190,7 +1190,7 @@ basepython: python3
deps =
aiopg==1.4.0
amqp==5.2.0
- asgiref==3.7.2
+ asgiref==3.8.1
async-timeout==4.0.3
asyncpg==0.29.0
attrs==23.2.0
diff --git a/util/opentelemetry-util-http/test-requirements.txt b/util/opentelemetry-util-http/test-requirements.txt
index cb1ffe135b..1769daa094 100644
--- a/util/opentelemetry-util-http/test-requirements.txt
+++ b/util/opentelemetry-util-http/test-requirements.txt
@@ -1,4 +1,4 @@
-asgiref==3.7.2
+asgiref==3.8.1
Deprecated==1.2.14
importlib-metadata==6.11.0
iniconfig==2.0.0
@@ -8,4 +8,4 @@ py-cpuinfo==9.0.0
pytest==7.4.4
tomli==2.0.1
typing_extensions==4.10.0
--e opentelemetry-instrumentation
\ No newline at end of file
+-e opentelemetry-instrumentation
From d6e667f3eb975a369f5e40eea05add3bb701d425 Mon Sep 17 00:00:00 2001
From: Blueswen
Date: Wed, 4 Sep 2024 19:55:00 +0800
Subject: [PATCH 16/33] Update README.rst (#2849)
The URL link is incorrect; it should be a repository in the open-telemetry account.
---
opentelemetry-instrumentation/README.rst | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/opentelemetry-instrumentation/README.rst b/opentelemetry-instrumentation/README.rst
index 6f66edb623..3ed88c213f 100644
--- a/opentelemetry-instrumentation/README.rst
+++ b/opentelemetry-instrumentation/README.rst
@@ -40,7 +40,7 @@ to figure out which instrumentation packages the user might want to install. By
prints out a list of the default and detected instrumentation packages that can be added to a
requirements.txt file. It also supports installing the packages when run with
:code:`--action=install` or :code:`-a install` flag. All default and detectable
-instrumentation packages are defined `here `.
+instrumentation packages are defined `here `.
opentelemetry-instrument
From 6c5730f31a430da360c6d1cf8abc0ee3166a0376 Mon Sep 17 00:00:00 2001
From: rama280290 <131746267+rama280290@users.noreply.github.com>
Date: Wed, 4 Sep 2024 17:54:25 +0530
Subject: [PATCH 17/33] Update test_jinja2.py (#2491)
Cross-site scripting (XSS) attacks can occur if untrusted input is not escaped. This applies to templates as well as code. The jinja2 templates may be vulnerable to XSS if the environment has autoescape set to False. Unfortunately, jinja2 sets autoescape to False by default. Explicitly setting autoescape to True when creating an Environment object will prevent this.
Signed-off-by: Rajendran, Ramasubramanian
---
.../opentelemetry-instrumentation-jinja2/tests/test_jinja2.py | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/instrumentation/opentelemetry-instrumentation-jinja2/tests/test_jinja2.py b/instrumentation/opentelemetry-instrumentation-jinja2/tests/test_jinja2.py
index 26ba98e69b..98344c47e4 100644
--- a/instrumentation/opentelemetry-instrumentation-jinja2/tests/test_jinja2.py
+++ b/instrumentation/opentelemetry-instrumentation-jinja2/tests/test_jinja2.py
@@ -143,7 +143,7 @@ def test_generate_inline_template(self):
def test_file_template_with_root(self):
with self.tracer.start_as_current_span("root"):
loader = jinja2.loaders.FileSystemLoader(TMPL_DIR)
- env = jinja2.Environment(loader=loader)
+ env = jinja2.Environment(loader=loader, autoescape=True)
template = env.get_template("template.html")
self.assertEqual(
template.render(name="Jinja"), "Message: Hello Jinja!"
@@ -164,7 +164,7 @@ def test_file_template_with_root(self):
def test_file_template(self):
loader = jinja2.loaders.FileSystemLoader(TMPL_DIR)
- env = jinja2.Environment(loader=loader)
+ env = jinja2.Environment(loader=loader, autoescape=True)
template = env.get_template("template.html")
self.assertEqual(
template.render(name="Jinja"), "Message: Hello Jinja!"
From afb7f54b50faf5444ba6498fe6cf7c13181f9cd2 Mon Sep 17 00:00:00 2001
From: Diego Hurtado
Date: Wed, 4 Sep 2024 08:06:58 -0600
Subject: [PATCH 18/33] Remove ocelotl from component owners (#2848)
---
.github/component_owners.yml | 14 --------------
1 file changed, 14 deletions(-)
diff --git a/.github/component_owners.yml b/.github/component_owners.yml
index b092d5d2c3..e3ca06b450 100644
--- a/.github/component_owners.yml
+++ b/.github/component_owners.yml
@@ -45,27 +45,13 @@ components:
instrumentation/opentelemetry-instrumentation-urllib:
- shalevr
- - ocelotl
instrumentation/opentelemetry-instrumentation-urllib3:
- shalevr
- - ocelotl
instrumentation/opentelemetry-instrumentation-sqlalchemy:
- shalevr
- instrumentation/opentelemetry-instrumentation-flask:
- - ocelotl
-
- instrumentation/opentelemetry-instrumentation-jinja2:
- - ocelotl
-
- instrumentation/opentelemetry-instrumentation-logging:
- - ocelotl
-
- instrumentation/opentelemetry-instrumentation-requests:
- - ocelotl
-
instrumentation/opentelemetry-instrumentation-cassandra:
- mattcontinisio
From f1d91097d88335ac39c8b3ed949e224d80f6105e Mon Sep 17 00:00:00 2001
From: kaushik95
Date: Wed, 4 Sep 2024 22:09:17 +0530
Subject: [PATCH 19/33] 973 opentelemetry instrumentation psycopg2 (#2840)
---
.../tests/test_psycopg2_integration.py | 12 ++++++++++++
1 file changed, 12 insertions(+)
diff --git a/instrumentation/opentelemetry-instrumentation-psycopg2/tests/test_psycopg2_integration.py b/instrumentation/opentelemetry-instrumentation-psycopg2/tests/test_psycopg2_integration.py
index 369d63d5cf..6671073043 100644
--- a/instrumentation/opentelemetry-instrumentation-psycopg2/tests/test_psycopg2_integration.py
+++ b/instrumentation/opentelemetry-instrumentation-psycopg2/tests/test_psycopg2_integration.py
@@ -18,6 +18,7 @@
import psycopg2
import opentelemetry.instrumentation.psycopg2
+from opentelemetry import trace
from opentelemetry.instrumentation.psycopg2 import Psycopg2Instrumentor
from opentelemetry.sdk import resources
from opentelemetry.test.test_base import TestBase
@@ -269,3 +270,14 @@ def test_sqlcommenter_disabled(self, event_mocked):
cursor.execute(query)
kwargs = event_mocked.call_args[1]
self.assertEqual(kwargs["enable_commenter"], False)
+
+ def test_no_op_tracer_provider(self):
+ Psycopg2Instrumentor().instrument(
+ tracer_provider=trace.NoOpTracerProvider()
+ )
+ cnx = psycopg2.connect(database="test")
+ cursor = cnx.cursor()
+ query = "SELECT * FROM test"
+ cursor.execute(query)
+ spans_list = self.memory_exporter.get_finished_spans()
+ self.assertEqual(len(spans_list), 0)
From 9cced9757ace5688de08ae1d58acf87c7da92cf8 Mon Sep 17 00:00:00 2001
From: Riccardo Magliocchetti
Date: Wed, 4 Sep 2024 19:45:06 +0200
Subject: [PATCH 20/33] CONTRIBUTING: add a note about instrumentation
versioning and depdendencies (#2851)
---
CONTRIBUTING.md | 1 +
1 file changed, 1 insertion(+)
diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md
index 9072a6a641..61f261f001 100644
--- a/CONTRIBUTING.md
+++ b/CONTRIBUTING.md
@@ -275,6 +275,7 @@ Below is a checklist of things to be mindful of when implementing a new instrume
- Isolate sync and async test
- For synchronous tests, the typical test case class is inherited from `opentelemetry.test.test_base.TestBase`. However, if you want to write asynchronous tests, the test case class should inherit also from `IsolatedAsyncioTestCase`. Adding asynchronous tests to a common test class can lead to tests passing without actually running, which can be misleading.
- ex.
+- All instrumentations have the same version. If you are going to develop a new instrumentation it would probably have `X.Y.dev` version and depends on `opentelemetry-instrumentation` and `opentelemetry-semantic-conventions` for the same version. That means that if you want to install your instrumentation you need to install its dependencies from this repo and the core repo also from git.
## Expectations from contributors
From 02c956190d784383fa6a52f4c7a16ca9a416b3b5 Mon Sep 17 00:00:00 2001
From: Tobias Backer Dirks
Date: Tue, 10 Sep 2024 17:45:06 +0300
Subject: [PATCH 21/33] feat: add ability to optionally disable internal HTTP
send and receive spans (#2802)
---
CHANGELOG.md | 2 +
.../instrumentation/asgi/__init__.py | 174 +++++++++++-------
.../tests/test_asgi_middleware.py | 24 +++
.../instrumentation/fastapi/__init__.py | 29 ++-
4 files changed, 160 insertions(+), 69 deletions(-)
diff --git a/CHANGELOG.md b/CHANGELOG.md
index 003f8054f6..d091ddeb9b 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -14,6 +14,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
- `opentelemetry-instrumentation-kafka-python` Instrument temporary fork, kafka-python-ng
inside kafka-python's instrumentation
([#2537](https://github.com/open-telemetry/opentelemetry-python-contrib/pull/2537))
+- `opentelemetry-instrumentation-asgi`, `opentelemetry-instrumentation-fastapi` Add ability to disable internal HTTP send and receive spans
+ ([#2802](https://github.com/open-telemetry/opentelemetry-python-contrib/pull/2802))
### Breaking changes
diff --git a/instrumentation/opentelemetry-instrumentation-asgi/src/opentelemetry/instrumentation/asgi/__init__.py b/instrumentation/opentelemetry-instrumentation-asgi/src/opentelemetry/instrumentation/asgi/__init__.py
index 420fd512d6..d25ca41017 100644
--- a/instrumentation/opentelemetry-instrumentation-asgi/src/opentelemetry/instrumentation/asgi/__init__.py
+++ b/instrumentation/opentelemetry-instrumentation-asgi/src/opentelemetry/instrumentation/asgi/__init__.py
@@ -483,7 +483,7 @@ def get_default_span_details(scope: dict) -> Tuple[str, dict]:
def _collect_target_attribute(
- scope: typing.Dict[str, typing.Any]
+ scope: typing.Dict[str, typing.Any],
) -> typing.Optional[str]:
"""
Returns the target path as defined by the Semantic Conventions.
@@ -529,6 +529,7 @@ class OpenTelemetryMiddleware:
the current globally configured one is used.
meter_provider: The optional meter provider to use. If omitted
the current globally configured one is used.
+ exclude_spans: Optionally exclude HTTP `send` and/or `receive` spans from the trace.
"""
# pylint: disable=too-many-branches
@@ -547,6 +548,7 @@ def __init__(
http_capture_headers_server_request: list[str] | None = None,
http_capture_headers_server_response: list[str] | None = None,
http_capture_headers_sanitize_fields: list[str] | None = None,
+ exclude_spans: list[typing.Literal["receive", "send"]] | None = None,
):
# initialize semantic conventions opt-in if needed
_OpenTelemetrySemanticConventionStability._initialize()
@@ -653,6 +655,12 @@ def __init__(
)
or []
)
+ self.exclude_receive_span = (
+ "receive" in exclude_spans if exclude_spans else False
+ )
+ self.exclude_send_span = (
+ "send" in exclude_spans if exclude_spans else False
+ )
# pylint: disable=too-many-statements
async def __call__(
@@ -796,8 +804,10 @@ async def __call__(
span.end()
# pylint: enable=too-many-branches
-
def _get_otel_receive(self, server_span_name, scope, receive):
+ if self.exclude_receive_span:
+ return receive
+
@wraps(receive)
async def otel_receive():
with self.tracer.start_as_current_span(
@@ -821,6 +831,66 @@ async def otel_receive():
return otel_receive
+ def _set_send_span(
+ self,
+ server_span_name,
+ scope,
+ send,
+ message,
+ status_code,
+ expecting_trailers,
+ ):
+ """Set send span attributes and status code."""
+ with self.tracer.start_as_current_span(
+ " ".join((server_span_name, scope["type"], "send"))
+ ) as send_span:
+ if callable(self.client_response_hook):
+ self.client_response_hook(send_span, scope, message)
+
+ if send_span.is_recording():
+ if message["type"] == "http.response.start":
+ expecting_trailers = message.get("trailers", False)
+ send_span.set_attribute("asgi.event.type", message["type"])
+
+ if status_code:
+ set_status_code(
+ send_span,
+ status_code,
+ None,
+ self._sem_conv_opt_in_mode,
+ )
+ return expecting_trailers
+
+ def _set_server_span(
+ self, server_span, message, status_code, duration_attrs
+ ):
+ """Set server span attributes and status code."""
+ if (
+ server_span.is_recording()
+ and server_span.kind == trace.SpanKind.SERVER
+ and "headers" in message
+ ):
+ custom_response_attributes = (
+ collect_custom_headers_attributes(
+ message,
+ self.http_capture_headers_sanitize_fields,
+ self.http_capture_headers_server_response,
+ normalise_response_header_name,
+ )
+ if self.http_capture_headers_server_response
+ else {}
+ )
+ if len(custom_response_attributes) > 0:
+ server_span.set_attributes(custom_response_attributes)
+
+ if status_code:
+ set_status_code(
+ server_span,
+ status_code,
+ duration_attrs,
+ self._sem_conv_opt_in_mode,
+ )
+
def _get_otel_send(
self,
server_span,
@@ -834,74 +904,46 @@ def _get_otel_send(
@wraps(send)
async def otel_send(message: dict[str, Any]):
nonlocal expecting_trailers
- with self.tracer.start_as_current_span(
- " ".join((server_span_name, scope["type"], "send"))
- ) as send_span:
- if callable(self.client_response_hook):
- self.client_response_hook(send_span, scope, message)
- status_code = None
- if message["type"] == "http.response.start":
- status_code = message["status"]
- elif message["type"] == "websocket.send":
- status_code = 200
-
- if send_span.is_recording():
- if message["type"] == "http.response.start":
- expecting_trailers = message.get("trailers", False)
- send_span.set_attribute("asgi.event.type", message["type"])
- if (
- server_span.is_recording()
- and server_span.kind == trace.SpanKind.SERVER
- and "headers" in message
- ):
- custom_response_attributes = (
- collect_custom_headers_attributes(
- message,
- self.http_capture_headers_sanitize_fields,
- self.http_capture_headers_server_response,
- normalise_response_header_name,
- )
- if self.http_capture_headers_server_response
- else {}
- )
- if len(custom_response_attributes) > 0:
- server_span.set_attributes(
- custom_response_attributes
- )
- if status_code:
- # We record metrics only once
- set_status_code(
- server_span,
- status_code,
- duration_attrs,
- self._sem_conv_opt_in_mode,
- )
- set_status_code(
- send_span,
- status_code,
- None,
- self._sem_conv_opt_in_mode,
- )
+ status_code = None
+ if message["type"] == "http.response.start":
+ status_code = message["status"]
+ elif message["type"] == "websocket.send":
+ status_code = 200
- propagator = get_global_response_propagator()
- if propagator:
- propagator.inject(
- message,
- context=set_span_in_context(
- server_span, trace.context_api.Context()
- ),
- setter=asgi_setter,
- )
+ if not self.exclude_send_span:
+ expecting_trailers = self._set_send_span(
+ server_span_name,
+ scope,
+ send,
+ message,
+ status_code,
+ expecting_trailers,
+ )
- content_length = asgi_getter.get(message, "content-length")
- if content_length:
- try:
- self.content_length_header = int(content_length[0])
- except ValueError:
- pass
+ self._set_server_span(
+ server_span, message, status_code, duration_attrs
+ )
+
+ propagator = get_global_response_propagator()
+ if propagator:
+ propagator.inject(
+ message,
+ context=set_span_in_context(
+ server_span, trace.context_api.Context()
+ ),
+ setter=asgi_setter,
+ )
+
+ content_length = asgi_getter.get(message, "content-length")
+ if content_length:
+ try:
+ self.content_length_header = int(content_length[0])
+ except ValueError:
+ pass
+
+ await send(message)
- await send(message)
# pylint: disable=too-many-boolean-expressions
if (
not expecting_trailers
diff --git a/instrumentation/opentelemetry-instrumentation-asgi/tests/test_asgi_middleware.py b/instrumentation/opentelemetry-instrumentation-asgi/tests/test_asgi_middleware.py
index a21dd626c8..a9d7897ea6 100644
--- a/instrumentation/opentelemetry-instrumentation-asgi/tests/test_asgi_middleware.py
+++ b/instrumentation/opentelemetry-instrumentation-asgi/tests/test_asgi_middleware.py
@@ -566,6 +566,30 @@ async def test_background_execution(self):
_SIMULATED_BACKGROUND_TASK_EXECUTION_TIME_S * 10**9,
)
+ async def test_exclude_internal_spans(self):
+ """Test that internal spans are excluded from the emitted spans when
+ the `exclude_receive_span` or `exclude_send_span` attributes are set.
+ """
+ cases = [
+ (["receive", "send"], ["GET / http receive", "GET / http send"]),
+ (["send"], ["GET / http send"]),
+ (["receive"], ["GET / http receive"]),
+ ([], []),
+ ]
+ for exclude_spans, excluded_spans in cases:
+ self.memory_exporter.clear()
+ app = otel_asgi.OpenTelemetryMiddleware(
+ simple_asgi, exclude_spans=exclude_spans
+ )
+ self.seed_app(app)
+ await self.send_default_request()
+ await self.get_all_output()
+ span_list = self.memory_exporter.get_finished_spans()
+ self.assertTrue(span_list)
+ for span in span_list:
+ for excluded_span in excluded_spans:
+ self.assertNotEqual(span.name, excluded_span)
+
async def test_trailers(self):
"""Test that trailers are emitted as expected and that the server span is ended
BEFORE the background task is finished."""
diff --git a/instrumentation/opentelemetry-instrumentation-fastapi/src/opentelemetry/instrumentation/fastapi/__init__.py b/instrumentation/opentelemetry-instrumentation-fastapi/src/opentelemetry/instrumentation/fastapi/__init__.py
index 37a293764e..7e4d0aac07 100644
--- a/instrumentation/opentelemetry-instrumentation-fastapi/src/opentelemetry/instrumentation/fastapi/__init__.py
+++ b/instrumentation/opentelemetry-instrumentation-fastapi/src/opentelemetry/instrumentation/fastapi/__init__.py
@@ -179,7 +179,7 @@ def client_response_hook(span: Span, scope: dict[str, Any], message: dict[str, A
from __future__ import annotations
import logging
-from typing import Collection
+from typing import Collection, Literal
import fastapi
from starlette.routing import Match
@@ -222,7 +222,7 @@ class FastAPIInstrumentor(BaseInstrumentor):
@staticmethod
def instrument_app(
- app: fastapi.FastAPI,
+ app,
server_request_hook: ServerRequestHook = None,
client_request_hook: ClientRequestHook = None,
client_response_hook: ClientResponseHook = None,
@@ -232,8 +232,28 @@ def instrument_app(
http_capture_headers_server_request: list[str] | None = None,
http_capture_headers_server_response: list[str] | None = None,
http_capture_headers_sanitize_fields: list[str] | None = None,
+ exclude_spans: list[Literal["receive", "send"]] | None = None,
):
- """Instrument an uninstrumented FastAPI application."""
+ """Instrument an uninstrumented FastAPI application.
+
+ Args:
+ app: The fastapi ASGI application callable to forward requests to.
+ server_request_hook: Optional callback which is called with the server span and ASGI
+ scope object for every incoming request.
+ client_request_hook: Optional callback which is called with the internal span, and ASGI
+ scope and event which are sent as dictionaries for when the method receive is called.
+ client_response_hook: Optional callback which is called with the internal span, and ASGI
+ scope and event which are sent as dictionaries for when the method send is called.
+ tracer_provider: The optional tracer provider to use. If omitted
+ the current globally configured one is used.
+ meter_provider: The optional meter provider to use. If omitted
+ the current globally configured one is used.
+ excluded_urls: Optional comma delimited string of regexes to match URLs that should not be traced.
+ http_capture_headers_server_request: Optional list of HTTP headers to capture from the request.
+ http_capture_headers_server_response: Optional list of HTTP headers to capture from the response.
+ http_capture_headers_sanitize_fields: Optional list of HTTP headers to sanitize.
+ exclude_spans: Optionally exclude HTTP `send` and/or `receive` spans from the trace.
+ """
if not hasattr(app, "_is_instrumented_by_opentelemetry"):
app._is_instrumented_by_opentelemetry = False
@@ -273,6 +293,7 @@ def instrument_app(
http_capture_headers_server_request=http_capture_headers_server_request,
http_capture_headers_server_response=http_capture_headers_server_response,
http_capture_headers_sanitize_fields=http_capture_headers_sanitize_fields,
+ exclude_spans=exclude_spans,
)
app._is_instrumented_by_opentelemetry = True
if app not in _InstrumentedFastAPI._instrumented_fastapi_apps:
@@ -323,6 +344,7 @@ def _instrument(self, **kwargs):
else parse_excluded_urls(_excluded_urls)
)
_InstrumentedFastAPI._meter_provider = kwargs.get("meter_provider")
+ _InstrumentedFastAPI._exclude_spans = kwargs.get("exclude_spans")
fastapi.FastAPI = _InstrumentedFastAPI
def _uninstrument(self, **kwargs):
@@ -373,6 +395,7 @@ def __init__(self, *args, **kwargs):
http_capture_headers_server_request=_InstrumentedFastAPI._http_capture_headers_server_request,
http_capture_headers_server_response=_InstrumentedFastAPI._http_capture_headers_server_response,
http_capture_headers_sanitize_fields=_InstrumentedFastAPI._http_capture_headers_sanitize_fields,
+ exclude_spans=_InstrumentedFastAPI._exclude_spans,
)
self._is_instrumented_by_opentelemetry = True
_InstrumentedFastAPI._instrumented_fastapi_apps.add(self)
From 6f1a17d8dd5d2f2f51cfe9d65e57cc8d16632154 Mon Sep 17 00:00:00 2001
From: Jared Tan
Date: Tue, 10 Sep 2024 23:43:44 +0800
Subject: [PATCH 22/33] fix grpc supported version (#2845)
---
CHANGELOG.md | 2 ++
instrumentation/README.md | 2 +-
.../opentelemetry-instrumentation-grpc/pyproject.toml | 2 +-
.../src/opentelemetry/instrumentation/grpc/package.py | 2 +-
.../src/opentelemetry/instrumentation/bootstrap_gen.py | 2 +-
5 files changed, 6 insertions(+), 4 deletions(-)
diff --git a/CHANGELOG.md b/CHANGELOG.md
index d091ddeb9b..07510f643c 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -50,6 +50,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
([#2814](https://github.com/open-telemetry/opentelemetry-python-contrib/pull/2814))
- `opentelemetry-instrumentation` Fix the description of `http.server.duration` and `http.server.request.duration`
([#2753](https://github.com/open-telemetry/opentelemetry-python-contrib/pull/2753))
+- `opentelemetry-instrumentation-grpc` Fix grpc supported version
+ ([#2845](https://github.com/open-telemetry/opentelemetry-python-contrib/pull/2845))
## Version 1.26.0/0.47b0 (2024-07-23)
diff --git a/instrumentation/README.md b/instrumentation/README.md
index 22c4241bab..3558027ea9 100644
--- a/instrumentation/README.md
+++ b/instrumentation/README.md
@@ -21,7 +21,7 @@
| [opentelemetry-instrumentation-falcon](./opentelemetry-instrumentation-falcon) | falcon >= 1.4.1, < 4.0.0 | Yes | experimental
| [opentelemetry-instrumentation-fastapi](./opentelemetry-instrumentation-fastapi) | fastapi ~= 0.58 | Yes | migration
| [opentelemetry-instrumentation-flask](./opentelemetry-instrumentation-flask) | flask >= 1.0 | Yes | migration
-| [opentelemetry-instrumentation-grpc](./opentelemetry-instrumentation-grpc) | grpcio ~= 1.27 | No | experimental
+| [opentelemetry-instrumentation-grpc](./opentelemetry-instrumentation-grpc) | grpcio >= 1.42.0 | No | experimental
| [opentelemetry-instrumentation-httpx](./opentelemetry-instrumentation-httpx) | httpx >= 0.18.0 | No | migration
| [opentelemetry-instrumentation-jinja2](./opentelemetry-instrumentation-jinja2) | jinja2 >= 2.7, < 4.0 | No | experimental
| [opentelemetry-instrumentation-kafka-python](./opentelemetry-instrumentation-kafka-python) | kafka-python >= 2.0, < 3.0,kafka-python-ng >= 2.0, < 3.0 | No | experimental
diff --git a/instrumentation/opentelemetry-instrumentation-grpc/pyproject.toml b/instrumentation/opentelemetry-instrumentation-grpc/pyproject.toml
index e1956aeeea..fd84d6aac0 100644
--- a/instrumentation/opentelemetry-instrumentation-grpc/pyproject.toml
+++ b/instrumentation/opentelemetry-instrumentation-grpc/pyproject.toml
@@ -33,7 +33,7 @@ dependencies = [
[project.optional-dependencies]
instruments = [
- "grpcio ~= 1.27",
+ "grpcio >= 1.42.0",
]
[project.entry-points.opentelemetry_instrumentor]
diff --git a/instrumentation/opentelemetry-instrumentation-grpc/src/opentelemetry/instrumentation/grpc/package.py b/instrumentation/opentelemetry-instrumentation-grpc/src/opentelemetry/instrumentation/grpc/package.py
index 91bdeab555..66ef914bdb 100644
--- a/instrumentation/opentelemetry-instrumentation-grpc/src/opentelemetry/instrumentation/grpc/package.py
+++ b/instrumentation/opentelemetry-instrumentation-grpc/src/opentelemetry/instrumentation/grpc/package.py
@@ -13,4 +13,4 @@
# limitations under the License.
-_instruments = ("grpcio ~= 1.27",)
+_instruments = ("grpcio >= 1.42.0",)
diff --git a/opentelemetry-instrumentation/src/opentelemetry/instrumentation/bootstrap_gen.py b/opentelemetry-instrumentation/src/opentelemetry/instrumentation/bootstrap_gen.py
index 8c4293f261..616675ee80 100644
--- a/opentelemetry-instrumentation/src/opentelemetry/instrumentation/bootstrap_gen.py
+++ b/opentelemetry-instrumentation/src/opentelemetry/instrumentation/bootstrap_gen.py
@@ -89,7 +89,7 @@
"instrumentation": "opentelemetry-instrumentation-flask==0.49b0.dev",
},
{
- "library": "grpcio ~= 1.27",
+ "library": "grpcio >= 1.42.0",
"instrumentation": "opentelemetry-instrumentation-grpc==0.49b0.dev",
},
{
From d135f20c2984ea76c4ea4df79e0c6af4f73d295b Mon Sep 17 00:00:00 2001
From: Jeremy Voss
Date: Thu, 12 Sep 2024 00:36:59 -0700
Subject: [PATCH 23/33] Fastapi auto tests (#2860)
* ep test passes
* cleaned ep test
* Corrected mock paths.
* with installed works
* tests pass
* Clean up
* Clean up
* lint
* lint
---
CHANGELOG.md | 3 +
.../tests/test_fastapi_instrumentation.py | 58 ++++++++++++++++++-
2 files changed, 60 insertions(+), 1 deletion(-)
diff --git a/CHANGELOG.md b/CHANGELOG.md
index 07510f643c..977f4eea8f 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -7,6 +7,9 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
## Unreleased
+- `opentelemetry-instrumentation-fastapi` Add autoinstrumentation mechanism tests.
+ ([#2860](https://github.com/open-telemetry/opentelemetry-python-contrib/pull/2860))
+
## Version 1.27.0/0.48b0 ()
### Added
diff --git a/instrumentation/opentelemetry-instrumentation-fastapi/tests/test_fastapi_instrumentation.py b/instrumentation/opentelemetry-instrumentation-fastapi/tests/test_fastapi_instrumentation.py
index 634c74af6b..b8a6ef010e 100644
--- a/instrumentation/opentelemetry-instrumentation-fastapi/tests/test_fastapi_instrumentation.py
+++ b/instrumentation/opentelemetry-instrumentation-fastapi/tests/test_fastapi_instrumentation.py
@@ -16,12 +16,13 @@
import unittest
from timeit import default_timer
-from unittest.mock import patch
+from unittest.mock import Mock, patch
import fastapi
from fastapi.middleware.httpsredirect import HTTPSRedirectMiddleware
from fastapi.responses import JSONResponse
from fastapi.testclient import TestClient
+from pkg_resources import DistributionNotFound, iter_entry_points
import opentelemetry.instrumentation.fastapi as otel_fastapi
from opentelemetry import trace
@@ -34,6 +35,9 @@
_server_duration_attrs_old,
)
from opentelemetry.instrumentation.asgi import OpenTelemetryMiddleware
+from opentelemetry.instrumentation.auto_instrumentation._load import (
+ _load_instrumentors,
+)
from opentelemetry.sdk.metrics.export import (
HistogramDataPoint,
NumberDataPoint,
@@ -1024,6 +1028,18 @@ def client_response_hook(send_span, scope, message):
)
+def get_distribution_with_fastapi(*args, **kwargs):
+ dist = args[0]
+ if dist == "fastapi~=0.58":
+ # Value does not matter. Only whether an exception is thrown
+ return None
+ raise DistributionNotFound()
+
+
+def get_distribution_without_fastapi(*args, **kwargs):
+ raise DistributionNotFound()
+
+
class TestAutoInstrumentation(TestBaseAutoFastAPI):
"""Test the auto-instrumented variant
@@ -1031,6 +1047,46 @@ class TestAutoInstrumentation(TestBaseAutoFastAPI):
to both.
"""
+ def test_entry_point_exists(self):
+ eps = iter_entry_points("opentelemetry_instrumentor")
+ ep = next(eps)
+ self.assertEqual(ep.dist.key, "opentelemetry-instrumentation-fastapi")
+ self.assertEqual(
+ ep.module_name, "opentelemetry.instrumentation.fastapi"
+ )
+ self.assertEqual(ep.attrs, ("FastAPIInstrumentor",))
+ self.assertEqual(ep.name, "fastapi")
+ self.assertIsNone(next(eps, None))
+
+ @patch("opentelemetry.instrumentation.dependencies.get_distribution")
+ def test_instruments_with_fastapi_installed(self, mock_get_distribution):
+ mock_get_distribution.side_effect = get_distribution_with_fastapi
+ mock_distro = Mock()
+ _load_instrumentors(mock_distro)
+ mock_get_distribution.assert_called_once_with("fastapi~=0.58")
+ self.assertEqual(len(mock_distro.load_instrumentor.call_args_list), 1)
+ args = mock_distro.load_instrumentor.call_args.args
+ ep = args[0]
+ self.assertEqual(ep.dist.key, "opentelemetry-instrumentation-fastapi")
+ self.assertEqual(
+ ep.module_name, "opentelemetry.instrumentation.fastapi"
+ )
+ self.assertEqual(ep.attrs, ("FastAPIInstrumentor",))
+ self.assertEqual(ep.name, "fastapi")
+
+ @patch("opentelemetry.instrumentation.dependencies.get_distribution")
+ def test_instruments_without_fastapi_installed(
+ self, mock_get_distribution
+ ):
+ mock_get_distribution.side_effect = get_distribution_without_fastapi
+ mock_distro = Mock()
+ _load_instrumentors(mock_distro)
+ mock_get_distribution.assert_called_once_with("fastapi~=0.58")
+ with self.assertRaises(DistributionNotFound):
+ mock_get_distribution("fastapi~=0.58")
+ self.assertEqual(len(mock_distro.load_instrumentor.call_args_list), 0)
+ mock_distro.load_instrumentor.assert_not_called()
+
def _create_app(self):
# instrumentation is handled by the instrument call
resource = Resource.create({"key1": "value1", "key2": "value2"})
From bed13f513645742f58c42003196c0ac934d8c773 Mon Sep 17 00:00:00 2001
From: BryanFauble <17128019+BryanFauble@users.noreply.github.com>
Date: Fri, 13 Sep 2024 06:53:13 -0700
Subject: [PATCH 24/33] Add consistent import statement for URLLibInstrumentor
(#2868)
* Add consistent import statement for URLLibInstrumentor
* Correct code in example
* One last correction to doc to create instance
---
.../opentelemetry-instrumentation-urllib/README.rst | 6 ++++--
1 file changed, 4 insertions(+), 2 deletions(-)
diff --git a/instrumentation/opentelemetry-instrumentation-urllib/README.rst b/instrumentation/opentelemetry-instrumentation-urllib/README.rst
index c78e092fb4..f673fb07f9 100644
--- a/instrumentation/opentelemetry-instrumentation-urllib/README.rst
+++ b/instrumentation/opentelemetry-instrumentation-urllib/README.rst
@@ -29,6 +29,8 @@ The hooks can be configured as follows:
.. code:: python
+ from opentelemetry.instrumentation.urllib import URLLibInstrumentor
+
# `request_obj` is an instance of urllib.request.Request
def request_hook(span, request_obj):
pass
@@ -38,8 +40,8 @@ The hooks can be configured as follows:
def response_hook(span, request_obj, response)
pass
- URLLibInstrumentor.instrument(
- request_hook=request_hook, response_hook=response_hook)
+ URLLibInstrumentor().instrument(
+ request_hook=request_hook, response_hook=response_hook
)
Exclude lists
From 1a39ac80f87bcb8b9203fdd042835153dfc0df6e Mon Sep 17 00:00:00 2001
From: Dmitriy
Date: Tue, 17 Sep 2024 00:02:39 +0500
Subject: [PATCH 25/33] feat: add opentelemetry-instrumentation-aiokafka
(#2082)
---
.github/workflows/lint_0.yml | 18 +
.github/workflows/test_1.yml | 108 +++++
CHANGELOG.md | 4 +
docs-requirements.txt | 1 +
docs/instrumentation/aiokafka/aiokafka.rst | 10 +
instrumentation/README.md | 1 +
.../LICENSE | 201 ++++++++++
.../README.rst | 22 ++
.../pyproject.toml | 49 +++
.../instrumentation/aiokafka/__init__.py | 135 +++++++
.../instrumentation/aiokafka/package.py | 16 +
.../instrumentation/aiokafka/utils.py | 370 ++++++++++++++++++
.../instrumentation/aiokafka/version.py | 15 +
.../test-requirements.txt | 4 +
.../tests/__init__.py | 0
.../tests/test_instrumentation.py | 40 ++
.../tests/test_utils.py | 306 +++++++++++++++
.../pyproject.toml | 1 +
.../instrumentation/bootstrap_gen.py | 4 +
tox.ini | 17 +
20 files changed, 1322 insertions(+)
create mode 100644 docs/instrumentation/aiokafka/aiokafka.rst
create mode 100644 instrumentation/opentelemetry-instrumentation-aiokafka/LICENSE
create mode 100644 instrumentation/opentelemetry-instrumentation-aiokafka/README.rst
create mode 100644 instrumentation/opentelemetry-instrumentation-aiokafka/pyproject.toml
create mode 100644 instrumentation/opentelemetry-instrumentation-aiokafka/src/opentelemetry/instrumentation/aiokafka/__init__.py
create mode 100644 instrumentation/opentelemetry-instrumentation-aiokafka/src/opentelemetry/instrumentation/aiokafka/package.py
create mode 100644 instrumentation/opentelemetry-instrumentation-aiokafka/src/opentelemetry/instrumentation/aiokafka/utils.py
create mode 100644 instrumentation/opentelemetry-instrumentation-aiokafka/src/opentelemetry/instrumentation/aiokafka/version.py
create mode 100644 instrumentation/opentelemetry-instrumentation-aiokafka/test-requirements.txt
create mode 100644 instrumentation/opentelemetry-instrumentation-aiokafka/tests/__init__.py
create mode 100644 instrumentation/opentelemetry-instrumentation-aiokafka/tests/test_instrumentation.py
create mode 100644 instrumentation/opentelemetry-instrumentation-aiokafka/tests/test_utils.py
diff --git a/.github/workflows/lint_0.yml b/.github/workflows/lint_0.yml
index b5d20541e5..2236dc422c 100644
--- a/.github/workflows/lint_0.yml
+++ b/.github/workflows/lint_0.yml
@@ -970,6 +970,24 @@ jobs:
- name: Run tests
run: tox -e lint-instrumentation-aio-pika
+ lint-instrumentation-aiokafka:
+ name: instrumentation-aiokafka
+ runs-on: ubuntu-latest
+ steps:
+ - name: Checkout repo @ SHA - ${{ github.sha }}
+ uses: actions/checkout@v4
+
+ - name: Set up Python 3.12
+ uses: actions/setup-python@v5
+ with:
+ python-version: "3.12"
+
+ - name: Install tox
+ run: pip install tox
+
+ - name: Run tests
+ run: tox -e lint-instrumentation-aiokafka
+
lint-instrumentation-kafka-python:
name: instrumentation-kafka-python
runs-on: ubuntu-latest
diff --git a/.github/workflows/test_1.yml b/.github/workflows/test_1.yml
index f7e71dd6b6..30ca4e67d2 100644
--- a/.github/workflows/test_1.yml
+++ b/.github/workflows/test_1.yml
@@ -3094,6 +3094,114 @@ jobs:
- name: Run tests
run: tox -e pypy3-test-instrumentation-aio-pika-3 -- -ra
+ py38-test-instrumentation-aiokafka_ubuntu-latest:
+ name: instrumentation-aiokafka 3.8 Ubuntu
+ runs-on: ubuntu-latest
+ steps:
+ - name: Checkout repo @ SHA - ${{ github.sha }}
+ uses: actions/checkout@v4
+
+ - name: Set up Python 3.8
+ uses: actions/setup-python@v5
+ with:
+ python-version: "3.8"
+
+ - name: Install tox
+ run: pip install tox
+
+ - name: Run tests
+ run: tox -e py38-test-instrumentation-aiokafka -- -ra
+
+ py39-test-instrumentation-aiokafka_ubuntu-latest:
+ name: instrumentation-aiokafka 3.9 Ubuntu
+ runs-on: ubuntu-latest
+ steps:
+ - name: Checkout repo @ SHA - ${{ github.sha }}
+ uses: actions/checkout@v4
+
+ - name: Set up Python 3.9
+ uses: actions/setup-python@v5
+ with:
+ python-version: "3.9"
+
+ - name: Install tox
+ run: pip install tox
+
+ - name: Run tests
+ run: tox -e py39-test-instrumentation-aiokafka -- -ra
+
+ py310-test-instrumentation-aiokafka_ubuntu-latest:
+ name: instrumentation-aiokafka 3.10 Ubuntu
+ runs-on: ubuntu-latest
+ steps:
+ - name: Checkout repo @ SHA - ${{ github.sha }}
+ uses: actions/checkout@v4
+
+ - name: Set up Python 3.10
+ uses: actions/setup-python@v5
+ with:
+ python-version: "3.10"
+
+ - name: Install tox
+ run: pip install tox
+
+ - name: Run tests
+ run: tox -e py310-test-instrumentation-aiokafka -- -ra
+
+ py311-test-instrumentation-aiokafka_ubuntu-latest:
+ name: instrumentation-aiokafka 3.11 Ubuntu
+ runs-on: ubuntu-latest
+ steps:
+ - name: Checkout repo @ SHA - ${{ github.sha }}
+ uses: actions/checkout@v4
+
+ - name: Set up Python 3.11
+ uses: actions/setup-python@v5
+ with:
+ python-version: "3.11"
+
+ - name: Install tox
+ run: pip install tox
+
+ - name: Run tests
+ run: tox -e py311-test-instrumentation-aiokafka -- -ra
+
+ py312-test-instrumentation-aiokafka_ubuntu-latest:
+ name: instrumentation-aiokafka 3.12 Ubuntu
+ runs-on: ubuntu-latest
+ steps:
+ - name: Checkout repo @ SHA - ${{ github.sha }}
+ uses: actions/checkout@v4
+
+ - name: Set up Python 3.12
+ uses: actions/setup-python@v5
+ with:
+ python-version: "3.12"
+
+ - name: Install tox
+ run: pip install tox
+
+ - name: Run tests
+ run: tox -e py312-test-instrumentation-aiokafka -- -ra
+
+ pypy3-test-instrumentation-aiokafka_ubuntu-latest:
+ name: instrumentation-aiokafka pypy-3.8 Ubuntu
+ runs-on: ubuntu-latest
+ steps:
+ - name: Checkout repo @ SHA - ${{ github.sha }}
+ uses: actions/checkout@v4
+
+ - name: Set up Python pypy-3.8
+ uses: actions/setup-python@v5
+ with:
+ python-version: "pypy-3.8"
+
+ - name: Install tox
+ run: pip install tox
+
+ - name: Run tests
+ run: tox -e pypy3-test-instrumentation-aiokafka -- -ra
+
py38-test-instrumentation-kafka-python_ubuntu-latest:
name: instrumentation-kafka-python 3.8 Ubuntu
runs-on: ubuntu-latest
diff --git a/CHANGELOG.md b/CHANGELOG.md
index 977f4eea8f..7fa1ab2ba3 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -7,8 +7,12 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
## Unreleased
+### Added
+
- `opentelemetry-instrumentation-fastapi` Add autoinstrumentation mechanism tests.
([#2860](https://github.com/open-telemetry/opentelemetry-python-contrib/pull/2860))
+- `opentelemetry-instrumentation-aiokafka` Add instrumentor and auto instrumentation support for aiokafka
+ ([#2082](https://github.com/open-telemetry/opentelemetry-python-contrib/pull/2082))
## Version 1.27.0/0.48b0 ()
diff --git a/docs-requirements.txt b/docs-requirements.txt
index 34ce74ca7a..6342594af3 100644
--- a/docs-requirements.txt
+++ b/docs-requirements.txt
@@ -20,6 +20,7 @@ django>=2.2
# Required by instrumentation and exporter packages
aio_pika~=7.2.0
aiohttp~=3.0
+aiokafka~=0.11.0
aiopg>=0.13.0,<1.3.0
asyncpg>=0.12.0
boto~=2.0
diff --git a/docs/instrumentation/aiokafka/aiokafka.rst b/docs/instrumentation/aiokafka/aiokafka.rst
new file mode 100644
index 0000000000..4ff9c57c81
--- /dev/null
+++ b/docs/instrumentation/aiokafka/aiokafka.rst
@@ -0,0 +1,10 @@
+.. include:: ../../../instrumentation/opentelemetry-instrumentation-aiokafka/README.rst
+ :end-before: References
+
+API
+---
+
+.. automodule:: opentelemetry.instrumentation.aiokafka
+ :members:
+ :undoc-members:
+ :show-inheritance:
diff --git a/instrumentation/README.md b/instrumentation/README.md
index 3558027ea9..b87bf6f844 100644
--- a/instrumentation/README.md
+++ b/instrumentation/README.md
@@ -4,6 +4,7 @@
| [opentelemetry-instrumentation-aio-pika](./opentelemetry-instrumentation-aio-pika) | aio_pika >= 7.2.0, < 10.0.0 | No | experimental
| [opentelemetry-instrumentation-aiohttp-client](./opentelemetry-instrumentation-aiohttp-client) | aiohttp ~= 3.0 | No | migration
| [opentelemetry-instrumentation-aiohttp-server](./opentelemetry-instrumentation-aiohttp-server) | aiohttp ~= 3.0 | No | experimental
+| [opentelemetry-instrumentation-aiokafka](./opentelemetry-instrumentation-aiokafka) | aiokafka >= 0.8, < 1.0 | No | experimental
| [opentelemetry-instrumentation-aiopg](./opentelemetry-instrumentation-aiopg) | aiopg >= 0.13.0, < 2.0.0 | No | experimental
| [opentelemetry-instrumentation-asgi](./opentelemetry-instrumentation-asgi) | asgiref ~= 3.0 | Yes | migration
| [opentelemetry-instrumentation-asyncio](./opentelemetry-instrumentation-asyncio) | asyncio | No | experimental
diff --git a/instrumentation/opentelemetry-instrumentation-aiokafka/LICENSE b/instrumentation/opentelemetry-instrumentation-aiokafka/LICENSE
new file mode 100644
index 0000000000..261eeb9e9f
--- /dev/null
+++ b/instrumentation/opentelemetry-instrumentation-aiokafka/LICENSE
@@ -0,0 +1,201 @@
+ Apache License
+ Version 2.0, January 2004
+ http://www.apache.org/licenses/
+
+ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
+
+ 1. Definitions.
+
+ "License" shall mean the terms and conditions for use, reproduction,
+ and distribution as defined by Sections 1 through 9 of this document.
+
+ "Licensor" shall mean the copyright owner or entity authorized by
+ the copyright owner that is granting the License.
+
+ "Legal Entity" shall mean the union of the acting entity and all
+ other entities that control, are controlled by, or are under common
+ control with that entity. For the purposes of this definition,
+ "control" means (i) the power, direct or indirect, to cause the
+ direction or management of such entity, whether by contract or
+ otherwise, or (ii) ownership of fifty percent (50%) or more of the
+ outstanding shares, or (iii) beneficial ownership of such entity.
+
+ "You" (or "Your") shall mean an individual or Legal Entity
+ exercising permissions granted by this License.
+
+ "Source" form shall mean the preferred form for making modifications,
+ including but not limited to software source code, documentation
+ source, and configuration files.
+
+ "Object" form shall mean any form resulting from mechanical
+ transformation or translation of a Source form, including but
+ not limited to compiled object code, generated documentation,
+ and conversions to other media types.
+
+ "Work" shall mean the work of authorship, whether in Source or
+ Object form, made available under the License, as indicated by a
+ copyright notice that is included in or attached to the work
+ (an example is provided in the Appendix below).
+
+ "Derivative Works" shall mean any work, whether in Source or Object
+ form, that is based on (or derived from) the Work and for which the
+ editorial revisions, annotations, elaborations, or other modifications
+ represent, as a whole, an original work of authorship. For the purposes
+ of this License, Derivative Works shall not include works that remain
+ separable from, or merely link (or bind by name) to the interfaces of,
+ the Work and Derivative Works thereof.
+
+ "Contribution" shall mean any work of authorship, including
+ the original version of the Work and any modifications or additions
+ to that Work or Derivative Works thereof, that is intentionally
+ submitted to Licensor for inclusion in the Work by the copyright owner
+ or by an individual or Legal Entity authorized to submit on behalf of
+ the copyright owner. For the purposes of this definition, "submitted"
+ means any form of electronic, verbal, or written communication sent
+ to the Licensor or its representatives, including but not limited to
+ communication on electronic mailing lists, source code control systems,
+ and issue tracking systems that are managed by, or on behalf of, the
+ Licensor for the purpose of discussing and improving the Work, but
+ excluding communication that is conspicuously marked or otherwise
+ designated in writing by the copyright owner as "Not a Contribution."
+
+ "Contributor" shall mean Licensor and any individual or Legal Entity
+ on behalf of whom a Contribution has been received by Licensor and
+ subsequently incorporated within the Work.
+
+ 2. Grant of Copyright License. Subject to the terms and conditions of
+ this License, each Contributor hereby grants to You a perpetual,
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
+ copyright license to reproduce, prepare Derivative Works of,
+ publicly display, publicly perform, sublicense, and distribute the
+ Work and such Derivative Works in Source or Object form.
+
+ 3. Grant of Patent License. Subject to the terms and conditions of
+ this License, each Contributor hereby grants to You a perpetual,
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
+ (except as stated in this section) patent license to make, have made,
+ use, offer to sell, sell, import, and otherwise transfer the Work,
+ where such license applies only to those patent claims licensable
+ by such Contributor that are necessarily infringed by their
+ Contribution(s) alone or by combination of their Contribution(s)
+ with the Work to which such Contribution(s) was submitted. If You
+ institute patent litigation against any entity (including a
+ cross-claim or counterclaim in a lawsuit) alleging that the Work
+ or a Contribution incorporated within the Work constitutes direct
+ or contributory patent infringement, then any patent licenses
+ granted to You under this License for that Work shall terminate
+ as of the date such litigation is filed.
+
+ 4. Redistribution. You may reproduce and distribute copies of the
+ Work or Derivative Works thereof in any medium, with or without
+ modifications, and in Source or Object form, provided that You
+ meet the following conditions:
+
+ (a) You must give any other recipients of the Work or
+ Derivative Works a copy of this License; and
+
+ (b) You must cause any modified files to carry prominent notices
+ stating that You changed the files; and
+
+ (c) You must retain, in the Source form of any Derivative Works
+ that You distribute, all copyright, patent, trademark, and
+ attribution notices from the Source form of the Work,
+ excluding those notices that do not pertain to any part of
+ the Derivative Works; and
+
+ (d) If the Work includes a "NOTICE" text file as part of its
+ distribution, then any Derivative Works that You distribute must
+ include a readable copy of the attribution notices contained
+ within such NOTICE file, excluding those notices that do not
+ pertain to any part of the Derivative Works, in at least one
+ of the following places: within a NOTICE text file distributed
+ as part of the Derivative Works; within the Source form or
+ documentation, if provided along with the Derivative Works; or,
+ within a display generated by the Derivative Works, if and
+ wherever such third-party notices normally appear. The contents
+ of the NOTICE file are for informational purposes only and
+ do not modify the License. You may add Your own attribution
+ notices within Derivative Works that You distribute, alongside
+ or as an addendum to the NOTICE text from the Work, provided
+ that such additional attribution notices cannot be construed
+ as modifying the License.
+
+ You may add Your own copyright statement to Your modifications and
+ may provide additional or different license terms and conditions
+ for use, reproduction, or distribution of Your modifications, or
+ for any such Derivative Works as a whole, provided Your use,
+ reproduction, and distribution of the Work otherwise complies with
+ the conditions stated in this License.
+
+ 5. Submission of Contributions. Unless You explicitly state otherwise,
+ any Contribution intentionally submitted for inclusion in the Work
+ by You to the Licensor shall be under the terms and conditions of
+ this License, without any additional terms or conditions.
+ Notwithstanding the above, nothing herein shall supersede or modify
+ the terms of any separate license agreement you may have executed
+ with Licensor regarding such Contributions.
+
+ 6. Trademarks. This License does not grant permission to use the trade
+ names, trademarks, service marks, or product names of the Licensor,
+ except as required for reasonable and customary use in describing the
+ origin of the Work and reproducing the content of the NOTICE file.
+
+ 7. Disclaimer of Warranty. Unless required by applicable law or
+ agreed to in writing, Licensor provides the Work (and each
+ Contributor provides its Contributions) on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
+ implied, including, without limitation, any warranties or conditions
+ of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
+ PARTICULAR PURPOSE. You are solely responsible for determining the
+ appropriateness of using or redistributing the Work and assume any
+ risks associated with Your exercise of permissions under this License.
+
+ 8. Limitation of Liability. In no event and under no legal theory,
+ whether in tort (including negligence), contract, or otherwise,
+ unless required by applicable law (such as deliberate and grossly
+ negligent acts) or agreed to in writing, shall any Contributor be
+ liable to You for damages, including any direct, indirect, special,
+ incidental, or consequential damages of any character arising as a
+ result of this License or out of the use or inability to use the
+ Work (including but not limited to damages for loss of goodwill,
+ work stoppage, computer failure or malfunction, or any and all
+ other commercial damages or losses), even if such Contributor
+ has been advised of the possibility of such damages.
+
+ 9. Accepting Warranty or Additional Liability. While redistributing
+ the Work or Derivative Works thereof, You may choose to offer,
+ and charge a fee for, acceptance of support, warranty, indemnity,
+ or other liability obligations and/or rights consistent with this
+ License. However, in accepting such obligations, You may act only
+ on Your own behalf and on Your sole responsibility, not on behalf
+ of any other Contributor, and only if You agree to indemnify,
+ defend, and hold each Contributor harmless for any liability
+ incurred by, or claims asserted against, such Contributor by reason
+ of your accepting any such warranty or additional liability.
+
+ END OF TERMS AND CONDITIONS
+
+ APPENDIX: How to apply the Apache License to your work.
+
+ To apply the Apache License to your work, attach the following
+ boilerplate notice, with the fields enclosed by brackets "[]"
+ replaced with your own identifying information. (Don't include
+ the brackets!) The text should be enclosed in the appropriate
+ comment syntax for the file format. We also recommend that a
+ file or class name and description of purpose be included on the
+ same "printed page" as the copyright notice for easier
+ identification within third-party archives.
+
+ Copyright [yyyy] [name of copyright owner]
+
+ Licensed under the Apache License, Version 2.0 (the "License");
+ you may not use this file except in compliance with the License.
+ You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
diff --git a/instrumentation/opentelemetry-instrumentation-aiokafka/README.rst b/instrumentation/opentelemetry-instrumentation-aiokafka/README.rst
new file mode 100644
index 0000000000..33a3645fbd
--- /dev/null
+++ b/instrumentation/opentelemetry-instrumentation-aiokafka/README.rst
@@ -0,0 +1,22 @@
+OpenTelemetry aiokafka instrumentation
+=======================================
+
+|pypi|
+
+.. |pypi| image:: https://badge.fury.io/py/opentelemetry-instrumentation-aiokafka.svg
+ :target: https://pypi.org/project/opentelemetry-instrumentation-aiokafka/
+
+Installation
+------------
+
+::
+
+ pip install opentelemetry-instrumentation-aiokafka
+
+
+References
+----------
+
+* `OpenTelemetry aiokafka Instrumentation `_
+* `OpenTelemetry Project `_
+* `OpenTelemetry Python Examples `_
diff --git a/instrumentation/opentelemetry-instrumentation-aiokafka/pyproject.toml b/instrumentation/opentelemetry-instrumentation-aiokafka/pyproject.toml
new file mode 100644
index 0000000000..b2c72bc397
--- /dev/null
+++ b/instrumentation/opentelemetry-instrumentation-aiokafka/pyproject.toml
@@ -0,0 +1,49 @@
+[build-system]
+requires = ["hatchling"]
+build-backend = "hatchling.build"
+
+[project]
+name = "opentelemetry-instrumentation-aiokafka"
+dynamic = ["version"]
+description = "OpenTelemetry aiokafka instrumentation"
+readme = "README.rst"
+license = "Apache-2.0"
+requires-python = ">=3.8"
+authors = [
+ { name = "OpenTelemetry Authors", email = "cncf-opentelemetry-contributors@lists.cncf.io" },
+]
+classifiers = [
+ "Development Status :: 4 - Beta",
+ "Intended Audience :: Developers",
+ "License :: OSI Approved :: Apache Software License",
+ "Programming Language :: Python",
+ "Programming Language :: Python :: 3",
+ "Programming Language :: Python :: 3.8",
+ "Programming Language :: Python :: 3.9",
+ "Programming Language :: Python :: 3.10",
+ "Programming Language :: Python :: 3.11",
+ "Programming Language :: Python :: 3.12",
+]
+dependencies = [
+ "opentelemetry-api ~= 1.27",
+ "opentelemetry-instrumentation == 0.49b0.dev",
+ "opentelemetry-semantic-conventions == 0.49b0.dev",
+]
+
+[project.optional-dependencies]
+instruments = ["aiokafka >= 0.8, < 1.0"]
+
+[project.entry-points.opentelemetry_instrumentor]
+aiokafka = "opentelemetry.instrumentation.aiokafka:AIOKafkaInstrumentor"
+
+[project.urls]
+Homepage = "https://github.com/open-telemetry/opentelemetry-python-contrib/tree/main/instrumentation/opentelemetry-instrumentation-aiokafka"
+
+[tool.hatch.version]
+path = "src/opentelemetry/instrumentation/aiokafka/version.py"
+
+[tool.hatch.build.targets.sdist]
+include = ["/src", "/tests"]
+
+[tool.hatch.build.targets.wheel]
+packages = ["src/opentelemetry"]
diff --git a/instrumentation/opentelemetry-instrumentation-aiokafka/src/opentelemetry/instrumentation/aiokafka/__init__.py b/instrumentation/opentelemetry-instrumentation-aiokafka/src/opentelemetry/instrumentation/aiokafka/__init__.py
new file mode 100644
index 0000000000..5b2b0cd0e8
--- /dev/null
+++ b/instrumentation/opentelemetry-instrumentation-aiokafka/src/opentelemetry/instrumentation/aiokafka/__init__.py
@@ -0,0 +1,135 @@
+# Copyright The OpenTelemetry Authors
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+
+"""
+Instrument aiokafka to report instrumentation-kafka produced and consumed messages
+
+Usage
+-----
+
+..code:: python
+
+ from opentelemetry.instrumentation.aiokafka import AIOKafkaInstrumentor
+ from aiokafka import AIOKafkaProducer, AIOKafkaConsumer
+
+ # Instrument kafka
+ AIOKafkaInstrumentor().instrument()
+
+ # report a span of type producer with the default settings
+ producer = AIOKafkaProducer(bootstrap_servers=['localhost:9092'])
+ await producer.send('my-topic', b'raw_bytes')
+
+ # report a span of type consumer with the default settings
+ consumer = AIOKafkaConsumer('my-topic', group_id='my-group', bootstrap_servers=['localhost:9092'])
+ async for message in consumer:
+ # process message
+
+The _instrument() method accepts the following keyword args:
+tracer_provider (TracerProvider) - an optional tracer provider
+async_produce_hook (Callable) - a function with extra user-defined logic to be performed before sending the message
+this function signature is:
+def async_produce_hook(span: Span, args, kwargs)
+async_consume_hook (Callable) - a function with extra user-defined logic to be performed after consuming a message
+this function signature is:
+def async_consume_hook(span: Span, record: kafka.record.ABCRecord, args, kwargs)
+for example:
+
+.. code: python
+ from opentelemetry.instrumentation.kafka import AIOKafkaInstrumentor
+ from aiokafka import AIOKafkaProducer, AIOKafkaConsumer
+
+ async def async_produce_hook(span, args, kwargs):
+ if span and span.is_recording():
+ span.set_attribute("custom_user_attribute_from_async_response_hook", "some-value")
+ async def async_consume_hook(span, record, args, kwargs):
+ if span and span.is_recording():
+ span.set_attribute("custom_user_attribute_from_consume_hook", "some-value")
+
+ # instrument kafka with produce and consume hooks
+ AIOKafkaInstrumentor().instrument(async_produce_hook=async_produce_hook, async_consume_hook=async_consume_hook)
+
+ # Using kafka as normal now will automatically generate spans,
+ # including user custom attributes added from the hooks
+ producer = AIOKafkaProducer(bootstrap_servers=['localhost:9092'])
+ await producer.send('my-topic', b'raw_bytes')
+
+API
+___
+"""
+from asyncio import iscoroutinefunction
+from typing import Collection
+
+import aiokafka
+from wrapt import wrap_function_wrapper
+
+from opentelemetry import trace
+from opentelemetry.instrumentation.aiokafka.package import _instruments
+from opentelemetry.instrumentation.aiokafka.utils import (
+ _wrap_anext,
+ _wrap_send,
+)
+from opentelemetry.instrumentation.aiokafka.version import __version__
+from opentelemetry.instrumentation.instrumentor import BaseInstrumentor
+from opentelemetry.instrumentation.utils import unwrap
+from opentelemetry.semconv.schemas import Schemas
+
+
+class AIOKafkaInstrumentor(BaseInstrumentor):
+ """An instrumentor for kafka module
+ See `BaseInstrumentor`
+ """
+
+ def instrumentation_dependencies(self) -> Collection[str]:
+ return _instruments
+
+ def _instrument(self, **kwargs):
+ """Instruments the kafka module
+
+ Args:
+ **kwargs: Optional arguments
+ ``tracer_provider``: a TracerProvider, defaults to global.
+ ``async_produce_hook``: a callable to be executed just before producing a message
+ ``async_consume_hook``: a callable to be executed just after consuming a message
+ """
+ tracer_provider = kwargs.get("tracer_provider")
+
+ async_produce_hook = kwargs.get("async_produce_hook")
+ if not iscoroutinefunction(async_produce_hook):
+ async_produce_hook = None
+
+ async_consume_hook = kwargs.get("async_consume_hook")
+ if not iscoroutinefunction(async_consume_hook):
+ async_consume_hook = None
+
+ tracer = trace.get_tracer(
+ __name__,
+ __version__,
+ tracer_provider=tracer_provider,
+ schema_url=Schemas.V1_27_0.value,
+ )
+
+ wrap_function_wrapper(
+ aiokafka.AIOKafkaProducer,
+ "send",
+ _wrap_send(tracer, async_produce_hook),
+ )
+ wrap_function_wrapper(
+ aiokafka.AIOKafkaConsumer,
+ "__anext__",
+ _wrap_anext(tracer, async_consume_hook),
+ )
+
+ def _uninstrument(self, **kwargs):
+ unwrap(aiokafka.AIOKafkaProducer, "send")
+ unwrap(aiokafka.AIOKafkaConsumer, "__anext__")
diff --git a/instrumentation/opentelemetry-instrumentation-aiokafka/src/opentelemetry/instrumentation/aiokafka/package.py b/instrumentation/opentelemetry-instrumentation-aiokafka/src/opentelemetry/instrumentation/aiokafka/package.py
new file mode 100644
index 0000000000..69367d3447
--- /dev/null
+++ b/instrumentation/opentelemetry-instrumentation-aiokafka/src/opentelemetry/instrumentation/aiokafka/package.py
@@ -0,0 +1,16 @@
+# Copyright The OpenTelemetry Authors
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+
+
+_instruments = ("aiokafka >= 0.8, < 1.0",)
diff --git a/instrumentation/opentelemetry-instrumentation-aiokafka/src/opentelemetry/instrumentation/aiokafka/utils.py b/instrumentation/opentelemetry-instrumentation-aiokafka/src/opentelemetry/instrumentation/aiokafka/utils.py
new file mode 100644
index 0000000000..3c54ce1500
--- /dev/null
+++ b/instrumentation/opentelemetry-instrumentation-aiokafka/src/opentelemetry/instrumentation/aiokafka/utils.py
@@ -0,0 +1,370 @@
+import json
+from logging import getLogger
+from typing import Any, Awaitable, Callable, Dict, List, Optional, Tuple, Union
+
+import aiokafka
+from aiokafka import ConsumerRecord
+
+from opentelemetry import context, propagate, trace
+from opentelemetry.context import Context
+from opentelemetry.propagators import textmap
+from opentelemetry.semconv._incubating.attributes import messaging_attributes
+from opentelemetry.semconv.attributes import server_attributes
+from opentelemetry.trace import Tracer
+from opentelemetry.trace.span import Span
+
+_LOG = getLogger(__name__)
+
+
+def _extract_bootstrap_servers(
+ client: aiokafka.AIOKafkaClient,
+) -> Union[str, List[str]]:
+ return client._bootstrap_servers
+
+
+def _extract_client_id(client: aiokafka.AIOKafkaClient) -> str:
+ return client._client_id
+
+
+def _extract_consumer_group(
+ consumer: aiokafka.AIOKafkaConsumer,
+) -> Optional[str]:
+ return consumer._group_id
+
+
+def _extract_argument(
+ key: str,
+ position: int,
+ default_value: Any,
+ args: Tuple[Any],
+ kwargs: Dict[str, Any],
+) -> Any:
+ if len(args) > position:
+ return args[position]
+ return kwargs.get(key, default_value)
+
+
+def _extract_send_topic(args: Tuple[Any], kwargs: Dict[str, Any]) -> str:
+ """extract topic from `send` method arguments in AIOKafkaProducer class"""
+ return _extract_argument("topic", 0, "unknown", args, kwargs)
+
+
+def _extract_send_value(
+ args: Tuple[Any], kwargs: Dict[str, Any]
+) -> Optional[Any]:
+ """extract value from `send` method arguments in AIOKafkaProducer class"""
+ return _extract_argument("value", 1, None, args, kwargs)
+
+
+def _extract_send_key(
+ args: Tuple[Any], kwargs: Dict[str, Any]
+) -> Optional[Any]:
+ """extract key from `send` method arguments in AIOKafkaProducer class"""
+ return _extract_argument("key", 2, None, args, kwargs)
+
+
+def _extract_send_headers(args: Tuple[Any], kwargs: Dict[str, Any]):
+ """extract headers from `send` method arguments in AIOKafkaProducer class"""
+ return _extract_argument("headers", 5, None, args, kwargs)
+
+
+async def _extract_send_partition(
+ instance: aiokafka.AIOKafkaProducer,
+ args: Tuple[Any],
+ kwargs: Dict[str, Any],
+) -> Optional[int]:
+ """extract partition `send` method arguments, using the `_partition` method in AIOKafkaProducer class"""
+ try:
+ topic = _extract_send_topic(args, kwargs)
+ key = _extract_send_key(args, kwargs)
+ value = _extract_send_value(args, kwargs)
+ partition = _extract_argument("partition", 3, None, args, kwargs)
+ key_bytes, value_bytes = instance._serialize(topic, key, value)
+ valid_types = (bytes, bytearray, memoryview, type(None))
+ if (
+ type(key_bytes) not in valid_types
+ or type(value_bytes) not in valid_types
+ ):
+ return None
+
+ await instance.client._wait_on_metadata(topic)
+
+ return instance._partition(
+ topic, partition, key, value, key_bytes, value_bytes
+ )
+ except Exception as exception: # pylint: disable=W0703
+ _LOG.debug("Unable to extract partition: %s", exception)
+ return None
+
+
+ProduceHookT = Optional[Callable[[Span, Tuple, Dict], Awaitable[None]]]
+ConsumeHookT = Optional[
+ Callable[[Span, ConsumerRecord, Tuple, Dict], Awaitable[None]]
+]
+
+HeadersT = List[Tuple[str, Optional[bytes]]]
+
+
+class AIOKafkaContextGetter(textmap.Getter[HeadersT]):
+ def get(self, carrier: HeadersT, key: str) -> Optional[List[str]]:
+ if carrier is None:
+ return None
+
+ for item_key, value in carrier:
+ if item_key == key:
+ if value is not None:
+ return [value.decode()]
+ return None
+
+ def keys(self, carrier: HeadersT) -> List[str]:
+ if carrier is None:
+ return []
+ return [key for (key, value) in carrier]
+
+
+class AIOKafkaContextSetter(textmap.Setter[HeadersT]):
+ def set(
+ self, carrier: HeadersT, key: Optional[str], value: Optional[str]
+ ) -> None:
+ if carrier is None or key is None:
+ return
+
+ if value is not None:
+ carrier.append((key, value.encode()))
+ else:
+ carrier.append((key, value))
+
+
+_aiokafka_getter = AIOKafkaContextGetter()
+_aiokafka_setter = AIOKafkaContextSetter()
+
+
+def _enrich_base_span(
+ span: Span,
+ *,
+ bootstrap_servers: Union[str, List[str]],
+ client_id: str,
+ topic: str,
+ partition: Optional[int],
+ key: Optional[Any],
+) -> None:
+ span.set_attribute(
+ messaging_attributes.MESSAGING_SYSTEM,
+ messaging_attributes.MessagingSystemValues.KAFKA.value,
+ )
+ span.set_attribute(
+ server_attributes.SERVER_ADDRESS, json.dumps(bootstrap_servers)
+ )
+ span.set_attribute(messaging_attributes.MESSAGING_CLIENT_ID, client_id)
+ span.set_attribute(messaging_attributes.MESSAGING_DESTINATION_NAME, topic)
+
+ if partition is not None:
+ span.set_attribute(
+ messaging_attributes.MESSAGING_DESTINATION_PARTITION_ID,
+ str(partition),
+ )
+
+ if key is not None:
+ span.set_attribute(
+ messaging_attributes.MESSAGING_KAFKA_MESSAGE_KEY, key
+ )
+
+
+def _enrich_send_span(
+ span: Span,
+ *,
+ bootstrap_servers: Union[str, List[str]],
+ client_id: str,
+ topic: str,
+ partition: Optional[int],
+ key: Optional[str],
+) -> None:
+ if not span.is_recording():
+ return
+
+ _enrich_base_span(
+ span,
+ bootstrap_servers=bootstrap_servers,
+ client_id=client_id,
+ topic=topic,
+ partition=partition,
+ key=key,
+ )
+
+ span.set_attribute(messaging_attributes.MESSAGING_OPERATION_NAME, "send")
+ span.set_attribute(
+ messaging_attributes.MESSAGING_OPERATION_TYPE,
+ messaging_attributes.MessagingOperationTypeValues.PUBLISH.value,
+ )
+
+
+def _enrich_anext_span(
+ span: Span,
+ *,
+ bootstrap_servers: Union[str, List[str]],
+ client_id: str,
+ consumer_group: Optional[str],
+ topic: str,
+ partition: Optional[int],
+ key: Optional[str],
+ offset: int,
+) -> None:
+ if not span.is_recording():
+ return
+
+ _enrich_base_span(
+ span,
+ bootstrap_servers=bootstrap_servers,
+ client_id=client_id,
+ topic=topic,
+ partition=partition,
+ key=key,
+ )
+
+ if consumer_group is not None:
+ span.set_attribute(
+ messaging_attributes.MESSAGING_CONSUMER_GROUP_NAME, consumer_group
+ )
+
+ span.set_attribute(
+ messaging_attributes.MESSAGING_OPERATION_NAME, "receive"
+ )
+ span.set_attribute(
+ messaging_attributes.MESSAGING_OPERATION_TYPE,
+ messaging_attributes.MessagingOperationTypeValues.RECEIVE.value,
+ )
+
+ span.set_attribute(
+ messaging_attributes.MESSAGING_KAFKA_MESSAGE_OFFSET, offset
+ )
+
+ # https://stackoverflow.com/questions/65935155/identify-and-find-specific-message-in-kafka-topic
+ # A message within Kafka is uniquely defined by its topic name, topic partition and offset.
+ if partition is not None:
+ span.set_attribute(
+ messaging_attributes.MESSAGING_MESSAGE_ID,
+ f"{topic}.{partition}.{offset}",
+ )
+
+
+def _get_span_name(operation: str, topic: str):
+ return f"{topic} {operation}"
+
+
+def _wrap_send(
+ tracer: Tracer, async_produce_hook: ProduceHookT
+) -> Callable[..., Awaitable[None]]:
+ async def _traced_send(
+ func: Callable[..., Awaitable[None]],
+ instance: aiokafka.AIOKafkaProducer,
+ args: Tuple[Any],
+ kwargs: Dict[str, Any],
+ ) -> None:
+ headers = _extract_send_headers(args, kwargs)
+ if headers is None:
+ headers = []
+ kwargs["headers"] = headers
+
+ topic = _extract_send_topic(args, kwargs)
+ bootstrap_servers = _extract_bootstrap_servers(instance.client)
+ client_id = _extract_client_id(instance.client)
+ key = _extract_send_key(args, kwargs)
+ partition = await _extract_send_partition(instance, args, kwargs)
+ span_name = _get_span_name("send", topic)
+ with tracer.start_as_current_span(
+ span_name, kind=trace.SpanKind.PRODUCER
+ ) as span:
+ _enrich_send_span(
+ span,
+ bootstrap_servers=bootstrap_servers,
+ client_id=client_id,
+ topic=topic,
+ partition=partition,
+ key=key,
+ )
+ propagate.inject(
+ headers,
+ context=trace.set_span_in_context(span),
+ setter=_aiokafka_setter,
+ )
+ try:
+ if async_produce_hook is not None:
+ await async_produce_hook(span, args, kwargs)
+ except Exception as hook_exception: # pylint: disable=W0703
+ _LOG.exception(hook_exception)
+
+ return await func(*args, **kwargs)
+
+ return _traced_send
+
+
+async def _create_consumer_span(
+ tracer: Tracer,
+ async_consume_hook: ConsumeHookT,
+ record: ConsumerRecord,
+ extracted_context: Context,
+ bootstrap_servers: Union[str, List[str]],
+ client_id: str,
+ consumer_group: Optional[str],
+ args: Tuple[Any],
+ kwargs: Dict[str, Any],
+):
+ span_name = _get_span_name("receive", record.topic)
+ with tracer.start_as_current_span(
+ span_name,
+ context=extracted_context,
+ kind=trace.SpanKind.CONSUMER,
+ ) as span:
+ new_context = trace.set_span_in_context(span, extracted_context)
+ token = context.attach(new_context)
+ _enrich_anext_span(
+ span,
+ bootstrap_servers=bootstrap_servers,
+ client_id=client_id,
+ consumer_group=consumer_group,
+ topic=record.topic,
+ partition=record.partition,
+ key=record.key,
+ offset=record.offset,
+ )
+ try:
+ if async_consume_hook is not None:
+ await async_consume_hook(span, record, args, kwargs)
+ except Exception as hook_exception: # pylint: disable=W0703
+ _LOG.exception(hook_exception)
+ context.detach(token)
+
+
+def _wrap_anext(
+ tracer: Tracer, async_consume_hook: ConsumeHookT
+) -> Callable[..., Awaitable[aiokafka.ConsumerRecord]]:
+ async def _traced_next(
+ func: Callable[..., Awaitable[aiokafka.ConsumerRecord]],
+ instance: aiokafka.AIOKafkaConsumer,
+ args: Tuple[Any],
+ kwargs: Dict[str, Any],
+ ) -> aiokafka.ConsumerRecord:
+ record = await func(*args, **kwargs)
+
+ if record:
+ bootstrap_servers = _extract_bootstrap_servers(instance._client)
+ client_id = _extract_client_id(instance._client)
+ consumer_group = _extract_consumer_group(instance)
+
+ extracted_context = propagate.extract(
+ record.headers, getter=_aiokafka_getter
+ )
+ await _create_consumer_span(
+ tracer,
+ async_consume_hook,
+ record,
+ extracted_context,
+ bootstrap_servers,
+ client_id,
+ consumer_group,
+ args,
+ kwargs,
+ )
+ return record
+
+ return _traced_next
diff --git a/instrumentation/opentelemetry-instrumentation-aiokafka/src/opentelemetry/instrumentation/aiokafka/version.py b/instrumentation/opentelemetry-instrumentation-aiokafka/src/opentelemetry/instrumentation/aiokafka/version.py
new file mode 100644
index 0000000000..ee5a6342e7
--- /dev/null
+++ b/instrumentation/opentelemetry-instrumentation-aiokafka/src/opentelemetry/instrumentation/aiokafka/version.py
@@ -0,0 +1,15 @@
+# Copyright The OpenTelemetry Authors
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+
+__version__ = "0.49b0.dev"
diff --git a/instrumentation/opentelemetry-instrumentation-aiokafka/test-requirements.txt b/instrumentation/opentelemetry-instrumentation-aiokafka/test-requirements.txt
new file mode 100644
index 0000000000..460e58e091
--- /dev/null
+++ b/instrumentation/opentelemetry-instrumentation-aiokafka/test-requirements.txt
@@ -0,0 +1,4 @@
+aiokafka==0.11.0
+pytest==7.4.4
+-e opentelemetry-instrumentation
+-e instrumentation/opentelemetry-instrumentation-aiokafka
diff --git a/instrumentation/opentelemetry-instrumentation-aiokafka/tests/__init__.py b/instrumentation/opentelemetry-instrumentation-aiokafka/tests/__init__.py
new file mode 100644
index 0000000000..e69de29bb2
diff --git a/instrumentation/opentelemetry-instrumentation-aiokafka/tests/test_instrumentation.py b/instrumentation/opentelemetry-instrumentation-aiokafka/tests/test_instrumentation.py
new file mode 100644
index 0000000000..1c4e5e3d10
--- /dev/null
+++ b/instrumentation/opentelemetry-instrumentation-aiokafka/tests/test_instrumentation.py
@@ -0,0 +1,40 @@
+# Copyright The OpenTelemetry Authors
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+from unittest import TestCase
+
+from aiokafka import AIOKafkaConsumer, AIOKafkaProducer
+from wrapt import BoundFunctionWrapper
+
+from opentelemetry.instrumentation.aiokafka import AIOKafkaInstrumentor
+
+
+class TestAIOKafka(TestCase):
+ def test_instrument_api(self) -> None:
+ instrumentation = AIOKafkaInstrumentor()
+
+ instrumentation.instrument()
+ self.assertTrue(
+ isinstance(AIOKafkaProducer.send, BoundFunctionWrapper)
+ )
+ self.assertTrue(
+ isinstance(AIOKafkaConsumer.__anext__, BoundFunctionWrapper)
+ )
+
+ instrumentation.uninstrument()
+ self.assertFalse(
+ isinstance(AIOKafkaProducer.send, BoundFunctionWrapper)
+ )
+ self.assertFalse(
+ isinstance(AIOKafkaConsumer.__anext__, BoundFunctionWrapper)
+ )
diff --git a/instrumentation/opentelemetry-instrumentation-aiokafka/tests/test_utils.py b/instrumentation/opentelemetry-instrumentation-aiokafka/tests/test_utils.py
new file mode 100644
index 0000000000..b1b2792608
--- /dev/null
+++ b/instrumentation/opentelemetry-instrumentation-aiokafka/tests/test_utils.py
@@ -0,0 +1,306 @@
+# Copyright The OpenTelemetry Authors
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+# pylint: disable=unnecessary-dunder-call
+
+from unittest import IsolatedAsyncioTestCase, mock
+
+from opentelemetry.instrumentation.aiokafka.utils import (
+ AIOKafkaContextGetter,
+ AIOKafkaContextSetter,
+ _aiokafka_getter,
+ _aiokafka_setter,
+ _create_consumer_span,
+ _extract_send_partition,
+ _get_span_name,
+ _wrap_anext,
+ _wrap_send,
+)
+from opentelemetry.trace import SpanKind
+
+
+class TestUtils(IsolatedAsyncioTestCase):
+ def setUp(self) -> None:
+ super().setUp()
+ self.topic_name = "test_topic"
+ self.args = [self.topic_name]
+ self.headers = []
+ self.kwargs = {"partition": 0, "headers": self.headers}
+
+ def test_context_setter(self) -> None:
+ context_setter = AIOKafkaContextSetter()
+
+ carrier_list = [("key1", b"val1")]
+ context_setter.set(carrier_list, "key2", "val2")
+ self.assertTrue(("key2", "val2".encode()) in carrier_list)
+
+ def test_context_getter(self) -> None:
+ context_setter = AIOKafkaContextSetter()
+ context_getter = AIOKafkaContextGetter()
+
+ carrier_list = []
+ context_setter.set(carrier_list, "key1", "val1")
+ self.assertEqual(context_getter.get(carrier_list, "key1"), ["val1"])
+ self.assertEqual(["key1"], context_getter.keys(carrier_list))
+
+ @mock.patch(
+ "opentelemetry.instrumentation.aiokafka.utils._extract_bootstrap_servers"
+ )
+ @mock.patch(
+ "opentelemetry.instrumentation.aiokafka.utils._extract_send_partition"
+ )
+ @mock.patch(
+ "opentelemetry.instrumentation.aiokafka.utils._enrich_send_span"
+ )
+ @mock.patch("opentelemetry.trace.set_span_in_context")
+ @mock.patch("opentelemetry.propagate.inject")
+ async def test_wrap_send_with_topic_as_arg(
+ self,
+ inject: mock.MagicMock,
+ set_span_in_context: mock.MagicMock,
+ enrich_span: mock.MagicMock,
+ extract_send_partition: mock.MagicMock,
+ extract_bootstrap_servers: mock.MagicMock,
+ ) -> None:
+ await self.wrap_send_helper(
+ inject,
+ set_span_in_context,
+ enrich_span,
+ extract_send_partition,
+ extract_bootstrap_servers,
+ )
+
+ @mock.patch(
+ "opentelemetry.instrumentation.aiokafka.utils._extract_bootstrap_servers"
+ )
+ @mock.patch(
+ "opentelemetry.instrumentation.aiokafka.utils._extract_send_partition"
+ )
+ @mock.patch(
+ "opentelemetry.instrumentation.aiokafka.utils._enrich_send_span"
+ )
+ @mock.patch("opentelemetry.trace.set_span_in_context")
+ @mock.patch("opentelemetry.propagate.inject")
+ async def test_wrap_send_with_topic_as_kwarg(
+ self,
+ inject: mock.MagicMock,
+ set_span_in_context: mock.MagicMock,
+ enrich_span: mock.MagicMock,
+ extract_send_partition: mock.AsyncMock,
+ extract_bootstrap_servers: mock.MagicMock,
+ ) -> None:
+ self.args = []
+ self.kwargs["topic"] = self.topic_name
+ await self.wrap_send_helper(
+ inject,
+ set_span_in_context,
+ enrich_span,
+ extract_send_partition,
+ extract_bootstrap_servers,
+ )
+
+ async def wrap_send_helper(
+ self,
+ inject: mock.MagicMock,
+ set_span_in_context: mock.MagicMock,
+ enrich_span: mock.MagicMock,
+ extract_send_partition: mock.AsyncMock,
+ extract_bootstrap_servers: mock.MagicMock,
+ ) -> None:
+ tracer = mock.MagicMock()
+ produce_hook = mock.AsyncMock()
+ original_send_callback = mock.AsyncMock()
+ kafka_producer = mock.MagicMock()
+ expected_span_name = _get_span_name("send", self.topic_name)
+
+ wrapped_send = _wrap_send(tracer, produce_hook)
+ retval = await wrapped_send(
+ original_send_callback, kafka_producer, self.args, self.kwargs
+ )
+
+ extract_bootstrap_servers.assert_called_once_with(
+ kafka_producer.client
+ )
+ extract_send_partition.assert_awaited_once_with(
+ kafka_producer, self.args, self.kwargs
+ )
+ tracer.start_as_current_span.assert_called_once_with(
+ expected_span_name, kind=SpanKind.PRODUCER
+ )
+
+ span = tracer.start_as_current_span().__enter__.return_value
+ enrich_span.assert_called_once_with(
+ span,
+ bootstrap_servers=extract_bootstrap_servers.return_value,
+ client_id=kafka_producer.client._client_id,
+ topic=self.topic_name,
+ partition=extract_send_partition.return_value,
+ key=None,
+ )
+
+ set_span_in_context.assert_called_once_with(span)
+ context = set_span_in_context.return_value
+ inject.assert_called_once_with(
+ self.headers, context=context, setter=_aiokafka_setter
+ )
+
+ produce_hook.assert_awaited_once_with(span, self.args, self.kwargs)
+
+ original_send_callback.assert_awaited_once_with(
+ *self.args, **self.kwargs
+ )
+ self.assertEqual(retval, original_send_callback.return_value)
+
+ @mock.patch("opentelemetry.propagate.extract")
+ @mock.patch(
+ "opentelemetry.instrumentation.aiokafka.utils._create_consumer_span"
+ )
+ @mock.patch(
+ "opentelemetry.instrumentation.aiokafka.utils._extract_bootstrap_servers"
+ )
+ @mock.patch(
+ "opentelemetry.instrumentation.aiokafka.utils._extract_client_id"
+ )
+ @mock.patch(
+ "opentelemetry.instrumentation.aiokafka.utils._extract_consumer_group"
+ )
+ async def test_wrap_next(
+ self,
+ extract_consumer_group: mock.MagicMock,
+ extract_client_id: mock.MagicMock,
+ extract_bootstrap_servers: mock.MagicMock,
+ _create_consumer_span: mock.MagicMock,
+ extract: mock.MagicMock,
+ ) -> None:
+ tracer = mock.MagicMock()
+ consume_hook = mock.AsyncMock()
+ original_next_callback = mock.AsyncMock()
+ kafka_consumer = mock.MagicMock()
+
+ wrapped_next = _wrap_anext(tracer, consume_hook)
+ record = await wrapped_next(
+ original_next_callback, kafka_consumer, self.args, self.kwargs
+ )
+
+ extract_bootstrap_servers.assert_called_once_with(
+ kafka_consumer._client
+ )
+ bootstrap_servers = extract_bootstrap_servers.return_value
+
+ extract_client_id.assert_called_once_with(kafka_consumer._client)
+ client_id = extract_client_id.return_value
+
+ extract_consumer_group.assert_called_once_with(kafka_consumer)
+ consumer_group = extract_consumer_group.return_value
+
+ original_next_callback.assert_awaited_once_with(
+ *self.args, **self.kwargs
+ )
+ self.assertEqual(record, original_next_callback.return_value)
+
+ extract.assert_called_once_with(
+ record.headers, getter=_aiokafka_getter
+ )
+ context = extract.return_value
+
+ _create_consumer_span.assert_called_once_with(
+ tracer,
+ consume_hook,
+ record,
+ context,
+ bootstrap_servers,
+ client_id,
+ consumer_group,
+ self.args,
+ self.kwargs,
+ )
+
+ @mock.patch("opentelemetry.trace.set_span_in_context")
+ @mock.patch("opentelemetry.context.attach")
+ @mock.patch(
+ "opentelemetry.instrumentation.aiokafka.utils._enrich_anext_span"
+ )
+ @mock.patch("opentelemetry.context.detach")
+ async def test_create_consumer_span(
+ self,
+ detach: mock.MagicMock,
+ enrich_span: mock.MagicMock,
+ attach: mock.MagicMock,
+ set_span_in_context: mock.MagicMock,
+ ) -> None:
+ tracer = mock.MagicMock()
+ consume_hook = mock.AsyncMock()
+ bootstrap_servers = mock.MagicMock()
+ extracted_context = mock.MagicMock()
+ record = mock.MagicMock()
+ client_id = mock.MagicMock()
+ consumer_group = mock.MagicMock()
+
+ await _create_consumer_span(
+ tracer,
+ consume_hook,
+ record,
+ extracted_context,
+ bootstrap_servers,
+ client_id,
+ consumer_group,
+ self.args,
+ self.kwargs,
+ )
+
+ expected_span_name = _get_span_name("receive", record.topic)
+
+ tracer.start_as_current_span.assert_called_once_with(
+ expected_span_name,
+ context=extracted_context,
+ kind=SpanKind.CONSUMER,
+ )
+ span = tracer.start_as_current_span.return_value.__enter__()
+ set_span_in_context.assert_called_once_with(span, extracted_context)
+ attach.assert_called_once_with(set_span_in_context.return_value)
+
+ enrich_span.assert_called_once_with(
+ span,
+ bootstrap_servers=bootstrap_servers,
+ client_id=client_id,
+ consumer_group=consumer_group,
+ topic=record.topic,
+ partition=record.partition,
+ key=record.key,
+ offset=record.offset,
+ )
+ consume_hook.assert_awaited_once_with(
+ span, record, self.args, self.kwargs
+ )
+ detach.assert_called_once_with(attach.return_value)
+
+ async def test_kafka_properties_extractor(self):
+ aiokafka_instance_mock = mock.Mock()
+ aiokafka_instance_mock._serialize.return_value = None, None
+ aiokafka_instance_mock._partition.return_value = "partition"
+ aiokafka_instance_mock.client._wait_on_metadata = mock.AsyncMock()
+ assert (
+ await _extract_send_partition(
+ aiokafka_instance_mock, self.args, self.kwargs
+ )
+ == "partition"
+ )
+ aiokafka_instance_mock.client._wait_on_metadata.side_effect = (
+ Exception("mocked error")
+ )
+ assert (
+ await _extract_send_partition(
+ aiokafka_instance_mock, self.args, self.kwargs
+ )
+ is None
+ )
diff --git a/opentelemetry-contrib-instrumentations/pyproject.toml b/opentelemetry-contrib-instrumentations/pyproject.toml
index 9c40f9c2a3..300895c1e0 100644
--- a/opentelemetry-contrib-instrumentations/pyproject.toml
+++ b/opentelemetry-contrib-instrumentations/pyproject.toml
@@ -32,6 +32,7 @@ dependencies = [
"opentelemetry-instrumentation-aio-pika==0.49b0.dev",
"opentelemetry-instrumentation-aiohttp-client==0.49b0.dev",
"opentelemetry-instrumentation-aiohttp-server==0.49b0.dev",
+ "opentelemetry-instrumentation-aiokafka==0.49b0.dev",
"opentelemetry-instrumentation-aiopg==0.49b0.dev",
"opentelemetry-instrumentation-asgi==0.49b0.dev",
"opentelemetry-instrumentation-asyncio==0.49b0.dev",
diff --git a/opentelemetry-instrumentation/src/opentelemetry/instrumentation/bootstrap_gen.py b/opentelemetry-instrumentation/src/opentelemetry/instrumentation/bootstrap_gen.py
index 616675ee80..cc9af1de80 100644
--- a/opentelemetry-instrumentation/src/opentelemetry/instrumentation/bootstrap_gen.py
+++ b/opentelemetry-instrumentation/src/opentelemetry/instrumentation/bootstrap_gen.py
@@ -28,6 +28,10 @@
"library": "aiohttp ~= 3.0",
"instrumentation": "opentelemetry-instrumentation-aiohttp-server==0.49b0.dev",
},
+ {
+ "library": "aiokafka >= 0.8, < 1.0",
+ "instrumentation": "opentelemetry-instrumentation-aiokafka==0.49b0.dev",
+ },
{
"library": "aiopg >= 0.13.0, < 2.0.0",
"instrumentation": "opentelemetry-instrumentation-aiopg==0.49b0.dev",
diff --git a/tox.ini b/tox.ini
index 600929a6ec..f7e4ce55b3 100644
--- a/tox.ini
+++ b/tox.ini
@@ -342,6 +342,11 @@ envlist =
pypy3-test-instrumentation-aio-pika-{0,1,2,3}
lint-instrumentation-aio-pika
+ ; opentelemetry-instrumentation-aiokafka
+ py3{8,9,10,11,12}-test-instrumentation-aiokafka
+ pypy3-test-instrumentation-aiokafka
+ lint-instrumentation-aiokafka
+
; opentelemetry-instrumentation-kafka-python
py3{8,9,10,11}-test-instrumentation-kafka-python
py3{8,9,10,11,12}-test-instrumentation-kafka-pythonng
@@ -436,6 +441,11 @@ commands_pre =
aio-pika-3: pip install -r {toxinidir}/instrumentation/opentelemetry-instrumentation-aio-pika/test-requirements-3.txt
lint-instrumentation-aio-pika: pip install -r {toxinidir}/instrumentation/opentelemetry-instrumentation-aio-pika/test-requirements-3.txt
+ aiokafka: pip install opentelemetry-api@{env:CORE_REPO}\#egg=opentelemetry-api&subdirectory=opentelemetry-api
+ aiokafka: pip install opentelemetry-semantic-conventions@{env:CORE_REPO}\#egg=opentelemetry-semantic-conventions&subdirectory=opentelemetry-semantic-conventions
+ aiokafka: pip install opentelemetry-sdk@{env:CORE_REPO}\#egg=opentelemetry-sdk&subdirectory=opentelemetry-sdk
+ aiokafka: pip install -r {toxinidir}/instrumentation/opentelemetry-instrumentation-aiokafka/test-requirements.txt
+
kafka-python: pip install opentelemetry-api@{env:CORE_REPO}\#egg=opentelemetry-api&subdirectory=opentelemetry-api
kafka-python: pip install opentelemetry-semantic-conventions@{env:CORE_REPO}\#egg=opentelemetry-semantic-conventions&subdirectory=opentelemetry-semantic-conventions
kafka-python: pip install opentelemetry-sdk@{env:CORE_REPO}\#egg=opentelemetry-sdk&subdirectory=opentelemetry-sdk
@@ -930,6 +940,12 @@ commands =
lint-instrumentation-jinja2: flake8 --config {toxinidir}/.flake8 {toxinidir}/instrumentation/opentelemetry-instrumentation-jinja2
lint-instrumentation-jinja2: sh -c "cd instrumentation && pylint --rcfile ../.pylintrc opentelemetry-instrumentation-jinja2"
+ test-instrumentation-aiokafka: pytest {toxinidir}/instrumentation/opentelemetry-instrumentation-aiokafka/tests {posargs}
+ lint-instrumentation-aiokafka: black --diff --check --config {toxinidir}/pyproject.toml {toxinidir}/instrumentation/opentelemetry-instrumentation-aiokafka
+ lint-instrumentation-aiokafka: isort --diff --check-only --settings-path {toxinidir}/.isort.cfg {toxinidir}/instrumentation/opentelemetry-instrumentation-aiokafka
+ lint-instrumentation-aiokafka: flake8 --config {toxinidir}/.flake8 {toxinidir}/instrumentation/opentelemetry-instrumentation-aiokafka
+ lint-instrumentation-aiokafka: sh -c "cd instrumentation && pylint --rcfile ../.pylintrc opentelemetry-instrumentation-aiokafka"
+
test-instrumentation-kafka-python: pytest {toxinidir}/instrumentation/opentelemetry-instrumentation-kafka-python/tests {posargs}
lint-instrumentation-kafka-python: black --diff --check --config {toxinidir}/pyproject.toml {toxinidir}/instrumentation/opentelemetry-instrumentation-kafka-python
lint-instrumentation-kafka-python: isort --diff --check-only --settings-path {toxinidir}/.isort.cfg {toxinidir}/instrumentation/opentelemetry-instrumentation-kafka-python
@@ -1277,6 +1293,7 @@ commands_pre =
-e {toxinidir}/instrumentation/opentelemetry-instrumentation-asyncpg \
-e {toxinidir}/instrumentation/opentelemetry-instrumentation-celery \
-e {toxinidir}/instrumentation/opentelemetry-instrumentation-pika \
+ -e {toxinidir}/instrumentation/opentelemetry-instrumentation-aiokafka \
-e {toxinidir}/instrumentation/opentelemetry-instrumentation-kafka-python \
-e {toxinidir}/instrumentation/opentelemetry-instrumentation-confluent-kafka \
-e {toxinidir}/instrumentation/opentelemetry-instrumentation-dbapi \
From 08def3e40a72a03afb16f3a6b492663de5252469 Mon Sep 17 00:00:00 2001
From: Leighton Chen
Date: Tue, 17 Sep 2024 01:38:24 -0700
Subject: [PATCH 26/33] Update pyproject.toml (#2873)
Co-authored-by: Riccardo Magliocchetti
---
opentelemetry-instrumentation/pyproject.toml | 1 +
1 file changed, 1 insertion(+)
diff --git a/opentelemetry-instrumentation/pyproject.toml b/opentelemetry-instrumentation/pyproject.toml
index edaf400419..866b9b5008 100644
--- a/opentelemetry-instrumentation/pyproject.toml
+++ b/opentelemetry-instrumentation/pyproject.toml
@@ -26,6 +26,7 @@ classifiers = [
]
dependencies = [
"opentelemetry-api ~= 1.4",
+ "opentelemetry-semantic-conventions >= 0.48b0",
"setuptools >= 16.0",
"wrapt >= 1.0.0, < 2.0.0",
]
From 97c3664fd72681348293caa23e1e96d47934ef07 Mon Sep 17 00:00:00 2001
From: Riccardo Magliocchetti
Date: Thu, 19 Sep 2024 10:00:22 +0200
Subject: [PATCH 27/33] Fix public-symbols-check workflow generation (#2876)
Consider only pull request events when running public-symbols-check.
---
.../src/generate_workflows_lib/misc.yml.j2 | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/.github/workflows/generate_workflows_lib/src/generate_workflows_lib/misc.yml.j2 b/.github/workflows/generate_workflows_lib/src/generate_workflows_lib/misc.yml.j2
index 2b0735b432..87f726b587 100644
--- a/.github/workflows/generate_workflows_lib/src/generate_workflows_lib/misc.yml.j2
+++ b/.github/workflows/generate_workflows_lib/src/generate_workflows_lib/misc.yml.j2
@@ -28,7 +28,7 @@ jobs:
{%- if job_data == "public-symbols-check" %}
if: |
!contains(github.event.pull_request.labels.*.name, 'Approve Public API check')
- && github.actor != 'opentelemetrybot'
+ && github.actor != 'opentelemetrybot' && github.event_name == 'pull_request'
{%- endif %}
steps:
- name: Checkout repo @ SHA - ${% raw %}{{ github.sha }}{% endraw %}
From 6fcfbd67b85e0139147b3273da97c30c4a3970a8 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Em=C3=ADdio=20Neto?=
<9735060+emdneto@users.noreply.github.com>
Date: Mon, 23 Sep 2024 04:44:07 -0300
Subject: [PATCH 28/33] tests: fix docker-tests mssql (#2878)
* try new image
* try new image with new pyodbc verrsion
---
tests/opentelemetry-docker-tests/tests/docker-compose.yml | 2 +-
tox.ini | 2 +-
2 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/tests/opentelemetry-docker-tests/tests/docker-compose.yml b/tests/opentelemetry-docker-tests/tests/docker-compose.yml
index 2f89e3388e..59f0e42d3d 100644
--- a/tests/opentelemetry-docker-tests/tests/docker-compose.yml
+++ b/tests/opentelemetry-docker-tests/tests/docker-compose.yml
@@ -51,7 +51,7 @@ services:
- "14268:14268"
- "9411:9411"
otmssql:
- image: mcr.microsoft.com/mssql/server:2017-CU23-ubuntu-16.04
+ image: mcr.microsoft.com/mssql/server:2022-CU14-ubuntu-22.04
ports:
- "1433:1433"
environment:
diff --git a/tox.ini b/tox.ini
index f7e4ce55b3..976e5968b0 100644
--- a/tox.ini
+++ b/tox.ini
@@ -1257,7 +1257,7 @@ deps =
PyMySQL==0.10.1
PyNaCl==1.5.0
# prerequisite: install unixodbc
- pyodbc==4.0.39
+ pyodbc==5.0.1
pyrsistent==0.20.0
pytest==8.0.2
pytest-celery==0.0.0
From 41b64539d01b79927deb2aee1388d61021658afc Mon Sep 17 00:00:00 2001
From: heidi229
Date: Tue, 24 Sep 2024 01:09:06 +0800
Subject: [PATCH 29/33] update editable install link in readme.md (#2881)
---
README.md | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/README.md b/README.md
index 1a2aaf4f8a..a04c4b7c7b 100644
--- a/README.md
+++ b/README.md
@@ -73,7 +73,7 @@ pip install opentelemetry-instrumentation-{integration}
To install the development versions of these packages instead, clone or fork
this repo and do an [editable
-install](https://pip.pypa.io/en/stable/reference/pip_install/#editable-installs):
+install](https://pip.pypa.io/en/stable/topics/local-project-installs/#editable-installs):
```sh
pip install -e ./instrumentation/opentelemetry-instrumentation-{integration}
From 3deb6b9db65218d23aded29a0aa4e0374d56081d Mon Sep 17 00:00:00 2001
From: Riccardo Magliocchetti
Date: Mon, 23 Sep 2024 22:56:37 +0200
Subject: [PATCH 30/33] opentelemetry-instrumentation-flask: a bit more room on
metrics tests (#2884)
---
.../tests/test_programmatic.py | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/instrumentation/opentelemetry-instrumentation-flask/tests/test_programmatic.py b/instrumentation/opentelemetry-instrumentation-flask/tests/test_programmatic.py
index 4458daae21..e6bc8202df 100644
--- a/instrumentation/opentelemetry-instrumentation-flask/tests/test_programmatic.py
+++ b/instrumentation/opentelemetry-instrumentation-flask/tests/test_programmatic.py
@@ -520,7 +520,7 @@ def test_flask_metrics_new_semconv(self):
if isinstance(point, HistogramDataPoint):
self.assertEqual(point.count, 3)
self.assertAlmostEqual(
- duration_s, point.sum, places=2
+ duration_s, point.sum, places=1
)
histogram_data_point_seen = True
if isinstance(point, NumberDataPoint):
From a084c2c7df030e5c9284a50bff1faced4adc36ce Mon Sep 17 00:00:00 2001
From: Rocky Ken <119533257+rocky-ken@users.noreply.github.com>
Date: Wed, 25 Sep 2024 08:19:20 -0700
Subject: [PATCH 31/33] Add fallback decoding for asgi headers (#2837)
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
* Add latin-1 fallback decoding for asgi headers
* Add comment for ASGI encoding spec and change to unicode_escape
* add unit test for non-utf8 header decoding
* add changelog
* revert lint
* code review changes
* Fix changelog
* Add ASGIGetter test
---------
Co-authored-by: EmÃdio Neto <9735060+emdneto@users.noreply.github.com>
Co-authored-by: Riccardo Magliocchetti
---
CHANGELOG.md | 2 ++
.../instrumentation/asgi/__init__.py | 20 ++++++++++++----
.../tests/test_asgi_custom_headers.py | 24 +++++++++++++++++--
.../tests/test_getter.py | 10 ++++++++
4 files changed, 50 insertions(+), 6 deletions(-)
diff --git a/CHANGELOG.md b/CHANGELOG.md
index 7fa1ab2ba3..a060517cdf 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -23,6 +23,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
([#2537](https://github.com/open-telemetry/opentelemetry-python-contrib/pull/2537))
- `opentelemetry-instrumentation-asgi`, `opentelemetry-instrumentation-fastapi` Add ability to disable internal HTTP send and receive spans
([#2802](https://github.com/open-telemetry/opentelemetry-python-contrib/pull/2802))
+- `opentelemetry-instrumentation-asgi` Add fallback decoding for ASGI headers
+ ([#2837](https://github.com/open-telemetry/opentelemetry-python-contrib/pull/2837))
### Breaking changes
diff --git a/instrumentation/opentelemetry-instrumentation-asgi/src/opentelemetry/instrumentation/asgi/__init__.py b/instrumentation/opentelemetry-instrumentation-asgi/src/opentelemetry/instrumentation/asgi/__init__.py
index d25ca41017..bc45eacaa4 100644
--- a/instrumentation/opentelemetry-instrumentation-asgi/src/opentelemetry/instrumentation/asgi/__init__.py
+++ b/instrumentation/opentelemetry-instrumentation-asgi/src/opentelemetry/instrumentation/asgi/__init__.py
@@ -284,9 +284,9 @@ def get(
# ASGI header keys are in lower case
key = key.lower()
decoded = [
- _value.decode("utf8")
+ _decode_header_item(_value)
for (_key, _value) in headers
- if _key.decode("utf8").lower() == key
+ if _decode_header_item(_key).lower() == key
]
if not decoded:
return None
@@ -294,7 +294,7 @@ def get(
def keys(self, carrier: dict) -> typing.List[str]:
headers = carrier.get("headers") or []
- return [_key.decode("utf8") for (_key, _value) in headers]
+ return [_decode_header_item(_key) for (_key, _value) in headers]
asgi_getter = ASGIGetter()
@@ -410,7 +410,9 @@ def collect_custom_headers_attributes(
if raw_headers:
for key, value in raw_headers:
# Decode headers before processing.
- headers[key.decode()].append(value.decode())
+ headers[_decode_header_item(key)].append(
+ _decode_header_item(value)
+ )
return sanitize.sanitize_header_values(
headers,
@@ -979,3 +981,13 @@ def _parse_active_request_count_attrs(
_server_active_requests_count_attrs_new,
sem_conv_opt_in_mode,
)
+
+
+def _decode_header_item(value):
+ try:
+ return value.decode("utf-8")
+ except ValueError:
+ # ASGI header encoding specs, see:
+ # - https://asgi.readthedocs.io/en/latest/specs/www.html#wsgi-encoding-differences (see: WSGI encoding differences)
+ # - https://docs.python.org/3/library/codecs.html#text-encodings (see: Text Encodings)
+ return value.decode("unicode_escape")
diff --git a/instrumentation/opentelemetry-instrumentation-asgi/tests/test_asgi_custom_headers.py b/instrumentation/opentelemetry-instrumentation-asgi/tests/test_asgi_custom_headers.py
index f6cb05fbda..1b191e30e7 100644
--- a/instrumentation/opentelemetry-instrumentation-asgi/tests/test_asgi_custom_headers.py
+++ b/instrumentation/opentelemetry-instrumentation-asgi/tests/test_asgi_custom_headers.py
@@ -48,6 +48,14 @@ async def http_app_with_custom_headers(scope, receive, send):
b"my-custom-regex-value-3,my-custom-regex-value-4",
),
(b"my-secret-header", b"my-secret-value"),
+ (
+ b"non-utf8-header",
+ b"Moto Z\xb2",
+ ),
+ (
+ b"Moto-Z\xb2-non-utf8-header-key",
+ b"Moto Z\xb2",
+ ),
],
}
)
@@ -130,6 +138,14 @@ async def test_http_custom_request_headers_in_span_attributes(self):
(b"Regex-Test-Header-1", b"Regex Test Value 1"),
(b"regex-test-header-2", b"RegexTestValue2,RegexTestValue3"),
(b"My-Secret-Header", b"My Secret Value"),
+ (
+ b"non-utf8-header",
+ b"Moto Z\xb2",
+ ),
+ (
+ b"Moto-Z\xb2-non-utf8-header-key",
+ b"Moto Z\xb2",
+ ),
]
)
self.seed_app(self.app)
@@ -147,6 +163,8 @@ async def test_http_custom_request_headers_in_span_attributes(self):
"http.request.header.regex_test_header_2": (
"RegexTestValue2,RegexTestValue3",
),
+ "http.request.header.non_utf8_header": ("Moto Z²",),
+ "http.request.header.moto_z²_non_utf8_header_key": ("Moto Z²",),
"http.request.header.my_secret_header": ("[REDACTED]",),
}
for span in span_list:
@@ -223,6 +241,8 @@ async def test_http_custom_response_headers_in_span_attributes(self):
"my-custom-regex-value-3,my-custom-regex-value-4",
),
"http.response.header.my_secret_header": ("[REDACTED]",),
+ "http.response.header.non_utf8_header": ("Moto Z²",),
+ "http.response.header.moto_z²_non_utf8_header_key": ("Moto Z²",),
}
for span in span_list:
if span.kind == SpanKind.SERVER:
@@ -418,8 +438,8 @@ async def test_websocket_custom_response_headers_not_in_span_attributes(
SANITIZE_FIELDS_TEST_VALUE = ".*my-secret.*"
-SERVER_REQUEST_TEST_VALUE = "Custom-Test-Header-1,Custom-Test-Header-2,Custom-Test-Header-3,Regex-Test-Header-.*,Regex-Invalid-Test-Header-.*,.*my-secret.*"
-SERVER_RESPONSE_TEST_VALUE = "Custom-Test-Header-1,Custom-Test-Header-2,Custom-Test-Header-3,my-custom-regex-header-.*,invalid-regex-header-.*,.*my-secret.*"
+SERVER_REQUEST_TEST_VALUE = "Custom-Test-Header-1,Custom-Test-Header-2,Custom-Test-Header-3,Regex-Test-Header-.*,Regex-Invalid-Test-Header-.*,.*my-secret.*,non-utf8-header,Moto-Z²-non-utf8-header-key"
+SERVER_RESPONSE_TEST_VALUE = "Custom-Test-Header-1,Custom-Test-Header-2,Custom-Test-Header-3,my-custom-regex-header-.*,invalid-regex-header-.*,.*my-secret.*,non-utf8-header,Moto-Z²-non-utf8-header-key"
class TestCustomHeadersEnv(TestCustomHeaders):
diff --git a/instrumentation/opentelemetry-instrumentation-asgi/tests/test_getter.py b/instrumentation/opentelemetry-instrumentation-asgi/tests/test_getter.py
index 26bb652b50..3f76e0e5ce 100644
--- a/instrumentation/opentelemetry-instrumentation-asgi/tests/test_getter.py
+++ b/instrumentation/opentelemetry-instrumentation-asgi/tests/test_getter.py
@@ -69,3 +69,13 @@ def test_keys(self):
expected_val,
"Should be equal",
)
+
+ def test_non_utf8_headers(self):
+ getter = ASGIGetter()
+ carrier = {"headers": [(b"test-key", b"Moto Z\xb2")]}
+ expected_val = ["Moto Z²"]
+ self.assertEqual(
+ getter.get(carrier, "test-key"),
+ expected_val,
+ "Should be equal",
+ )
From f8bb28928cccdb1236a9aab1dec9cb0179cbb9be Mon Sep 17 00:00:00 2001
From: Anton Pirker
Date: Thu, 26 Sep 2024 08:52:02 +0200
Subject: [PATCH 32/33] Update test requirements for work with Python 3.13
(#2887)
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
* Added deb to make cassandra tests work with python 3.13
* Bumped cffi to work with Python 3.13
* Fixed some test-requirements for Python 3.13
* Updated typing_extensions everywhere
---------
Co-authored-by: EmÃdio Neto <9735060+emdneto@users.noreply.github.com>
---
.../test-requirements.txt | 2 +-
.../test-requirements.txt | 2 +-
.../test-requirements-0.txt | 2 +-
.../test-requirements-1.txt | 2 +-
.../test-requirements-2.txt | 2 +-
.../test-requirements-3.txt | 2 +-
.../test-requirements.txt | 2 +-
.../test-requirements.txt | 2 +-
.../test-requirements.txt | 2 +-
.../test-requirements.txt | 2 +-
.../test-requirements.txt | 2 +-
.../test-requirements.txt | 2 +-
.../test-requirements.txt | 2 +-
.../test-requirements.txt | 4 ++--
.../test-requirements.txt | 2 +-
.../test-requirements.txt | 4 ++--
.../test-requirements.txt | 3 ++-
.../test-requirements-0.txt | 2 +-
.../test-requirements-1.txt | 2 +-
.../test-requirements.txt | 2 +-
.../test-requirements.txt | 2 +-
.../test-requirements-0.txt | 2 +-
.../test-requirements-1.txt | 2 +-
.../test-requirements-2.txt | 2 +-
.../test-requirements-3.txt | 2 +-
.../test-requirements-0.txt | 2 +-
.../test-requirements-1.txt | 2 +-
.../test-requirements-2.txt | 2 +-
.../test-requirements-0.txt | 2 +-
.../test-requirements-1.txt | 2 +-
.../test-requirements-2.txt | 2 +-
.../test-requirements.txt | 8 ++++----
.../test-requirements-0.txt | 2 +-
.../test-requirements-1.txt | 2 +-
.../test-requirements-2.txt | 2 +-
.../test-requirements-0.txt | 2 +-
.../test-requirements-1.txt | 2 +-
.../test-requirements-0.txt | 2 +-
.../test-requirements-1.txt | 2 +-
.../test-requirements.txt | 2 +-
.../test-requirements.txt | 2 +-
.../test-requirements.txt | 2 +-
.../test-requirements-0.txt | 2 +-
.../test-requirements.txt | 2 +-
.../test-requirements-0.txt | 2 +-
.../test-requirements-1.txt | 2 +-
.../test-requirements-0.txt | 2 +-
.../test-requirements-1.txt | 2 +-
.../test-requirements.txt | 2 +-
.../test-requirements-0.txt | 2 +-
.../test-requirements-1.txt | 2 +-
.../test-requirements-2.txt | 2 +-
.../test-requirements-3.txt | 2 +-
.../test-requirements-4.txt | 2 +-
.../test-requirements.txt | 2 +-
.../test-requirements.txt | 2 +-
.../test-requirements.txt | 2 +-
.../test-requirements.txt | 2 +-
.../test-requirements.txt | 2 +-
.../test-requirements.txt | 2 +-
.../test-requirements-0.txt | 4 ++--
.../test-requirements-1.txt | 2 +-
.../test-requirements.txt | 2 +-
.../test-requirements.txt | 2 +-
.../test-requirements.txt | 2 +-
.../test-requirements.txt | 2 +-
.../test-requirements.txt | 2 +-
.../test-requirements.txt | 8 ++++----
.../test-requirements.txt | 2 +-
.../test-requirements-0.txt | 2 +-
.../test-requirements-1.txt | 2 +-
.../test-requirements.txt | 2 +-
opentelemetry-distro/test-requirements.txt | 2 +-
opentelemetry-instrumentation/test-requirements.txt | 2 +-
.../test-requirements.txt | 2 +-
.../test-requirements.txt | 2 +-
.../test-requirements.txt | 2 +-
.../test-requirements.txt | 2 +-
.../opentelemetry-sdk-extension-aws/test-requirements.txt | 2 +-
tox.ini | 2 +-
util/opentelemetry-util-http/test-requirements.txt | 2 +-
81 files changed, 91 insertions(+), 90 deletions(-)
diff --git a/exporter/opentelemetry-exporter-prometheus-remote-write/test-requirements.txt b/exporter/opentelemetry-exporter-prometheus-remote-write/test-requirements.txt
index 5836dc9764..318e1e68d5 100644
--- a/exporter/opentelemetry-exporter-prometheus-remote-write/test-requirements.txt
+++ b/exporter/opentelemetry-exporter-prometheus-remote-write/test-requirements.txt
@@ -16,7 +16,7 @@ pytest==7.4.4
python-snappy==0.7.1
requests==2.32.3
tomli==2.0.1
-typing_extensions==4.10.0
+typing_extensions==4.12.2
urllib3==2.2.2
wrapt==1.16.0
zipp==3.19.2
diff --git a/exporter/opentelemetry-exporter-richconsole/test-requirements.txt b/exporter/opentelemetry-exporter-richconsole/test-requirements.txt
index 0ef562821f..a63c91d0d8 100644
--- a/exporter/opentelemetry-exporter-richconsole/test-requirements.txt
+++ b/exporter/opentelemetry-exporter-richconsole/test-requirements.txt
@@ -12,7 +12,7 @@ Pygments==2.17.2
pytest==7.4.4
rich==13.7.1
tomli==2.0.1
-typing_extensions==4.10.0
+typing_extensions==4.12.2
wrapt==1.16.0
zipp==3.19.2
-e exporter/opentelemetry-exporter-richconsole
diff --git a/instrumentation/opentelemetry-instrumentation-aio-pika/test-requirements-0.txt b/instrumentation/opentelemetry-instrumentation-aio-pika/test-requirements-0.txt
index de853e16c9..26c7046817 100644
--- a/instrumentation/opentelemetry-instrumentation-aio-pika/test-requirements-0.txt
+++ b/instrumentation/opentelemetry-instrumentation-aio-pika/test-requirements-0.txt
@@ -12,7 +12,7 @@ pluggy==1.5.0
py-cpuinfo==9.0.0
pytest==7.4.4
tomli==2.0.1
-typing_extensions==4.9.0
+typing_extensions==4.12.2
wrapt==1.16.0
yarl==1.9.4
zipp==3.19.2
diff --git a/instrumentation/opentelemetry-instrumentation-aio-pika/test-requirements-1.txt b/instrumentation/opentelemetry-instrumentation-aio-pika/test-requirements-1.txt
index dbfb89fe82..fac907831a 100644
--- a/instrumentation/opentelemetry-instrumentation-aio-pika/test-requirements-1.txt
+++ b/instrumentation/opentelemetry-instrumentation-aio-pika/test-requirements-1.txt
@@ -12,7 +12,7 @@ pluggy==1.5.0
py-cpuinfo==9.0.0
pytest==7.4.4
tomli==2.0.1
-typing_extensions==4.9.0
+typing_extensions==4.12.2
wrapt==1.16.0
yarl==1.9.4
zipp==3.19.2
diff --git a/instrumentation/opentelemetry-instrumentation-aio-pika/test-requirements-2.txt b/instrumentation/opentelemetry-instrumentation-aio-pika/test-requirements-2.txt
index 6a95bd69f0..ad807173e8 100644
--- a/instrumentation/opentelemetry-instrumentation-aio-pika/test-requirements-2.txt
+++ b/instrumentation/opentelemetry-instrumentation-aio-pika/test-requirements-2.txt
@@ -12,7 +12,7 @@ pluggy==1.5.0
py-cpuinfo==9.0.0
pytest==7.4.4
tomli==2.0.1
-typing_extensions==4.9.0
+typing_extensions==4.12.2
wrapt==1.16.0
yarl==1.9.4
zipp==3.19.2
diff --git a/instrumentation/opentelemetry-instrumentation-aio-pika/test-requirements-3.txt b/instrumentation/opentelemetry-instrumentation-aio-pika/test-requirements-3.txt
index 82e742a1f4..766cc6cf86 100644
--- a/instrumentation/opentelemetry-instrumentation-aio-pika/test-requirements-3.txt
+++ b/instrumentation/opentelemetry-instrumentation-aio-pika/test-requirements-3.txt
@@ -12,7 +12,7 @@ pluggy==1.5.0
py-cpuinfo==9.0.0
pytest==7.4.4
tomli==2.0.1
-typing_extensions==4.9.0
+typing_extensions==4.12.2
wrapt==1.16.0
yarl==1.9.4
zipp==3.19.2
diff --git a/instrumentation/opentelemetry-instrumentation-aiohttp-client/test-requirements.txt b/instrumentation/opentelemetry-instrumentation-aiohttp-client/test-requirements.txt
index dee4736133..f4da0edc25 100644
--- a/instrumentation/opentelemetry-instrumentation-aiohttp-client/test-requirements.txt
+++ b/instrumentation/opentelemetry-instrumentation-aiohttp-client/test-requirements.txt
@@ -23,7 +23,7 @@ py-cpuinfo==9.0.0
pytest==7.4.4
requests==2.32.3
tomli==2.0.1
-typing_extensions==4.10.0
+typing_extensions==4.12.2
urllib3==2.2.2
Werkzeug==3.0.3
wrapt==1.16.0
diff --git a/instrumentation/opentelemetry-instrumentation-aiohttp-server/test-requirements.txt b/instrumentation/opentelemetry-instrumentation-aiohttp-server/test-requirements.txt
index e6dff52db9..d84eccb649 100644
--- a/instrumentation/opentelemetry-instrumentation-aiohttp-server/test-requirements.txt
+++ b/instrumentation/opentelemetry-instrumentation-aiohttp-server/test-requirements.txt
@@ -15,7 +15,7 @@ pytest==7.4.4
pytest-aiohttp==1.0.5
pytest-asyncio==0.23.5
tomli==2.0.1
-typing_extensions==4.10.0
+typing_extensions==4.12.2
wrapt==1.16.0
yarl==1.9.4
zipp==3.19.2
diff --git a/instrumentation/opentelemetry-instrumentation-aiopg/test-requirements.txt b/instrumentation/opentelemetry-instrumentation-aiopg/test-requirements.txt
index 1443104081..df527586f7 100644
--- a/instrumentation/opentelemetry-instrumentation-aiopg/test-requirements.txt
+++ b/instrumentation/opentelemetry-instrumentation-aiopg/test-requirements.txt
@@ -10,7 +10,7 @@ psycopg2-binary==2.9.9
py-cpuinfo==9.0.0
pytest==7.4.4
tomli==2.0.1
-typing_extensions==4.10.0
+typing_extensions==4.12.2
wrapt==1.16.0
zipp==3.19.2
-e opentelemetry-instrumentation
diff --git a/instrumentation/opentelemetry-instrumentation-asgi/test-requirements.txt b/instrumentation/opentelemetry-instrumentation-asgi/test-requirements.txt
index 18a11500e1..de88049226 100644
--- a/instrumentation/opentelemetry-instrumentation-asgi/test-requirements.txt
+++ b/instrumentation/opentelemetry-instrumentation-asgi/test-requirements.txt
@@ -7,7 +7,7 @@ pluggy==1.5.0
py-cpuinfo==9.0.0
pytest==7.4.4
tomli==2.0.1
-typing_extensions==4.9.0
+typing_extensions==4.12.2
wrapt==1.16.0
zipp==3.19.2
-e opentelemetry-instrumentation
diff --git a/instrumentation/opentelemetry-instrumentation-asyncio/test-requirements.txt b/instrumentation/opentelemetry-instrumentation-asyncio/test-requirements.txt
index 7f20d1497c..190e1cbe02 100644
--- a/instrumentation/opentelemetry-instrumentation-asyncio/test-requirements.txt
+++ b/instrumentation/opentelemetry-instrumentation-asyncio/test-requirements.txt
@@ -8,7 +8,7 @@ py-cpuinfo==9.0.0
pytest==7.4.4
pytest-asyncio==0.23.5
tomli==2.0.1
-typing_extensions==4.9.0
+typing_extensions==4.12.2
wrapt==1.16.0
zipp==3.19.2
-e opentelemetry-instrumentation
diff --git a/instrumentation/opentelemetry-instrumentation-asyncpg/test-requirements.txt b/instrumentation/opentelemetry-instrumentation-asyncpg/test-requirements.txt
index 60cef50a7a..bb41329e66 100644
--- a/instrumentation/opentelemetry-instrumentation-asyncpg/test-requirements.txt
+++ b/instrumentation/opentelemetry-instrumentation-asyncpg/test-requirements.txt
@@ -9,7 +9,7 @@ pluggy==1.5.0
py-cpuinfo==9.0.0
pytest==7.4.4
tomli==2.0.1
-typing_extensions==4.9.0
+typing_extensions==4.12.2
wrapt==1.16.0
zipp==3.19.2
-e opentelemetry-instrumentation
diff --git a/instrumentation/opentelemetry-instrumentation-aws-lambda/test-requirements.txt b/instrumentation/opentelemetry-instrumentation-aws-lambda/test-requirements.txt
index 8d9fe19483..a80527dd36 100644
--- a/instrumentation/opentelemetry-instrumentation-aws-lambda/test-requirements.txt
+++ b/instrumentation/opentelemetry-instrumentation-aws-lambda/test-requirements.txt
@@ -7,7 +7,7 @@ pluggy==1.5.0
py-cpuinfo==9.0.0
pytest==7.4.4
tomli==2.0.1
-typing_extensions==4.9.0
+typing_extensions==4.12.2
wrapt==1.16.0
zipp==3.19.2
-e opentelemetry-instrumentation
diff --git a/instrumentation/opentelemetry-instrumentation-boto/test-requirements.txt b/instrumentation/opentelemetry-instrumentation-boto/test-requirements.txt
index fe6467d1c4..bb56100ecb 100644
--- a/instrumentation/opentelemetry-instrumentation-boto/test-requirements.txt
+++ b/instrumentation/opentelemetry-instrumentation-boto/test-requirements.txt
@@ -3,7 +3,7 @@ boto==2.49.0
boto3==1.34.44
botocore==1.34.44
certifi==2024.7.4
-cffi==1.16.0
+cffi==1.17.0
charset-normalizer==3.3.2
cryptography==42.0.5
Deprecated==1.2.14
@@ -28,7 +28,7 @@ responses==0.25.0
s3transfer==0.10.0
six==1.16.0
tomli==2.0.1
-typing_extensions==4.9.0
+typing_extensions==4.12.2
urllib3==1.26.19
Werkzeug==2.3.8
wrapt==1.16.0
diff --git a/instrumentation/opentelemetry-instrumentation-boto3sqs/test-requirements.txt b/instrumentation/opentelemetry-instrumentation-boto3sqs/test-requirements.txt
index d8a9c38315..dfa17c79a7 100644
--- a/instrumentation/opentelemetry-instrumentation-boto3sqs/test-requirements.txt
+++ b/instrumentation/opentelemetry-instrumentation-boto3sqs/test-requirements.txt
@@ -13,7 +13,7 @@ python-dateutil==2.8.2
s3transfer==0.10.0
six==1.16.0
tomli==2.0.1
-typing_extensions==4.9.0
+typing_extensions==4.12.2
urllib3==1.26.19
wrapt==1.16.0
zipp==3.19.2
diff --git a/instrumentation/opentelemetry-instrumentation-botocore/test-requirements.txt b/instrumentation/opentelemetry-instrumentation-botocore/test-requirements.txt
index a89fdf2e30..f0ceb9f467 100644
--- a/instrumentation/opentelemetry-instrumentation-botocore/test-requirements.txt
+++ b/instrumentation/opentelemetry-instrumentation-botocore/test-requirements.txt
@@ -3,7 +3,7 @@ aws-xray-sdk==2.12.1
boto3==1.28.80
botocore==1.31.80
certifi==2024.7.4
-cffi==1.16.0
+cffi==1.17.0
charset-normalizer==3.3.2
cryptography==42.0.5
Deprecated==1.2.14
@@ -28,7 +28,7 @@ responses==0.25.0
s3transfer==0.7.0
six==1.16.0
tomli==2.0.1
-typing_extensions==4.9.0
+typing_extensions==4.12.2
urllib3==1.26.19
Werkzeug==3.0.3
wrapt==1.16.0
diff --git a/instrumentation/opentelemetry-instrumentation-cassandra/test-requirements.txt b/instrumentation/opentelemetry-instrumentation-cassandra/test-requirements.txt
index 189b2f65d0..25bf51f2a5 100644
--- a/instrumentation/opentelemetry-instrumentation-cassandra/test-requirements.txt
+++ b/instrumentation/opentelemetry-instrumentation-cassandra/test-requirements.txt
@@ -1,5 +1,6 @@
asgiref==3.8.1
cassandra-driver==3.29.0
+pyasyncore==1.0.4 # for python 3.13 (should removed when cassandra-driver replaces asyncore with recommended asyncio)
click==8.1.7
Deprecated==1.2.14
geomet==0.2.1.post1
@@ -13,7 +14,7 @@ PyYAML==6.0.1
scylla-driver==3.26.6
six==1.16.0
tomli==2.0.1
-typing_extensions==4.9.0
+typing_extensions==4.12.2
wrapt==1.16.0
zipp==3.19.2
-e opentelemetry-instrumentation
diff --git a/instrumentation/opentelemetry-instrumentation-celery/test-requirements-0.txt b/instrumentation/opentelemetry-instrumentation-celery/test-requirements-0.txt
index fcf838fc32..1e018aae6e 100644
--- a/instrumentation/opentelemetry-instrumentation-celery/test-requirements-0.txt
+++ b/instrumentation/opentelemetry-instrumentation-celery/test-requirements-0.txt
@@ -19,7 +19,7 @@ pytest==7.4.4
python-dateutil==2.8.2
six==1.16.0
tomli==2.0.1
-typing_extensions==4.9.0
+typing_extensions==4.12.2
tzdata==2024.1
vine==5.1.0
wcwidth==0.2.13
diff --git a/instrumentation/opentelemetry-instrumentation-celery/test-requirements-1.txt b/instrumentation/opentelemetry-instrumentation-celery/test-requirements-1.txt
index 76b2f03d12..c7d494aceb 100644
--- a/instrumentation/opentelemetry-instrumentation-celery/test-requirements-1.txt
+++ b/instrumentation/opentelemetry-instrumentation-celery/test-requirements-1.txt
@@ -18,7 +18,7 @@ pytest==7.4.4
python-dateutil==2.8.2
six==1.16.0
tomli==2.0.1
-typing_extensions==4.9.0
+typing_extensions==4.12.2
tzdata==2024.1
vine==5.1.0
wcwidth==0.2.13
diff --git a/instrumentation/opentelemetry-instrumentation-confluent-kafka/test-requirements.txt b/instrumentation/opentelemetry-instrumentation-confluent-kafka/test-requirements.txt
index f78f498620..7f389a12af 100644
--- a/instrumentation/opentelemetry-instrumentation-confluent-kafka/test-requirements.txt
+++ b/instrumentation/opentelemetry-instrumentation-confluent-kafka/test-requirements.txt
@@ -8,7 +8,7 @@ pluggy==1.5.0
py-cpuinfo==9.0.0
pytest==7.4.4
tomli==2.0.1
-typing_extensions==4.9.0
+typing_extensions==4.12.2
wrapt==1.16.0
zipp==3.19.2
-e opentelemetry-instrumentation
diff --git a/instrumentation/opentelemetry-instrumentation-dbapi/test-requirements.txt b/instrumentation/opentelemetry-instrumentation-dbapi/test-requirements.txt
index f76b488d90..1275616d45 100644
--- a/instrumentation/opentelemetry-instrumentation-dbapi/test-requirements.txt
+++ b/instrumentation/opentelemetry-instrumentation-dbapi/test-requirements.txt
@@ -7,7 +7,7 @@ pluggy==1.5.0
py-cpuinfo==9.0.0
pytest==7.4.4
tomli==2.0.1
-typing_extensions==4.9.0
+typing_extensions==4.12.2
wrapt==1.16.0
zipp==3.19.2
-e opentelemetry-instrumentation
diff --git a/instrumentation/opentelemetry-instrumentation-django/test-requirements-0.txt b/instrumentation/opentelemetry-instrumentation-django/test-requirements-0.txt
index 9d7ee964fe..6c1b8337a4 100644
--- a/instrumentation/opentelemetry-instrumentation-django/test-requirements-0.txt
+++ b/instrumentation/opentelemetry-instrumentation-django/test-requirements-0.txt
@@ -10,7 +10,7 @@ pytest==7.4.4
pytz==2024.1
sqlparse==0.5.0
tomli==2.0.1
-typing_extensions==4.10.0
+typing_extensions==4.12.2
wrapt==1.16.0
zipp==3.19.2
-e opentelemetry-instrumentation
diff --git a/instrumentation/opentelemetry-instrumentation-django/test-requirements-1.txt b/instrumentation/opentelemetry-instrumentation-django/test-requirements-1.txt
index 9c21d2dfd4..357fd273f5 100644
--- a/instrumentation/opentelemetry-instrumentation-django/test-requirements-1.txt
+++ b/instrumentation/opentelemetry-instrumentation-django/test-requirements-1.txt
@@ -10,7 +10,7 @@ pytest==7.4.4
pytz==2024.1
sqlparse==0.5.0
tomli==2.0.1
-typing_extensions==4.10.0
+typing_extensions==4.12.2
wrapt==1.16.0
zipp==3.19.2
-e opentelemetry-instrumentation
diff --git a/instrumentation/opentelemetry-instrumentation-django/test-requirements-2.txt b/instrumentation/opentelemetry-instrumentation-django/test-requirements-2.txt
index d3a55aae34..1d15b1336b 100644
--- a/instrumentation/opentelemetry-instrumentation-django/test-requirements-2.txt
+++ b/instrumentation/opentelemetry-instrumentation-django/test-requirements-2.txt
@@ -10,7 +10,7 @@ py-cpuinfo==9.0.0
pytest==7.4.4
sqlparse==0.5.0
tomli==2.0.1
-typing_extensions==4.10.0
+typing_extensions==4.12.2
wrapt==1.16.0
zipp==3.19.2
-e opentelemetry-instrumentation
diff --git a/instrumentation/opentelemetry-instrumentation-django/test-requirements-3.txt b/instrumentation/opentelemetry-instrumentation-django/test-requirements-3.txt
index 89923379d3..fa483e5ade 100644
--- a/instrumentation/opentelemetry-instrumentation-django/test-requirements-3.txt
+++ b/instrumentation/opentelemetry-instrumentation-django/test-requirements-3.txt
@@ -9,7 +9,7 @@ py-cpuinfo==9.0.0
pytest==7.4.4
sqlparse==0.5.0
tomli==2.0.1
-typing_extensions==4.10.0
+typing_extensions==4.12.2
wrapt==1.16.0
zipp==3.19.2
-e opentelemetry-instrumentation
diff --git a/instrumentation/opentelemetry-instrumentation-elasticsearch/test-requirements-0.txt b/instrumentation/opentelemetry-instrumentation-elasticsearch/test-requirements-0.txt
index 55eabe1ef5..977a440c85 100644
--- a/instrumentation/opentelemetry-instrumentation-elasticsearch/test-requirements-0.txt
+++ b/instrumentation/opentelemetry-instrumentation-elasticsearch/test-requirements-0.txt
@@ -11,7 +11,7 @@ pytest==7.4.4
python-dateutil==2.8.2
six==1.16.0
tomli==2.0.1
-typing_extensions==4.10.0
+typing_extensions==4.12.2
urllib3==1.26.19
wrapt==1.16.0
zipp==3.19.2
diff --git a/instrumentation/opentelemetry-instrumentation-elasticsearch/test-requirements-1.txt b/instrumentation/opentelemetry-instrumentation-elasticsearch/test-requirements-1.txt
index 2fab7287ad..44451736c8 100644
--- a/instrumentation/opentelemetry-instrumentation-elasticsearch/test-requirements-1.txt
+++ b/instrumentation/opentelemetry-instrumentation-elasticsearch/test-requirements-1.txt
@@ -11,7 +11,7 @@ pytest==7.4.4
python-dateutil==2.8.2
six==1.16.0
tomli==2.0.1
-typing_extensions==4.10.0
+typing_extensions==4.12.2
urllib3==1.26.19
wrapt==1.16.0
zipp==3.19.2
diff --git a/instrumentation/opentelemetry-instrumentation-elasticsearch/test-requirements-2.txt b/instrumentation/opentelemetry-instrumentation-elasticsearch/test-requirements-2.txt
index 5f2ccd41ac..a02a9c0270 100644
--- a/instrumentation/opentelemetry-instrumentation-elasticsearch/test-requirements-2.txt
+++ b/instrumentation/opentelemetry-instrumentation-elasticsearch/test-requirements-2.txt
@@ -12,7 +12,7 @@ pytest==7.4.4
python-dateutil==2.8.2
six==1.16.0
tomli==2.0.1
-typing_extensions==4.10.0
+typing_extensions==4.12.2
urllib3==2.2.2
wrapt==1.16.0
zipp==3.19.2
diff --git a/instrumentation/opentelemetry-instrumentation-falcon/test-requirements-0.txt b/instrumentation/opentelemetry-instrumentation-falcon/test-requirements-0.txt
index 6967c57b6d..11a84eef70 100644
--- a/instrumentation/opentelemetry-instrumentation-falcon/test-requirements-0.txt
+++ b/instrumentation/opentelemetry-instrumentation-falcon/test-requirements-0.txt
@@ -10,7 +10,7 @@ pytest==7.4.4
python-mimeparse==1.6.0
six==1.16.0
tomli==2.0.1
-typing_extensions==4.10.0
+typing_extensions==4.12.2
wrapt==1.16.0
zipp==3.19.2
-e opentelemetry-instrumentation
diff --git a/instrumentation/opentelemetry-instrumentation-falcon/test-requirements-1.txt b/instrumentation/opentelemetry-instrumentation-falcon/test-requirements-1.txt
index e535925b14..9d646f3bbb 100644
--- a/instrumentation/opentelemetry-instrumentation-falcon/test-requirements-1.txt
+++ b/instrumentation/opentelemetry-instrumentation-falcon/test-requirements-1.txt
@@ -8,7 +8,7 @@ pluggy==1.5.0
py-cpuinfo==9.0.0
pytest==7.4.4
tomli==2.0.1
-typing_extensions==4.10.0
+typing_extensions==4.12.2
wrapt==1.16.0
zipp==3.19.2
-e opentelemetry-instrumentation
diff --git a/instrumentation/opentelemetry-instrumentation-falcon/test-requirements-2.txt b/instrumentation/opentelemetry-instrumentation-falcon/test-requirements-2.txt
index 30d21e2773..d2a921eb87 100644
--- a/instrumentation/opentelemetry-instrumentation-falcon/test-requirements-2.txt
+++ b/instrumentation/opentelemetry-instrumentation-falcon/test-requirements-2.txt
@@ -8,7 +8,7 @@ pluggy==1.5.0
py-cpuinfo==9.0.0
pytest==7.4.4
tomli==2.0.1
-typing_extensions==4.10.0
+typing_extensions==4.12.2
wrapt==1.16.0
zipp==3.19.2
-e opentelemetry-instrumentation
diff --git a/instrumentation/opentelemetry-instrumentation-fastapi/test-requirements.txt b/instrumentation/opentelemetry-instrumentation-fastapi/test-requirements.txt
index 927e68f94e..0417301559 100644
--- a/instrumentation/opentelemetry-instrumentation-fastapi/test-requirements.txt
+++ b/instrumentation/opentelemetry-instrumentation-fastapi/test-requirements.txt
@@ -1,4 +1,4 @@
-annotated-types==0.6.0
+annotated-types==0.7.0
anyio==4.3.0
asgiref==3.8.1
certifi==2024.7.4
@@ -15,14 +15,14 @@ iniconfig==2.0.0
packaging==24.0
pluggy==1.5.0
py-cpuinfo==9.0.0
-pydantic==2.6.2
-pydantic_core==2.16.3
+pydantic==2.8.2
+pydantic_core==2.20.1
pytest==7.4.4
requests==2.32.3
sniffio==1.3.0
starlette==0.36.3
tomli==2.0.1
-typing_extensions==4.9.0
+typing_extensions==4.12.2
urllib3==2.2.2
wrapt==1.16.0
zipp==3.19.2
diff --git a/instrumentation/opentelemetry-instrumentation-flask/test-requirements-0.txt b/instrumentation/opentelemetry-instrumentation-flask/test-requirements-0.txt
index 0bd176848d..e6fa669267 100644
--- a/instrumentation/opentelemetry-instrumentation-flask/test-requirements-0.txt
+++ b/instrumentation/opentelemetry-instrumentation-flask/test-requirements-0.txt
@@ -12,7 +12,7 @@ pluggy==1.5.0
py-cpuinfo==9.0.0
pytest==7.4.4
tomli==2.0.1
-typing_extensions==4.9.0
+typing_extensions==4.12.2
Werkzeug==2.3.8
wrapt==1.16.0
zipp==3.19.2
diff --git a/instrumentation/opentelemetry-instrumentation-flask/test-requirements-1.txt b/instrumentation/opentelemetry-instrumentation-flask/test-requirements-1.txt
index d73ab497b5..ecd3f680d8 100644
--- a/instrumentation/opentelemetry-instrumentation-flask/test-requirements-1.txt
+++ b/instrumentation/opentelemetry-instrumentation-flask/test-requirements-1.txt
@@ -12,7 +12,7 @@ pluggy==1.5.0
py-cpuinfo==9.0.0
pytest==7.4.4
tomli==2.0.1
-typing_extensions==4.9.0
+typing_extensions==4.12.2
Werkzeug==2.3.8
wrapt==1.16.0
zipp==3.19.2
diff --git a/instrumentation/opentelemetry-instrumentation-flask/test-requirements-2.txt b/instrumentation/opentelemetry-instrumentation-flask/test-requirements-2.txt
index 299a347d66..da044a29e9 100644
--- a/instrumentation/opentelemetry-instrumentation-flask/test-requirements-2.txt
+++ b/instrumentation/opentelemetry-instrumentation-flask/test-requirements-2.txt
@@ -13,7 +13,7 @@ pluggy==1.5.0
py-cpuinfo==9.0.0
pytest==7.4.4
tomli==2.0.1
-typing_extensions==4.9.0
+typing_extensions==4.12.2
Werkzeug==3.0.3
wrapt==1.16.0
zipp==3.19.2
diff --git a/instrumentation/opentelemetry-instrumentation-grpc/test-requirements-0.txt b/instrumentation/opentelemetry-instrumentation-grpc/test-requirements-0.txt
index 83ec6e8e70..cdea5fca4b 100644
--- a/instrumentation/opentelemetry-instrumentation-grpc/test-requirements-0.txt
+++ b/instrumentation/opentelemetry-instrumentation-grpc/test-requirements-0.txt
@@ -9,7 +9,7 @@ protobuf==3.20.3
py-cpuinfo==9.0.0
pytest==7.4.4
tomli==2.0.1
-typing_extensions==4.9.0
+typing_extensions==4.12.2
wrapt==1.16.0
zipp==3.19.2
-e opentelemetry-instrumentation
diff --git a/instrumentation/opentelemetry-instrumentation-grpc/test-requirements-1.txt b/instrumentation/opentelemetry-instrumentation-grpc/test-requirements-1.txt
index d77d67148a..9b2d088da3 100644
--- a/instrumentation/opentelemetry-instrumentation-grpc/test-requirements-1.txt
+++ b/instrumentation/opentelemetry-instrumentation-grpc/test-requirements-1.txt
@@ -9,7 +9,7 @@ protobuf==3.20.3
py-cpuinfo==9.0.0
pytest==7.4.4
tomli==2.0.1
-typing_extensions==4.9.0
+typing_extensions==4.12.2
wrapt==1.16.0
zipp==3.19.2
-e opentelemetry-instrumentation
diff --git a/instrumentation/opentelemetry-instrumentation-httpx/test-requirements-0.txt b/instrumentation/opentelemetry-instrumentation-httpx/test-requirements-0.txt
index 28b475a3a4..34eac9d10c 100644
--- a/instrumentation/opentelemetry-instrumentation-httpx/test-requirements-0.txt
+++ b/instrumentation/opentelemetry-instrumentation-httpx/test-requirements-0.txt
@@ -17,7 +17,7 @@ respx==0.17.1
rfc3986==1.5.0
sniffio==1.3.1
tomli==2.0.1
-typing_extensions==4.10.0
+typing_extensions==4.12.2
wrapt==1.16.0
zipp==3.19.2
-e opentelemetry-instrumentation
diff --git a/instrumentation/opentelemetry-instrumentation-httpx/test-requirements-1.txt b/instrumentation/opentelemetry-instrumentation-httpx/test-requirements-1.txt
index 42c032a546..93b4d024cb 100644
--- a/instrumentation/opentelemetry-instrumentation-httpx/test-requirements-1.txt
+++ b/instrumentation/opentelemetry-instrumentation-httpx/test-requirements-1.txt
@@ -16,7 +16,7 @@ pytest==7.4.4
respx==0.20.2
sniffio==1.3.1
tomli==2.0.1
-typing_extensions==4.10.0
+typing_extensions==4.12.2
wrapt==1.16.0
zipp==3.19.2
-e opentelemetry-instrumentation
diff --git a/instrumentation/opentelemetry-instrumentation-jinja2/test-requirements.txt b/instrumentation/opentelemetry-instrumentation-jinja2/test-requirements.txt
index 59eabe6997..c7a30b8eb5 100644
--- a/instrumentation/opentelemetry-instrumentation-jinja2/test-requirements.txt
+++ b/instrumentation/opentelemetry-instrumentation-jinja2/test-requirements.txt
@@ -9,7 +9,7 @@ pluggy==1.5.0
py-cpuinfo==9.0.0
pytest==7.4.4
tomli==2.0.1
-typing_extensions==4.9.0
+typing_extensions==4.12.2
wrapt==1.16.0
zipp==3.19.2
-e opentelemetry-instrumentation
diff --git a/instrumentation/opentelemetry-instrumentation-kafka-python/test-requirements.txt b/instrumentation/opentelemetry-instrumentation-kafka-python/test-requirements.txt
index 6582cf875b..a042ce833e 100644
--- a/instrumentation/opentelemetry-instrumentation-kafka-python/test-requirements.txt
+++ b/instrumentation/opentelemetry-instrumentation-kafka-python/test-requirements.txt
@@ -8,7 +8,7 @@ pluggy==1.5.0
py-cpuinfo==9.0.0
pytest==7.4.4
tomli==2.0.1
-typing_extensions==4.9.0
+typing_extensions==4.12.2
wrapt==1.16.0
zipp==3.19.2
-e opentelemetry-instrumentation
diff --git a/instrumentation/opentelemetry-instrumentation-logging/test-requirements.txt b/instrumentation/opentelemetry-instrumentation-logging/test-requirements.txt
index c0d2f044c8..600d066cc1 100644
--- a/instrumentation/opentelemetry-instrumentation-logging/test-requirements.txt
+++ b/instrumentation/opentelemetry-instrumentation-logging/test-requirements.txt
@@ -7,7 +7,7 @@ pluggy==1.5.0
py-cpuinfo==9.0.0
pytest==7.4.4
tomli==2.0.1
-typing_extensions==4.9.0
+typing_extensions==4.12.2
wrapt==1.16.0
zipp==3.19.2
-e opentelemetry-instrumentation
diff --git a/instrumentation/opentelemetry-instrumentation-mysql/test-requirements-0.txt b/instrumentation/opentelemetry-instrumentation-mysql/test-requirements-0.txt
index bf93434850..22e61d9df3 100644
--- a/instrumentation/opentelemetry-instrumentation-mysql/test-requirements-0.txt
+++ b/instrumentation/opentelemetry-instrumentation-mysql/test-requirements-0.txt
@@ -8,7 +8,7 @@ pluggy==1.5.0
py-cpuinfo==9.0.0
pytest==7.4.4
tomli==2.0.1
-typing_extensions==4.9.0
+typing_extensions==4.12.2
wrapt==1.16.0
zipp==3.19.2
-e opentelemetry-instrumentation
diff --git a/instrumentation/opentelemetry-instrumentation-mysqlclient/test-requirements.txt b/instrumentation/opentelemetry-instrumentation-mysqlclient/test-requirements.txt
index 8c3ed72f35..3dfa1b161d 100644
--- a/instrumentation/opentelemetry-instrumentation-mysqlclient/test-requirements.txt
+++ b/instrumentation/opentelemetry-instrumentation-mysqlclient/test-requirements.txt
@@ -8,7 +8,7 @@ pluggy==1.5.0
py-cpuinfo==9.0.0
pytest==7.4.4
tomli==2.0.1
-typing_extensions==4.9.0
+typing_extensions==4.12.2
wrapt==1.16.0
zipp==3.19.2
-e opentelemetry-instrumentation
diff --git a/instrumentation/opentelemetry-instrumentation-pika/test-requirements-0.txt b/instrumentation/opentelemetry-instrumentation-pika/test-requirements-0.txt
index e06bc0b395..871d4feac1 100644
--- a/instrumentation/opentelemetry-instrumentation-pika/test-requirements-0.txt
+++ b/instrumentation/opentelemetry-instrumentation-pika/test-requirements-0.txt
@@ -8,7 +8,7 @@ pluggy==1.5.0
py-cpuinfo==9.0.0
pytest==7.4.4
tomli==2.0.1
-typing_extensions==4.10.0
+typing_extensions==4.12.2
wrapt==1.16.0
zipp==3.19.2
-e opentelemetry-instrumentation
diff --git a/instrumentation/opentelemetry-instrumentation-pika/test-requirements-1.txt b/instrumentation/opentelemetry-instrumentation-pika/test-requirements-1.txt
index 8928f655c8..b1c9e9094f 100644
--- a/instrumentation/opentelemetry-instrumentation-pika/test-requirements-1.txt
+++ b/instrumentation/opentelemetry-instrumentation-pika/test-requirements-1.txt
@@ -8,7 +8,7 @@ pluggy==1.5.0
py-cpuinfo==9.0.0
pytest==7.4.4
tomli==2.0.1
-typing_extensions==4.10.0
+typing_extensions==4.12.2
wrapt==1.16.0
zipp==3.19.2
-e opentelemetry-instrumentation
diff --git a/instrumentation/opentelemetry-instrumentation-psycopg/test-requirements-0.txt b/instrumentation/opentelemetry-instrumentation-psycopg/test-requirements-0.txt
index 42bbac77d9..93ea09ca15 100644
--- a/instrumentation/opentelemetry-instrumentation-psycopg/test-requirements-0.txt
+++ b/instrumentation/opentelemetry-instrumentation-psycopg/test-requirements-0.txt
@@ -9,7 +9,7 @@ psycopg==3.1.18
py-cpuinfo==9.0.0
pytest==7.4.4
tomli==2.0.1
-typing_extensions==4.10.0
+typing_extensions==4.12.2
wrapt==1.16.0
zipp==3.19.2
-e opentelemetry-instrumentation
diff --git a/instrumentation/opentelemetry-instrumentation-psycopg/test-requirements-1.txt b/instrumentation/opentelemetry-instrumentation-psycopg/test-requirements-1.txt
index 1f7fb59f2d..096d31599a 100644
--- a/instrumentation/opentelemetry-instrumentation-psycopg/test-requirements-1.txt
+++ b/instrumentation/opentelemetry-instrumentation-psycopg/test-requirements-1.txt
@@ -8,7 +8,7 @@ psycopg==3.1.18
py-cpuinfo==9.0.0
pytest==7.4.4
tomli==2.0.1
-typing_extensions==4.10.0
+typing_extensions==4.12.2
wrapt==1.16.0
zipp==3.19.2
-e opentelemetry-instrumentation
diff --git a/instrumentation/opentelemetry-instrumentation-psycopg2/test-requirements.txt b/instrumentation/opentelemetry-instrumentation-psycopg2/test-requirements.txt
index aa98fa93d0..5ae59dc5ea 100644
--- a/instrumentation/opentelemetry-instrumentation-psycopg2/test-requirements.txt
+++ b/instrumentation/opentelemetry-instrumentation-psycopg2/test-requirements.txt
@@ -8,7 +8,7 @@ psycopg2==2.9.9
py-cpuinfo==9.0.0
pytest==7.4.4
tomli==2.0.1
-typing_extensions==4.10.0
+typing_extensions==4.12.2
wrapt==1.16.0
zipp==3.19.2
-e opentelemetry-instrumentation
diff --git a/instrumentation/opentelemetry-instrumentation-pymemcache/test-requirements-0.txt b/instrumentation/opentelemetry-instrumentation-pymemcache/test-requirements-0.txt
index 2c6e0e2749..25e0f03bd6 100644
--- a/instrumentation/opentelemetry-instrumentation-pymemcache/test-requirements-0.txt
+++ b/instrumentation/opentelemetry-instrumentation-pymemcache/test-requirements-0.txt
@@ -9,7 +9,7 @@ pymemcache==1.3.5
pytest==7.4.4
six==1.16.0
tomli==2.0.1
-typing_extensions==4.10.0
+typing_extensions==4.12.2
wrapt==1.16.0
zipp==3.19.2
-e opentelemetry-instrumentation
diff --git a/instrumentation/opentelemetry-instrumentation-pymemcache/test-requirements-1.txt b/instrumentation/opentelemetry-instrumentation-pymemcache/test-requirements-1.txt
index 36db8d4416..3005dc7aa8 100644
--- a/instrumentation/opentelemetry-instrumentation-pymemcache/test-requirements-1.txt
+++ b/instrumentation/opentelemetry-instrumentation-pymemcache/test-requirements-1.txt
@@ -9,7 +9,7 @@ pymemcache==2.2.2
pytest==7.4.4
six==1.16.0
tomli==2.0.1
-typing_extensions==4.10.0
+typing_extensions==4.12.2
wrapt==1.16.0
zipp==3.19.2
-e opentelemetry-instrumentation
diff --git a/instrumentation/opentelemetry-instrumentation-pymemcache/test-requirements-2.txt b/instrumentation/opentelemetry-instrumentation-pymemcache/test-requirements-2.txt
index 3e0359f731..4c259345c6 100644
--- a/instrumentation/opentelemetry-instrumentation-pymemcache/test-requirements-2.txt
+++ b/instrumentation/opentelemetry-instrumentation-pymemcache/test-requirements-2.txt
@@ -9,7 +9,7 @@ pymemcache==3.4.1
pytest==7.4.4
six==1.16.0
tomli==2.0.1
-typing_extensions==4.10.0
+typing_extensions==4.12.2
wrapt==1.16.0
zipp==3.19.2
-e opentelemetry-instrumentation
diff --git a/instrumentation/opentelemetry-instrumentation-pymemcache/test-requirements-3.txt b/instrumentation/opentelemetry-instrumentation-pymemcache/test-requirements-3.txt
index 916c9c9c3a..b0e2147639 100644
--- a/instrumentation/opentelemetry-instrumentation-pymemcache/test-requirements-3.txt
+++ b/instrumentation/opentelemetry-instrumentation-pymemcache/test-requirements-3.txt
@@ -9,7 +9,7 @@ pymemcache==3.4.2
pytest==7.4.4
six==1.16.0
tomli==2.0.1
-typing_extensions==4.10.0
+typing_extensions==4.12.2
wrapt==1.16.0
zipp==3.19.2
-e opentelemetry-instrumentation
diff --git a/instrumentation/opentelemetry-instrumentation-pymemcache/test-requirements-4.txt b/instrumentation/opentelemetry-instrumentation-pymemcache/test-requirements-4.txt
index e90a138ff8..36d0164961 100644
--- a/instrumentation/opentelemetry-instrumentation-pymemcache/test-requirements-4.txt
+++ b/instrumentation/opentelemetry-instrumentation-pymemcache/test-requirements-4.txt
@@ -8,7 +8,7 @@ py-cpuinfo==9.0.0
pymemcache==4.0.0
pytest==7.4.4
tomli==2.0.1
-typing_extensions==4.10.0
+typing_extensions==4.12.2
wrapt==1.16.0
zipp==3.19.2
-e opentelemetry-instrumentation
diff --git a/instrumentation/opentelemetry-instrumentation-pymongo/test-requirements.txt b/instrumentation/opentelemetry-instrumentation-pymongo/test-requirements.txt
index 6c8de553b6..a9319d5fdb 100644
--- a/instrumentation/opentelemetry-instrumentation-pymongo/test-requirements.txt
+++ b/instrumentation/opentelemetry-instrumentation-pymongo/test-requirements.txt
@@ -9,7 +9,7 @@ py-cpuinfo==9.0.0
pymongo==4.6.3
pytest==7.4.4
tomli==2.0.1
-typing_extensions==4.9.0
+typing_extensions==4.12.2
wrapt==1.16.0
zipp==3.19.2
-e opentelemetry-instrumentation
diff --git a/instrumentation/opentelemetry-instrumentation-pymysql/test-requirements.txt b/instrumentation/opentelemetry-instrumentation-pymysql/test-requirements.txt
index 7ad69f2b81..b1496da4e6 100644
--- a/instrumentation/opentelemetry-instrumentation-pymysql/test-requirements.txt
+++ b/instrumentation/opentelemetry-instrumentation-pymysql/test-requirements.txt
@@ -8,7 +8,7 @@ py-cpuinfo==9.0.0
PyMySQL==1.1.1
pytest==7.4.4
tomli==2.0.1
-typing_extensions==4.9.0
+typing_extensions==4.12.2
wrapt==1.16.0
zipp==3.19.2
-e opentelemetry-instrumentation
diff --git a/instrumentation/opentelemetry-instrumentation-pyramid/test-requirements.txt b/instrumentation/opentelemetry-instrumentation-pyramid/test-requirements.txt
index 6f33f33449..423838f23e 100644
--- a/instrumentation/opentelemetry-instrumentation-pyramid/test-requirements.txt
+++ b/instrumentation/opentelemetry-instrumentation-pyramid/test-requirements.txt
@@ -13,7 +13,7 @@ pyramid==2.0.2
pytest==7.4.4
tomli==2.0.1
translationstring==1.4
-typing_extensions==4.9.0
+typing_extensions==4.12.2
venusian==3.1.0
WebOb==1.8.8
Werkzeug==3.0.3
diff --git a/instrumentation/opentelemetry-instrumentation-redis/test-requirements.txt b/instrumentation/opentelemetry-instrumentation-redis/test-requirements.txt
index 7b8d8459b7..4690006ef1 100644
--- a/instrumentation/opentelemetry-instrumentation-redis/test-requirements.txt
+++ b/instrumentation/opentelemetry-instrumentation-redis/test-requirements.txt
@@ -10,7 +10,7 @@ py-cpuinfo==9.0.0
pytest==7.4.4
redis==5.0.1
tomli==2.0.1
-typing_extensions==4.9.0
+typing_extensions==4.12.2
wrapt==1.16.0
zipp==3.19.2
-e opentelemetry-instrumentation
diff --git a/instrumentation/opentelemetry-instrumentation-remoulade/test-requirements.txt b/instrumentation/opentelemetry-instrumentation-remoulade/test-requirements.txt
index b850e46f9f..a299e145a1 100644
--- a/instrumentation/opentelemetry-instrumentation-remoulade/test-requirements.txt
+++ b/instrumentation/opentelemetry-instrumentation-remoulade/test-requirements.txt
@@ -12,7 +12,7 @@ pytz==2024.1
remoulade==3.2.0
six==1.16.0
tomli==2.0.1
-typing_extensions==4.9.0
+typing_extensions==4.12.2
wrapt==1.16.0
zipp==3.19.2
-e opentelemetry-instrumentation
diff --git a/instrumentation/opentelemetry-instrumentation-requests/test-requirements.txt b/instrumentation/opentelemetry-instrumentation-requests/test-requirements.txt
index 9f40c6d5b2..a201206f0f 100644
--- a/instrumentation/opentelemetry-instrumentation-requests/test-requirements.txt
+++ b/instrumentation/opentelemetry-instrumentation-requests/test-requirements.txt
@@ -12,7 +12,7 @@ py-cpuinfo==9.0.0
pytest==7.4.4
requests==2.32.3
tomli==2.0.1
-typing_extensions==4.9.0
+typing_extensions==4.12.2
urllib3==2.2.2
wrapt==1.16.0
zipp==3.19.2
diff --git a/instrumentation/opentelemetry-instrumentation-sqlalchemy/test-requirements-0.txt b/instrumentation/opentelemetry-instrumentation-sqlalchemy/test-requirements-0.txt
index 45992bc2e1..cccdc3cb63 100644
--- a/instrumentation/opentelemetry-instrumentation-sqlalchemy/test-requirements-0.txt
+++ b/instrumentation/opentelemetry-instrumentation-sqlalchemy/test-requirements-0.txt
@@ -1,5 +1,5 @@
asgiref==3.8.1
-cffi==1.15.1
+cffi==1.17.0
Deprecated==1.2.14
importlib-metadata==6.11.0
iniconfig==2.0.0
@@ -9,7 +9,7 @@ py-cpuinfo==9.0.0
pytest==7.4.4
SQLAlchemy==1.1.18
tomli==2.0.1
-typing_extensions==4.10.0
+typing_extensions==4.12.2
wrapt==1.16.0
zipp==3.19.2
-e opentelemetry-instrumentation
diff --git a/instrumentation/opentelemetry-instrumentation-sqlalchemy/test-requirements-1.txt b/instrumentation/opentelemetry-instrumentation-sqlalchemy/test-requirements-1.txt
index eb1ee371b7..b275f4e30e 100644
--- a/instrumentation/opentelemetry-instrumentation-sqlalchemy/test-requirements-1.txt
+++ b/instrumentation/opentelemetry-instrumentation-sqlalchemy/test-requirements-1.txt
@@ -10,7 +10,7 @@ py-cpuinfo==9.0.0
pytest==7.4.4
SQLAlchemy==1.4.51
tomli==2.0.1
-typing_extensions==4.10.0
+typing_extensions==4.12.2
wrapt==1.16.0
zipp==3.19.2
-e opentelemetry-instrumentation
diff --git a/instrumentation/opentelemetry-instrumentation-sqlite3/test-requirements.txt b/instrumentation/opentelemetry-instrumentation-sqlite3/test-requirements.txt
index e260861814..2469d354d3 100644
--- a/instrumentation/opentelemetry-instrumentation-sqlite3/test-requirements.txt
+++ b/instrumentation/opentelemetry-instrumentation-sqlite3/test-requirements.txt
@@ -7,7 +7,7 @@ pluggy==1.5.0
py-cpuinfo==9.0.0
pytest==7.4.4
tomli==2.0.1
-typing_extensions==4.9.0
+typing_extensions==4.12.2
wrapt==1.16.0
zipp==3.19.2
-e opentelemetry-instrumentation
diff --git a/instrumentation/opentelemetry-instrumentation-starlette/test-requirements.txt b/instrumentation/opentelemetry-instrumentation-starlette/test-requirements.txt
index d81a15a40c..7f46b46981 100644
--- a/instrumentation/opentelemetry-instrumentation-starlette/test-requirements.txt
+++ b/instrumentation/opentelemetry-instrumentation-starlette/test-requirements.txt
@@ -18,7 +18,7 @@ requests==2.32.3
sniffio==1.3.0
starlette==0.13.8
tomli==2.0.1
-typing_extensions==4.9.0
+typing_extensions==4.12.2
urllib3==2.2.2
wrapt==1.16.0
zipp==3.19.2
diff --git a/instrumentation/opentelemetry-instrumentation-system-metrics/test-requirements.txt b/instrumentation/opentelemetry-instrumentation-system-metrics/test-requirements.txt
index 76f2f2a4e7..710e4bdf7f 100644
--- a/instrumentation/opentelemetry-instrumentation-system-metrics/test-requirements.txt
+++ b/instrumentation/opentelemetry-instrumentation-system-metrics/test-requirements.txt
@@ -8,7 +8,7 @@ psutil==6.0.0
py-cpuinfo==9.0.0
pytest==7.4.4
tomli==2.0.1
-typing_extensions==4.9.0
+typing_extensions==4.12.2
wrapt==1.16.0
zipp==3.19.2
-e opentelemetry-instrumentation
diff --git a/instrumentation/opentelemetry-instrumentation-threading/test-requirements.txt b/instrumentation/opentelemetry-instrumentation-threading/test-requirements.txt
index 2d13857e9e..84c3bb4d29 100644
--- a/instrumentation/opentelemetry-instrumentation-threading/test-requirements.txt
+++ b/instrumentation/opentelemetry-instrumentation-threading/test-requirements.txt
@@ -7,7 +7,7 @@ pluggy==1.5.0
py-cpuinfo==9.0.0
pytest==7.4.4
tomli==2.0.1
-typing_extensions==4.9.0
+typing_extensions==4.12.2
wrapt==1.16.0
zipp==3.19.2
-e opentelemetry-instrumentation
diff --git a/instrumentation/opentelemetry-instrumentation-tornado/test-requirements.txt b/instrumentation/opentelemetry-instrumentation-tornado/test-requirements.txt
index 236c45f87b..209c07e523 100644
--- a/instrumentation/opentelemetry-instrumentation-tornado/test-requirements.txt
+++ b/instrumentation/opentelemetry-instrumentation-tornado/test-requirements.txt
@@ -19,7 +19,7 @@ pytest==7.4.4
requests==2.32.3
tomli==2.0.1
tornado==6.4.1
-typing_extensions==4.9.0
+typing_extensions==4.12.2
urllib3==2.2.2
Werkzeug==3.0.3
wrapt==1.16.0
diff --git a/instrumentation/opentelemetry-instrumentation-tortoiseorm/test-requirements.txt b/instrumentation/opentelemetry-instrumentation-tortoiseorm/test-requirements.txt
index 31b044a2f3..4ec6d195bf 100644
--- a/instrumentation/opentelemetry-instrumentation-tortoiseorm/test-requirements.txt
+++ b/instrumentation/opentelemetry-instrumentation-tortoiseorm/test-requirements.txt
@@ -1,5 +1,5 @@
aiosqlite==0.17.0
-annotated-types==0.6.0
+annotated-types==0.7.0
asgiref==3.8.1
Deprecated==1.2.14
importlib-metadata==6.11.0
@@ -8,14 +8,14 @@ iso8601==1.1.0
packaging==24.0
pluggy==1.5.0
py-cpuinfo==9.0.0
-pydantic==2.6.2
-pydantic_core==2.16.3
+pydantic==2.8.2
+pydantic_core==2.20.1
pypika-tortoise==0.1.6
pytest==7.4.4
pytz==2024.1
tomli==2.0.1
tortoise-orm==0.20.0
-typing_extensions==4.9.0
+typing_extensions==4.12.2
wrapt==1.16.0
zipp==3.19.2
-e opentelemetry-instrumentation
diff --git a/instrumentation/opentelemetry-instrumentation-urllib/test-requirements.txt b/instrumentation/opentelemetry-instrumentation-urllib/test-requirements.txt
index 06bc8322dc..998ca77f6a 100644
--- a/instrumentation/opentelemetry-instrumentation-urllib/test-requirements.txt
+++ b/instrumentation/opentelemetry-instrumentation-urllib/test-requirements.txt
@@ -8,7 +8,7 @@ pluggy==1.5.0
py-cpuinfo==9.0.0
pytest==7.4.4
tomli==2.0.1
-typing_extensions==4.9.0
+typing_extensions==4.12.2
wrapt==1.16.0
zipp==3.19.2
-e opentelemetry-instrumentation
diff --git a/instrumentation/opentelemetry-instrumentation-urllib3/test-requirements-0.txt b/instrumentation/opentelemetry-instrumentation-urllib3/test-requirements-0.txt
index e7392b0c31..ad29eb1263 100644
--- a/instrumentation/opentelemetry-instrumentation-urllib3/test-requirements-0.txt
+++ b/instrumentation/opentelemetry-instrumentation-urllib3/test-requirements-0.txt
@@ -8,7 +8,7 @@ pluggy==1.5.0
py-cpuinfo==9.0.0
pytest==7.4.4
tomli==2.0.1
-typing_extensions==4.10.0
+typing_extensions==4.12.2
urllib3==1.26.19
wrapt==1.16.0
zipp==3.19.2
diff --git a/instrumentation/opentelemetry-instrumentation-urllib3/test-requirements-1.txt b/instrumentation/opentelemetry-instrumentation-urllib3/test-requirements-1.txt
index 21cb3acbe6..48406b222d 100644
--- a/instrumentation/opentelemetry-instrumentation-urllib3/test-requirements-1.txt
+++ b/instrumentation/opentelemetry-instrumentation-urllib3/test-requirements-1.txt
@@ -8,7 +8,7 @@ pluggy==1.5.0
py-cpuinfo==9.0.0
pytest==7.4.4
tomli==2.0.1
-typing_extensions==4.10.0
+typing_extensions==4.12.2
urllib3==2.2.2
wrapt==1.16.0
zipp==3.19.2
diff --git a/instrumentation/opentelemetry-instrumentation-wsgi/test-requirements.txt b/instrumentation/opentelemetry-instrumentation-wsgi/test-requirements.txt
index d63bd5a637..acabba1abf 100644
--- a/instrumentation/opentelemetry-instrumentation-wsgi/test-requirements.txt
+++ b/instrumentation/opentelemetry-instrumentation-wsgi/test-requirements.txt
@@ -7,7 +7,7 @@ pluggy==1.5.0
py-cpuinfo==9.0.0
pytest==7.4.4
tomli==2.0.1
-typing_extensions==4.9.0
+typing_extensions==4.12.2
wrapt==1.16.0
zipp==3.19.2
-e opentelemetry-instrumentation
diff --git a/opentelemetry-distro/test-requirements.txt b/opentelemetry-distro/test-requirements.txt
index 050054c39b..4f63e9e7b6 100644
--- a/opentelemetry-distro/test-requirements.txt
+++ b/opentelemetry-distro/test-requirements.txt
@@ -7,7 +7,7 @@ pluggy==1.5.0
py-cpuinfo==9.0.0
pytest==7.4.4
tomli==2.0.1
-typing_extensions==4.10.0
+typing_extensions==4.12.2
wrapt==1.16.0
zipp==3.19.2
-e opentelemetry-instrumentation
diff --git a/opentelemetry-instrumentation/test-requirements.txt b/opentelemetry-instrumentation/test-requirements.txt
index 31f1ef76ab..24a5a56daf 100644
--- a/opentelemetry-instrumentation/test-requirements.txt
+++ b/opentelemetry-instrumentation/test-requirements.txt
@@ -7,7 +7,7 @@ pluggy==1.5.0
py-cpuinfo==9.0.0
pytest==7.4.4
tomli==2.0.1
-typing_extensions==4.10.0
+typing_extensions==4.12.2
wrapt==1.16.0
zipp==3.19.2
-e opentelemetry-instrumentation
diff --git a/propagator/opentelemetry-propagator-aws-xray/test-requirements.txt b/propagator/opentelemetry-propagator-aws-xray/test-requirements.txt
index 4587d87629..8f5b428ba4 100644
--- a/propagator/opentelemetry-propagator-aws-xray/test-requirements.txt
+++ b/propagator/opentelemetry-propagator-aws-xray/test-requirements.txt
@@ -12,7 +12,7 @@ pytest==7.4.4
pytest-benchmark==4.0.0
requests==2.32.3
tomli==2.0.1
-typing_extensions==4.10.0
+typing_extensions==4.12.2
urllib3==2.2.2
wrapt==1.16.0
zipp==3.19.2
diff --git a/propagator/opentelemetry-propagator-ot-trace/test-requirements.txt b/propagator/opentelemetry-propagator-ot-trace/test-requirements.txt
index b556c4f0cc..4a97065065 100644
--- a/propagator/opentelemetry-propagator-ot-trace/test-requirements.txt
+++ b/propagator/opentelemetry-propagator-ot-trace/test-requirements.txt
@@ -7,7 +7,7 @@ pluggy==1.5.0
py-cpuinfo==9.0.0
pytest==7.4.4
tomli==2.0.1
-typing_extensions==4.10.0
+typing_extensions==4.12.2
wrapt==1.16.0
zipp==3.19.2
-e propagator/opentelemetry-propagator-ot-trace
diff --git a/resource/opentelemetry-resource-detector-azure/test-requirements.txt b/resource/opentelemetry-resource-detector-azure/test-requirements.txt
index 2b29359fbb..fe04c99490 100644
--- a/resource/opentelemetry-resource-detector-azure/test-requirements.txt
+++ b/resource/opentelemetry-resource-detector-azure/test-requirements.txt
@@ -6,7 +6,7 @@ packaging==24.0
pluggy==1.5.0
py-cpuinfo==9.0.0
pytest==7.4.4
-typing_extensions==4.10.0
+typing_extensions==4.12.2
wrapt==1.16.0
zipp==3.19.2
-e opentelemetry-instrumentation
diff --git a/resource/opentelemetry-resource-detector-container/test-requirements.txt b/resource/opentelemetry-resource-detector-container/test-requirements.txt
index f7b5b71fcf..7cf0d49001 100644
--- a/resource/opentelemetry-resource-detector-container/test-requirements.txt
+++ b/resource/opentelemetry-resource-detector-container/test-requirements.txt
@@ -7,7 +7,7 @@ pluggy==1.5.0
py-cpuinfo==9.0.0
pytest==7.4.4
tomli==2.0.1
-typing_extensions==4.10.0
+typing_extensions==4.12.2
wrapt==1.16.0
zipp==3.19.2
-e resource/opentelemetry-resource-detector-container
diff --git a/sdk-extension/opentelemetry-sdk-extension-aws/test-requirements.txt b/sdk-extension/opentelemetry-sdk-extension-aws/test-requirements.txt
index 1fa968a8b3..3b44b54a61 100644
--- a/sdk-extension/opentelemetry-sdk-extension-aws/test-requirements.txt
+++ b/sdk-extension/opentelemetry-sdk-extension-aws/test-requirements.txt
@@ -8,7 +8,7 @@ py-cpuinfo==9.0.0
pytest==7.4.4
pytest-benchmark==4.0.0
tomli==2.0.1
-typing_extensions==4.10.0
+typing_extensions==4.12.2
wrapt==1.16.0
zipp==3.19.2
-e sdk-extension/opentelemetry-sdk-extension-aws
diff --git a/tox.ini b/tox.ini
index 976e5968b0..e0a5a71131 100644
--- a/tox.ini
+++ b/tox.ini
@@ -1272,7 +1272,7 @@ deps =
SQLAlchemy==1.4.52
texttable==1.7.0
tomli==2.0.1
- typing_extensions==4.10.0
+ typing_extensions==4.12.2
tzdata==2024.1
urllib3==1.26.19
vine==5.1.0
diff --git a/util/opentelemetry-util-http/test-requirements.txt b/util/opentelemetry-util-http/test-requirements.txt
index 1769daa094..7c71ae2ef3 100644
--- a/util/opentelemetry-util-http/test-requirements.txt
+++ b/util/opentelemetry-util-http/test-requirements.txt
@@ -7,5 +7,5 @@ pluggy==1.5.0
py-cpuinfo==9.0.0
pytest==7.4.4
tomli==2.0.1
-typing_extensions==4.10.0
+typing_extensions==4.12.2
-e opentelemetry-instrumentation
From d52f42fb7f36c5448395f4cf842523ee9f3e01c9 Mon Sep 17 00:00:00 2001
From: Dmitriy
Date: Thu, 26 Sep 2024 18:00:31 +0500
Subject: [PATCH 33/33] feat(opentelemetry-instrumentation-aiokafka): wrap
getone instead of anext, add tests (#2874)
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
* add tests
* add to CHANGELOG
* add tests for baggage
* wrap getone instead of __anext__
* split sync and async tests (fix review)
* add dimastbk to component_owners.yml for aiokafka
* Update CHANGELOG.md
---------
Co-authored-by: EmÃdio Neto <9735060+emdneto@users.noreply.github.com>
Co-authored-by: Riccardo Magliocchetti
---
.github/component_owners.yml | 3 +
CHANGELOG.md | 6 +
.../instrumentation/aiokafka/__init__.py | 8 +-
.../instrumentation/aiokafka/utils.py | 2 +-
.../tests/test_instrumentation.py | 290 +++++++++++++++++-
.../tests/test_utils.py | 4 +-
tox.ini | 1 +
7 files changed, 302 insertions(+), 12 deletions(-)
diff --git a/.github/component_owners.yml b/.github/component_owners.yml
index e3ca06b450..dcc1013476 100644
--- a/.github/component_owners.yml
+++ b/.github/component_owners.yml
@@ -61,5 +61,8 @@ components:
instrumentation/opentelemetry-instrumentation-psycopg:
- federicobond
+ instrumentation/opentelemetry-instrumentation-aiokafka:
+ - dimastbk
+
processor/opentelemetry-processor-baggage:
- codeboten
diff --git a/CHANGELOG.md b/CHANGELOG.md
index a060517cdf..30440c2dce 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -14,6 +14,12 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
- `opentelemetry-instrumentation-aiokafka` Add instrumentor and auto instrumentation support for aiokafka
([#2082](https://github.com/open-telemetry/opentelemetry-python-contrib/pull/2082))
+
+### Fixed
+
+- `opentelemetry-instrumentation-aiokafka` Wrap `AIOKafkaConsumer.getone()` instead of `AIOKafkaConsumer.__anext__`
+ ([#2874](https://github.com/open-telemetry/opentelemetry-python-contrib/pull/2874))
+
## Version 1.27.0/0.48b0 ()
### Added
diff --git a/instrumentation/opentelemetry-instrumentation-aiokafka/src/opentelemetry/instrumentation/aiokafka/__init__.py b/instrumentation/opentelemetry-instrumentation-aiokafka/src/opentelemetry/instrumentation/aiokafka/__init__.py
index 5b2b0cd0e8..7d994be622 100644
--- a/instrumentation/opentelemetry-instrumentation-aiokafka/src/opentelemetry/instrumentation/aiokafka/__init__.py
+++ b/instrumentation/opentelemetry-instrumentation-aiokafka/src/opentelemetry/instrumentation/aiokafka/__init__.py
@@ -76,7 +76,7 @@ async def async_consume_hook(span, record, args, kwargs):
from opentelemetry import trace
from opentelemetry.instrumentation.aiokafka.package import _instruments
from opentelemetry.instrumentation.aiokafka.utils import (
- _wrap_anext,
+ _wrap_getone,
_wrap_send,
)
from opentelemetry.instrumentation.aiokafka.version import __version__
@@ -126,10 +126,10 @@ def _instrument(self, **kwargs):
)
wrap_function_wrapper(
aiokafka.AIOKafkaConsumer,
- "__anext__",
- _wrap_anext(tracer, async_consume_hook),
+ "getone",
+ _wrap_getone(tracer, async_consume_hook),
)
def _uninstrument(self, **kwargs):
unwrap(aiokafka.AIOKafkaProducer, "send")
- unwrap(aiokafka.AIOKafkaConsumer, "__anext__")
+ unwrap(aiokafka.AIOKafkaConsumer, "getone")
diff --git a/instrumentation/opentelemetry-instrumentation-aiokafka/src/opentelemetry/instrumentation/aiokafka/utils.py b/instrumentation/opentelemetry-instrumentation-aiokafka/src/opentelemetry/instrumentation/aiokafka/utils.py
index 3c54ce1500..cae0d97717 100644
--- a/instrumentation/opentelemetry-instrumentation-aiokafka/src/opentelemetry/instrumentation/aiokafka/utils.py
+++ b/instrumentation/opentelemetry-instrumentation-aiokafka/src/opentelemetry/instrumentation/aiokafka/utils.py
@@ -335,7 +335,7 @@ async def _create_consumer_span(
context.detach(token)
-def _wrap_anext(
+def _wrap_getone(
tracer: Tracer, async_consume_hook: ConsumeHookT
) -> Callable[..., Awaitable[aiokafka.ConsumerRecord]]:
async def _traced_next(
diff --git a/instrumentation/opentelemetry-instrumentation-aiokafka/tests/test_instrumentation.py b/instrumentation/opentelemetry-instrumentation-aiokafka/tests/test_instrumentation.py
index 1c4e5e3d10..8211566239 100644
--- a/instrumentation/opentelemetry-instrumentation-aiokafka/tests/test_instrumentation.py
+++ b/instrumentation/opentelemetry-instrumentation-aiokafka/tests/test_instrumentation.py
@@ -11,15 +11,29 @@
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
-from unittest import TestCase
-from aiokafka import AIOKafkaConsumer, AIOKafkaProducer
+import uuid
+from typing import Any, List, Sequence, Tuple
+from unittest import IsolatedAsyncioTestCase, TestCase, mock
+
+from aiokafka import (
+ AIOKafkaConsumer,
+ AIOKafkaProducer,
+ ConsumerRecord,
+ TopicPartition,
+)
from wrapt import BoundFunctionWrapper
+from opentelemetry import baggage, context
from opentelemetry.instrumentation.aiokafka import AIOKafkaInstrumentor
+from opentelemetry.sdk.trace import ReadableSpan
+from opentelemetry.semconv._incubating.attributes import messaging_attributes
+from opentelemetry.semconv.attributes import server_attributes
+from opentelemetry.test.test_base import TestBase
+from opentelemetry.trace import SpanKind, format_trace_id, set_span_in_context
-class TestAIOKafka(TestCase):
+class TestAIOKafkaInstrumentor(TestCase):
def test_instrument_api(self) -> None:
instrumentation = AIOKafkaInstrumentor()
@@ -28,7 +42,7 @@ def test_instrument_api(self) -> None:
isinstance(AIOKafkaProducer.send, BoundFunctionWrapper)
)
self.assertTrue(
- isinstance(AIOKafkaConsumer.__anext__, BoundFunctionWrapper)
+ isinstance(AIOKafkaConsumer.getone, BoundFunctionWrapper)
)
instrumentation.uninstrument()
@@ -36,5 +50,271 @@ def test_instrument_api(self) -> None:
isinstance(AIOKafkaProducer.send, BoundFunctionWrapper)
)
self.assertFalse(
- isinstance(AIOKafkaConsumer.__anext__, BoundFunctionWrapper)
+ isinstance(AIOKafkaConsumer.getone, BoundFunctionWrapper)
+ )
+
+
+class TestAIOKafkaInstrumentation(TestBase, IsolatedAsyncioTestCase):
+ @staticmethod
+ def consumer_record_factory(
+ number: int, headers: Tuple[Tuple[str, bytes], ...]
+ ) -> ConsumerRecord:
+ return ConsumerRecord(
+ f"topic_{number}",
+ number,
+ number,
+ number,
+ number,
+ f"key_{number}".encode(),
+ f"value_{number}".encode(),
+ None,
+ number,
+ number,
+ headers=headers,
+ )
+
+ @staticmethod
+ async def consumer_factory(**consumer_kwargs: Any) -> AIOKafkaConsumer:
+ consumer = AIOKafkaConsumer(**consumer_kwargs)
+
+ consumer._client.bootstrap = mock.AsyncMock()
+ consumer._client._wait_on_metadata = mock.AsyncMock()
+
+ await consumer.start()
+
+ consumer._fetcher.next_record = mock.AsyncMock()
+
+ return consumer
+
+ @staticmethod
+ async def producer_factory() -> AIOKafkaProducer:
+ producer = AIOKafkaProducer(api_version="1.0")
+
+ producer.client._wait_on_metadata = mock.AsyncMock()
+ producer.client.bootstrap = mock.AsyncMock()
+ producer._message_accumulator.add_message = mock.AsyncMock()
+ producer._sender.start = mock.AsyncMock()
+ producer._partition = mock.Mock(return_value=1)
+
+ await producer.start()
+
+ return producer
+
+ async def test_getone(self) -> None:
+ AIOKafkaInstrumentor().uninstrument()
+ AIOKafkaInstrumentor().instrument(tracer_provider=self.tracer_provider)
+
+ client_id = str(uuid.uuid4())
+ group_id = str(uuid.uuid4())
+ consumer = await self.consumer_factory(
+ client_id=client_id, group_id=group_id
+ )
+ next_record_mock: mock.AsyncMock = consumer._fetcher.next_record
+
+ expected_spans = [
+ {
+ "name": "topic_1 receive",
+ "kind": SpanKind.CONSUMER,
+ "attributes": {
+ messaging_attributes.MESSAGING_SYSTEM: messaging_attributes.MessagingSystemValues.KAFKA.value,
+ server_attributes.SERVER_ADDRESS: '"localhost"',
+ messaging_attributes.MESSAGING_CLIENT_ID: client_id,
+ messaging_attributes.MESSAGING_DESTINATION_NAME: "topic_1",
+ messaging_attributes.MESSAGING_DESTINATION_PARTITION_ID: "1",
+ messaging_attributes.MESSAGING_KAFKA_MESSAGE_KEY: "key_1",
+ messaging_attributes.MESSAGING_CONSUMER_GROUP_NAME: group_id,
+ messaging_attributes.MESSAGING_OPERATION_NAME: "receive",
+ messaging_attributes.MESSAGING_OPERATION_TYPE: messaging_attributes.MessagingOperationTypeValues.RECEIVE.value,
+ messaging_attributes.MESSAGING_KAFKA_MESSAGE_OFFSET: 1,
+ messaging_attributes.MESSAGING_MESSAGE_ID: "topic_1.1.1",
+ },
+ },
+ {
+ "name": "topic_2 receive",
+ "kind": SpanKind.CONSUMER,
+ "attributes": {
+ messaging_attributes.MESSAGING_SYSTEM: messaging_attributes.MessagingSystemValues.KAFKA.value,
+ server_attributes.SERVER_ADDRESS: '"localhost"',
+ messaging_attributes.MESSAGING_CLIENT_ID: client_id,
+ messaging_attributes.MESSAGING_DESTINATION_NAME: "topic_2",
+ messaging_attributes.MESSAGING_DESTINATION_PARTITION_ID: "2",
+ messaging_attributes.MESSAGING_KAFKA_MESSAGE_KEY: "key_2",
+ messaging_attributes.MESSAGING_CONSUMER_GROUP_NAME: group_id,
+ messaging_attributes.MESSAGING_OPERATION_NAME: "receive",
+ messaging_attributes.MESSAGING_OPERATION_TYPE: messaging_attributes.MessagingOperationTypeValues.RECEIVE.value,
+ messaging_attributes.MESSAGING_KAFKA_MESSAGE_OFFSET: 2,
+ messaging_attributes.MESSAGING_MESSAGE_ID: "topic_2.2.2",
+ },
+ },
+ ]
+ self.memory_exporter.clear()
+
+ next_record_mock.side_effect = [
+ self.consumer_record_factory(
+ 1,
+ headers=(
+ (
+ "traceparent",
+ b"00-03afa25236b8cd948fa853d67038ac79-405ff022e8247c46-01",
+ ),
+ ),
+ ),
+ self.consumer_record_factory(2, headers=()),
+ ]
+
+ await consumer.getone()
+ next_record_mock.assert_awaited_with(())
+
+ first_span = self.memory_exporter.get_finished_spans()[0]
+ self.assertEqual(
+ format_trace_id(first_span.get_span_context().trace_id),
+ "03afa25236b8cd948fa853d67038ac79",
+ )
+
+ await consumer.getone()
+ next_record_mock.assert_awaited_with(())
+
+ span_list = self.memory_exporter.get_finished_spans()
+ self._compare_spans(span_list, expected_spans)
+
+ async def test_getone_baggage(self) -> None:
+ received_baggage = None
+
+ async def async_consume_hook(span, *_) -> None:
+ nonlocal received_baggage
+ received_baggage = baggage.get_all(set_span_in_context(span))
+
+ AIOKafkaInstrumentor().uninstrument()
+ AIOKafkaInstrumentor().instrument(
+ tracer_provider=self.tracer_provider,
+ async_consume_hook=async_consume_hook,
+ )
+
+ consumer = await self.consumer_factory()
+ next_record_mock: mock.AsyncMock = consumer._fetcher.next_record
+
+ self.memory_exporter.clear()
+
+ next_record_mock.side_effect = [
+ self.consumer_record_factory(
+ 1,
+ headers=(
+ (
+ "traceparent",
+ b"00-03afa25236b8cd948fa853d67038ac79-405ff022e8247c46-01",
+ ),
+ ("baggage", b"foo=bar"),
+ ),
+ ),
+ ]
+
+ await consumer.getone()
+ next_record_mock.assert_awaited_with(())
+
+ self.assertEqual(received_baggage, {"foo": "bar"})
+
+ async def test_getone_consume_hook(self) -> None:
+ async_consume_hook_mock = mock.AsyncMock()
+
+ AIOKafkaInstrumentor().uninstrument()
+ AIOKafkaInstrumentor().instrument(
+ tracer_provider=self.tracer_provider,
+ async_consume_hook=async_consume_hook_mock,
+ )
+
+ consumer = await self.consumer_factory()
+ next_record_mock: mock.AsyncMock = consumer._fetcher.next_record
+
+ next_record_mock.side_effect = [
+ self.consumer_record_factory(1, headers=())
+ ]
+
+ await consumer.getone()
+
+ async_consume_hook_mock.assert_awaited_once()
+
+ async def test_send(self) -> None:
+ AIOKafkaInstrumentor().uninstrument()
+ AIOKafkaInstrumentor().instrument(tracer_provider=self.tracer_provider)
+
+ producer = await self.producer_factory()
+ add_message_mock: mock.AsyncMock = (
+ producer._message_accumulator.add_message
+ )
+
+ tracer = self.tracer_provider.get_tracer(__name__)
+ with tracer.start_as_current_span("test_span") as span:
+ await producer.send("topic_1", b"value_1")
+
+ add_message_mock.assert_awaited_with(
+ TopicPartition(topic="topic_1", partition=1),
+ None,
+ b"value_1",
+ 40.0,
+ timestamp_ms=None,
+ headers=[("traceparent", mock.ANY)],
)
+ add_message_mock.call_args_list[0].kwargs["headers"][0][1].startswith(
+ f"00-{format_trace_id(span.get_span_context().trace_id)}-".encode()
+ )
+
+ await producer.send("topic_2", b"value_2")
+ add_message_mock.assert_awaited_with(
+ TopicPartition(topic="topic_2", partition=1),
+ None,
+ b"value_2",
+ 40.0,
+ timestamp_ms=None,
+ headers=[("traceparent", mock.ANY)],
+ )
+
+ async def test_send_baggage(self) -> None:
+ AIOKafkaInstrumentor().uninstrument()
+ AIOKafkaInstrumentor().instrument(tracer_provider=self.tracer_provider)
+
+ producer = await self.producer_factory()
+ add_message_mock: mock.AsyncMock = (
+ producer._message_accumulator.add_message
+ )
+
+ tracer = self.tracer_provider.get_tracer(__name__)
+ ctx = baggage.set_baggage("foo", "bar")
+ context.attach(ctx)
+
+ with tracer.start_as_current_span("test_span", context=ctx):
+ await producer.send("topic_1", b"value_1")
+
+ add_message_mock.assert_awaited_with(
+ TopicPartition(topic="topic_1", partition=1),
+ None,
+ b"value_1",
+ 40.0,
+ timestamp_ms=None,
+ headers=[("traceparent", mock.ANY), ("baggage", b"foo=bar")],
+ )
+
+ async def test_send_produce_hook(self) -> None:
+ async_produce_hook_mock = mock.AsyncMock()
+
+ AIOKafkaInstrumentor().uninstrument()
+ AIOKafkaInstrumentor().instrument(
+ tracer_provider=self.tracer_provider,
+ async_produce_hook=async_produce_hook_mock,
+ )
+
+ producer = await self.producer_factory()
+
+ await producer.send("topic_1", b"value_1")
+
+ async_produce_hook_mock.assert_awaited_once()
+
+ def _compare_spans(
+ self, spans: Sequence[ReadableSpan], expected_spans: List[dict]
+ ) -> None:
+ self.assertEqual(len(spans), len(expected_spans))
+ for span, expected_span in zip(spans, expected_spans):
+ self.assertEqual(expected_span["name"], span.name)
+ self.assertEqual(expected_span["kind"], span.kind)
+ self.assertEqual(
+ expected_span["attributes"], dict(span.attributes)
+ )
diff --git a/instrumentation/opentelemetry-instrumentation-aiokafka/tests/test_utils.py b/instrumentation/opentelemetry-instrumentation-aiokafka/tests/test_utils.py
index b1b2792608..09a8655309 100644
--- a/instrumentation/opentelemetry-instrumentation-aiokafka/tests/test_utils.py
+++ b/instrumentation/opentelemetry-instrumentation-aiokafka/tests/test_utils.py
@@ -23,7 +23,7 @@
_create_consumer_span,
_extract_send_partition,
_get_span_name,
- _wrap_anext,
+ _wrap_getone,
_wrap_send,
)
from opentelemetry.trace import SpanKind
@@ -187,7 +187,7 @@ async def test_wrap_next(
original_next_callback = mock.AsyncMock()
kafka_consumer = mock.MagicMock()
- wrapped_next = _wrap_anext(tracer, consume_hook)
+ wrapped_next = _wrap_getone(tracer, consume_hook)
record = await wrapped_next(
original_next_callback, kafka_consumer, self.args, self.kwargs
)
diff --git a/tox.ini b/tox.ini
index e0a5a71131..2b0995d8fc 100644
--- a/tox.ini
+++ b/tox.ini
@@ -444,6 +444,7 @@ commands_pre =
aiokafka: pip install opentelemetry-api@{env:CORE_REPO}\#egg=opentelemetry-api&subdirectory=opentelemetry-api
aiokafka: pip install opentelemetry-semantic-conventions@{env:CORE_REPO}\#egg=opentelemetry-semantic-conventions&subdirectory=opentelemetry-semantic-conventions
aiokafka: pip install opentelemetry-sdk@{env:CORE_REPO}\#egg=opentelemetry-sdk&subdirectory=opentelemetry-sdk
+ aiokafka: pip install opentelemetry-test-utils@{env:CORE_REPO}\#egg=opentelemetry-test-utils&subdirectory=tests/opentelemetry-test-utils
aiokafka: pip install -r {toxinidir}/instrumentation/opentelemetry-instrumentation-aiokafka/test-requirements.txt
kafka-python: pip install opentelemetry-api@{env:CORE_REPO}\#egg=opentelemetry-api&subdirectory=opentelemetry-api