From bc804a3b07b7af45bbb352d553591d3a72845376 Mon Sep 17 00:00:00 2001 From: Allen Kim Date: Wed, 8 May 2024 08:40:21 +0900 Subject: [PATCH 01/56] Bugfix/check future cancelled (#2461) * Calling the exception() method when future is in the cancelled state is causing a CancelledError Calling the exception() method when future is in the cancelled state is causing a CancelledError. we should check the cancelled state first and call f.exception() only if it's not cancelled. * modify lint * modify lint * Update CHANGELOG.md * remove init() * add future cancelled test code * add future cancelled test code * add future cancelled test code * add future cancelled test code * add future cancelled test code * add future cancelled test code * lint * lint * remove if condition * modify test code * lint * lint * remove pytest --------- Co-authored-by: Diego Hurtado --- CHANGELOG.md | 2 + .../instrumentation/asyncio/__init__.py | 24 +++----- .../tests/test_asyncio_future_cancellation.py | 60 +++++++++++++++++++ 3 files changed, 71 insertions(+), 15 deletions(-) create mode 100644 instrumentation/opentelemetry-instrumentation-asyncio/tests/test_asyncio_future_cancellation.py diff --git a/CHANGELOG.md b/CHANGELOG.md index dff32bafca..28e8a85c26 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -47,6 +47,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ([#2418](https://github.com/open-telemetry/opentelemetry-python-contrib/pull/2418)) - Use sqlalchemy version in sqlalchemy commenter instead of opentelemetry library version ([#2404](https://github.com/open-telemetry/opentelemetry-python-contrib/pull/2404)) +- `opentelemetry-instrumentation-asyncio` Check for cancelledException in the future + ([#2461](https://github.com/open-telemetry/opentelemetry-python-contrib/pull/2461)) - Remove SDK dependency from opentelemetry-instrumentation-grpc ([#2474](https://github.com/open-telemetry/opentelemetry-python-contrib/pull/2474)) 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 68e3d0839f..72aa5fd2aa 100644 --- a/instrumentation/opentelemetry-instrumentation-asyncio/src/opentelemetry/instrumentation/asyncio/__init__.py +++ b/instrumentation/opentelemetry-instrumentation-asyncio/src/opentelemetry/instrumentation/asyncio/__init__.py @@ -116,21 +116,11 @@ class AsyncioInstrumentor(BaseInstrumentor): "run_coroutine_threadsafe", ] - def __init__(self): - super().__init__() - self.process_duration_histogram = None - self.process_created_counter = None - - self._tracer = None - self._meter = None - self._coros_name_to_trace: set = set() - self._to_thread_name_to_trace: set = set() - self._future_active_enabled: bool = False - def instrumentation_dependencies(self) -> Collection[str]: return _instruments def _instrument(self, **kwargs): + # pylint: disable=attribute-defined-outside-init self._tracer = get_tracer( __name__, __version__, kwargs.get("tracer_provider") ) @@ -307,13 +297,17 @@ def trace_future(self, future): ) def callback(f): - exception = f.exception() attr = { "type": "future", + "state": ( + "cancelled" + if f.cancelled() + else determine_state(f.exception()) + ), } - state = determine_state(exception) - attr["state"] = state - self.record_process(start, attr, span, exception) + self.record_process( + start, attr, span, None if f.cancelled() else f.exception() + ) future.add_done_callback(callback) return future diff --git a/instrumentation/opentelemetry-instrumentation-asyncio/tests/test_asyncio_future_cancellation.py b/instrumentation/opentelemetry-instrumentation-asyncio/tests/test_asyncio_future_cancellation.py new file mode 100644 index 0000000000..f8f4e5f230 --- /dev/null +++ b/instrumentation/opentelemetry-instrumentation-asyncio/tests/test_asyncio_future_cancellation.py @@ -0,0 +1,60 @@ +import asyncio +from unittest.mock import patch + +from opentelemetry.instrumentation.asyncio import AsyncioInstrumentor +from opentelemetry.instrumentation.asyncio.environment_variables import ( + OTEL_PYTHON_ASYNCIO_FUTURE_TRACE_ENABLED, +) +from opentelemetry.test.test_base import TestBase +from opentelemetry.trace import get_tracer + + +class TestTraceFuture(TestBase): + @patch.dict( + "os.environ", {OTEL_PYTHON_ASYNCIO_FUTURE_TRACE_ENABLED: "true"} + ) + def setUp(self): + super().setUp() + self._tracer = get_tracer( + __name__, + ) + self.instrumentor = AsyncioInstrumentor() + self.instrumentor.instrument() + + def tearDown(self): + super().tearDown() + self.instrumentor.uninstrument() + + def test_trace_future_cancelled(self): + async def future_cancelled(): + with self._tracer.start_as_current_span("root"): + future = asyncio.Future() + future = self.instrumentor.trace_future(future) + future.cancel() + + try: + asyncio.run(future_cancelled()) + except asyncio.CancelledError as exc: + self.assertEqual(isinstance(exc, asyncio.CancelledError), True) + spans = self.memory_exporter.get_finished_spans() + self.assertEqual(len(spans), 2) + self.assertEqual(spans[0].name, "root") + self.assertEqual(spans[1].name, "asyncio future") + + metrics = ( + self.memory_metrics_reader.get_metrics_data() + .resource_metrics[0] + .scope_metrics[0] + .metrics + ) + self.assertEqual(len(metrics), 2) + + self.assertEqual(metrics[0].name, "asyncio.process.duration") + self.assertEqual( + metrics[0].data.data_points[0].attributes["state"], "cancelled" + ) + + self.assertEqual(metrics[1].name, "asyncio.process.created") + self.assertEqual( + metrics[1].data.data_points[0].attributes["state"], "cancelled" + ) From 935f51eb8eaa54fc7d2c7dd6718906fe782cf223 Mon Sep 17 00:00:00 2001 From: hyfj44255 Date: Thu, 9 May 2024 23:14:08 +0800 Subject: [PATCH 02/56] upgrade pymongo to avoid CWE-125 vulnerability issue (#2497) Signed-off-by: Yang, Robin --- .../opentelemetry-instrumentation-pymongo/test-requirements.txt | 2 +- tox.ini | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/instrumentation/opentelemetry-instrumentation-pymongo/test-requirements.txt b/instrumentation/opentelemetry-instrumentation-pymongo/test-requirements.txt index 01d48e8dc4..0ad6375a14 100644 --- a/instrumentation/opentelemetry-instrumentation-pymongo/test-requirements.txt +++ b/instrumentation/opentelemetry-instrumentation-pymongo/test-requirements.txt @@ -8,7 +8,7 @@ packaging==23.2 pluggy==1.4.0 py==1.11.0 py-cpuinfo==9.0.0 -pymongo==4.6.2 +pymongo==4.6.3 pytest==7.1.3 pytest-benchmark==4.0.0 tomli==2.0.1 diff --git a/tox.ini b/tox.ini index ed74e485cd..37a1727935 100644 --- a/tox.ini +++ b/tox.ini @@ -1250,7 +1250,7 @@ deps = psycopg2==2.9.9 psycopg2-binary==2.9.9 pycparser==2.21 - pymongo==4.6.2 + pymongo==4.6.3 PyMySQL==0.10.1 PyNaCl==1.5.0 # prerequisite: install unixodbc From eabceff062372d3dd17d2dc790d34919f0c94b5f Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Thu, 9 May 2024 13:53:12 -0500 Subject: [PATCH 03/56] Bump jinja2 from 3.1.3 to 3.1.4 (#2503) Bumps [jinja2](https://github.com/pallets/jinja) from 3.1.3 to 3.1.4. - [Release notes](https://github.com/pallets/jinja/releases) - [Changelog](https://github.com/pallets/jinja/blob/main/CHANGES.rst) - [Commits](https://github.com/pallets/jinja/compare/3.1.3...3.1.4) --- updated-dependencies: - dependency-name: jinja2 dependency-type: direct:production ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: Diego Hurtado --- gen-requirements.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gen-requirements.txt b/gen-requirements.txt index de84b72c1e..b2d5c4f695 100644 --- a/gen-requirements.txt +++ b/gen-requirements.txt @@ -1,6 +1,6 @@ -c dev-requirements.txt astor==0.8.1 -jinja2==3.1.3 +jinja2==3.1.4 markupsafe==2.0.1 isort black From 46d2ce6acea9a1a6cb1a4d4c863077002f5f7d21 Mon Sep 17 00:00:00 2001 From: Riccardo Magliocchetti Date: Fri, 10 May 2024 18:51:32 +0200 Subject: [PATCH 04/56] Reinstate tox -e lint (#2482) --- CONTRIBUTING.md | 4 ++-- tox.ini | 11 +++++++++++ 2 files changed, 13 insertions(+), 2 deletions(-) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 3de25a4e67..743449c2a7 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -67,8 +67,8 @@ You can run `tox` with the following arguments: `black` and `isort` are executed when `tox -e lint` is run. The reported errors can be tedious to fix manually. An easier way to do so is: -1. Run `.tox/lint-some-package/bin/black .` -2. Run `.tox/lint-some-package/bin/isort .` +1. Run `.tox/lint/bin/black .` +2. Run `.tox/lint/bin/isort .` Or you can call formatting and linting in one command by [pre-commit](https://pre-commit.com/): diff --git a/tox.ini b/tox.ini index 37a1727935..ae11e0f24f 100644 --- a/tox.ini +++ b/tox.ini @@ -1189,6 +1189,17 @@ changedir = docs commands = sphinx-build -E -a -W -b html -T . _build/html +[testenv:lint] +basepython: python3 +recreate = True +deps = + -r dev-requirements.txt + +commands = + black --config {toxinidir}/pyproject.toml {{toxinidir}} --diff --check + isort --settings-path {toxinidir}/.isort.cfg {{toxinidir}} --diff --check-only + flake8 --config {toxinidir}/.flake8 {toxinidir} + [testenv:spellcheck] basepython: python3 recreate = True From 9b7197d3b989dac0a7965b6c55b2ee902b3f5b45 Mon Sep 17 00:00:00 2001 From: Federico Bond Date: Tue, 14 May 2024 03:24:24 +1000 Subject: [PATCH 05/56] docs: fix name of response hook signature in botocore instrumentation (#2512) --- .../src/opentelemetry/instrumentation/botocore/__init__.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/instrumentation/opentelemetry-instrumentation-botocore/src/opentelemetry/instrumentation/botocore/__init__.py b/instrumentation/opentelemetry-instrumentation-botocore/src/opentelemetry/instrumentation/botocore/__init__.py index 36b973e318..0481b248aa 100644 --- a/instrumentation/opentelemetry-instrumentation-botocore/src/opentelemetry/instrumentation/botocore/__init__.py +++ b/instrumentation/opentelemetry-instrumentation-botocore/src/opentelemetry/instrumentation/botocore/__init__.py @@ -51,7 +51,7 @@ request_hook (Callable) - a function with extra user-defined logic to be performed before performing the request this function signature is: def request_hook(span: Span, service_name: str, operation_name: str, api_params: dict) -> None response_hook (Callable) - a function with extra user-defined logic to be performed after performing the request -this function signature is: def request_hook(span: Span, service_name: str, operation_name: str, result: dict) -> None +this function signature is: def response_hook(span: Span, service_name: str, operation_name: str, result: dict) -> None for example: From 6a40ffd90512e3e4636bddb20728f8f680b69f8a Mon Sep 17 00:00:00 2001 From: Riccardo Magliocchetti Date: Tue, 14 May 2024 21:59:41 +0200 Subject: [PATCH 06/56] elasticsearch: tests against elasticsearch 8 (#2420) * elasticsearch: bump handled version to 6.0 After 4de0e5659d451baee65af412242b95f174444d87 * elasticsearch: tests against elasticsearch 8 --- CHANGELOG.md | 2 + instrumentation/README.md | 2 +- .../instrumentation/elasticsearch/__init__.py | 61 ++++++++-- .../instrumentation/elasticsearch/package.py | 2 +- .../test-requirements-2.txt | 23 ++++ .../tests/helpers_es6.py | 6 + .../tests/helpers_es7.py | 6 + .../tests/helpers_es8.py | 21 +++- .../tests/test_elasticsearch.py | 112 ++++++++++++------ tox.ini | 8 +- 10 files changed, 191 insertions(+), 52 deletions(-) create mode 100644 instrumentation/opentelemetry-instrumentation-elasticsearch/test-requirements-2.txt diff --git a/CHANGELOG.md b/CHANGELOG.md index 28e8a85c26..d10983c10b 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -51,6 +51,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ([#2461](https://github.com/open-telemetry/opentelemetry-python-contrib/pull/2461)) - Remove SDK dependency from opentelemetry-instrumentation-grpc ([#2474](https://github.com/open-telemetry/opentelemetry-python-contrib/pull/2474)) +- `opentelemetry-instrumentation-elasticsearch` Improved support for version 8 + ([#2420](https://github.com/open-telemetry/opentelemetry-python-contrib/pull/2420)) ## Version 1.24.0/0.45b0 (2024-03-28) diff --git a/instrumentation/README.md b/instrumentation/README.md index c73d0f7c0a..5dfed03e9a 100644 --- a/instrumentation/README.md +++ b/instrumentation/README.md @@ -17,7 +17,7 @@ | [opentelemetry-instrumentation-confluent-kafka](./opentelemetry-instrumentation-confluent-kafka) | confluent-kafka >= 1.8.2, <= 2.3.0 | No | experimental | [opentelemetry-instrumentation-dbapi](./opentelemetry-instrumentation-dbapi) | dbapi | No | experimental | [opentelemetry-instrumentation-django](./opentelemetry-instrumentation-django) | django >= 1.10 | Yes | experimental -| [opentelemetry-instrumentation-elasticsearch](./opentelemetry-instrumentation-elasticsearch) | elasticsearch >= 2.0 | No | experimental +| [opentelemetry-instrumentation-elasticsearch](./opentelemetry-instrumentation-elasticsearch) | elasticsearch >= 6.0 | No | experimental | [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 | experimental | [opentelemetry-instrumentation-flask](./opentelemetry-instrumentation-flask) | flask >= 1.0 | Yes | migration diff --git a/instrumentation/opentelemetry-instrumentation-elasticsearch/src/opentelemetry/instrumentation/elasticsearch/__init__.py b/instrumentation/opentelemetry-instrumentation-elasticsearch/src/opentelemetry/instrumentation/elasticsearch/__init__.py index ceb50cac56..acf4596fb0 100644 --- a/instrumentation/opentelemetry-instrumentation-elasticsearch/src/opentelemetry/instrumentation/elasticsearch/__init__.py +++ b/instrumentation/opentelemetry-instrumentation-elasticsearch/src/opentelemetry/instrumentation/elasticsearch/__init__.py @@ -94,7 +94,7 @@ def response_hook(span, response): from opentelemetry.instrumentation.instrumentor import BaseInstrumentor from opentelemetry.instrumentation.utils import unwrap from opentelemetry.semconv.trace import SpanAttributes -from opentelemetry.trace import SpanKind, get_tracer +from opentelemetry.trace import SpanKind, Status, StatusCode, get_tracer from .utils import sanitize_body @@ -103,6 +103,7 @@ def response_hook(span, response): es_transport_split = elasticsearch.VERSION[0] > 7 if es_transport_split: import elastic_transport + from elastic_transport._models import DefaultType logger = getLogger(__name__) @@ -173,7 +174,12 @@ def _instrument(self, **kwargs): def _uninstrument(self, **kwargs): # pylint: disable=no-member - unwrap(elasticsearch.Transport, "perform_request") + transport_class = ( + elastic_transport.Transport + if es_transport_split + else elasticsearch.Transport + ) + unwrap(transport_class, "perform_request") _regex_doc_url = re.compile(r"/_doc/([^/]+)") @@ -182,6 +188,7 @@ def _uninstrument(self, **kwargs): _regex_search_url = re.compile(r"/([^/]+)/_search[/]?") +# pylint: disable=too-many-statements def _wrap_perform_request( tracer, span_name_prefix, @@ -234,7 +241,22 @@ def wrapper(wrapped, _, args, kwargs): kind=SpanKind.CLIENT, ) as span: if callable(request_hook): - request_hook(span, method, url, kwargs) + # elasticsearch 8 changed the parameters quite a bit + if es_transport_split: + + def normalize_kwargs(k, v): + if isinstance(v, DefaultType): + v = str(v) + elif isinstance(v, elastic_transport.HttpHeaders): + v = dict(v) + return (k, v) + + hook_kwargs = dict( + normalize_kwargs(k, v) for k, v in kwargs.items() + ) + else: + hook_kwargs = kwargs + request_hook(span, method, url, hook_kwargs) if span.is_recording(): attributes = { @@ -260,16 +282,41 @@ def wrapper(wrapped, _, args, kwargs): span.set_attribute(key, value) rv = wrapped(*args, **kwargs) - if isinstance(rv, dict) and span.is_recording(): + + body = rv.body if es_transport_split else rv + if isinstance(body, dict) and span.is_recording(): for member in _ATTRIBUTES_FROM_RESULT: - if member in rv: + if member in body: span.set_attribute( f"elasticsearch.{member}", - str(rv[member]), + str(body[member]), + ) + + # since the transport split the raising of exceptions that set the error status + # are called after this code so need to set error status manually + if es_transport_split and span.is_recording(): + if not (method == "HEAD" and rv.meta.status == 404) and ( + not 200 <= rv.meta.status < 299 + ): + exception = elasticsearch.exceptions.HTTP_EXCEPTIONS.get( + rv.meta.status, elasticsearch.exceptions.ApiError + ) + message = str(body) + if isinstance(body, dict): + error = body.get("error", message) + if isinstance(error, dict) and "type" in error: + error = error["type"] + message = error + + span.set_status( + Status( + status_code=StatusCode.ERROR, + description=f"{exception.__name__}: {message}", ) + ) if callable(response_hook): - response_hook(span, rv) + response_hook(span, body) return rv return wrapper diff --git a/instrumentation/opentelemetry-instrumentation-elasticsearch/src/opentelemetry/instrumentation/elasticsearch/package.py b/instrumentation/opentelemetry-instrumentation-elasticsearch/src/opentelemetry/instrumentation/elasticsearch/package.py index 5b0fb7e6ea..bae644a70b 100644 --- a/instrumentation/opentelemetry-instrumentation-elasticsearch/src/opentelemetry/instrumentation/elasticsearch/package.py +++ b/instrumentation/opentelemetry-instrumentation-elasticsearch/src/opentelemetry/instrumentation/elasticsearch/package.py @@ -13,4 +13,4 @@ # limitations under the License. -_instruments = ("elasticsearch >= 2.0",) +_instruments = ("elasticsearch >= 6.0",) diff --git a/instrumentation/opentelemetry-instrumentation-elasticsearch/test-requirements-2.txt b/instrumentation/opentelemetry-instrumentation-elasticsearch/test-requirements-2.txt new file mode 100644 index 0000000000..23d87f93dd --- /dev/null +++ b/instrumentation/opentelemetry-instrumentation-elasticsearch/test-requirements-2.txt @@ -0,0 +1,23 @@ +asgiref==3.7.2 +attrs==23.2.0 +Deprecated==1.2.14 +elasticsearch==8.12.1 +elasticsearch-dsl==8.12.0 +elastic-transport==8.12.0 +importlib-metadata==6.11.0 +iniconfig==2.0.0 +packaging==23.2 +pluggy==1.4.0 +py==1.11.0 +py-cpuinfo==9.0.0 +pytest==7.1.3 +pytest-benchmark==4.0.0 +python-dateutil==2.8.2 +six==1.16.0 +tomli==2.0.1 +typing_extensions==4.10.0 +urllib3==2.2.1 +wrapt==1.16.0 +zipp==3.17.0 +-e opentelemetry-instrumentation +-e instrumentation/opentelemetry-instrumentation-elasticsearch diff --git a/instrumentation/opentelemetry-instrumentation-elasticsearch/tests/helpers_es6.py b/instrumentation/opentelemetry-instrumentation-elasticsearch/tests/helpers_es6.py index b27d291ba3..8169eb25c4 100644 --- a/instrumentation/opentelemetry-instrumentation-elasticsearch/tests/helpers_es6.py +++ b/instrumentation/opentelemetry-instrumentation-elasticsearch/tests/helpers_es6.py @@ -31,3 +31,9 @@ class Index: dsl_index_span_name = "Elasticsearch/test-index/doc/2" dsl_index_url = "/test-index/doc/2" dsl_search_method = "GET" + +perform_request_mock_path = "elasticsearch.connection.http_urllib3.Urllib3HttpConnection.perform_request" + + +def mock_response(body: str, status_code: int = 200): + return (status_code, {}, body) diff --git a/instrumentation/opentelemetry-instrumentation-elasticsearch/tests/helpers_es7.py b/instrumentation/opentelemetry-instrumentation-elasticsearch/tests/helpers_es7.py index b22df18452..377173f7ac 100644 --- a/instrumentation/opentelemetry-instrumentation-elasticsearch/tests/helpers_es7.py +++ b/instrumentation/opentelemetry-instrumentation-elasticsearch/tests/helpers_es7.py @@ -29,3 +29,9 @@ class Index: dsl_index_span_name = "Elasticsearch/test-index/_doc/:id" dsl_index_url = "/test-index/_doc/2" dsl_search_method = "POST" + +perform_request_mock_path = "elasticsearch.connection.http_urllib3.Urllib3HttpConnection.perform_request" + + +def mock_response(body: str, status_code: int = 200): + return (status_code, {}, body) diff --git a/instrumentation/opentelemetry-instrumentation-elasticsearch/tests/helpers_es8.py b/instrumentation/opentelemetry-instrumentation-elasticsearch/tests/helpers_es8.py index 04ed2efda2..a450be68ec 100644 --- a/instrumentation/opentelemetry-instrumentation-elasticsearch/tests/helpers_es8.py +++ b/instrumentation/opentelemetry-instrumentation-elasticsearch/tests/helpers_es8.py @@ -12,6 +12,8 @@ # See the License for the specific language governing permissions and # limitations under the License. +from elastic_transport import ApiResponseMeta, HttpHeaders +from elastic_transport._node import NodeApiResponse from elasticsearch_dsl import Document, Keyword, Text @@ -36,6 +38,23 @@ class Index: } } dsl_index_result = (1, {}, '{"result": "created"}') -dsl_index_span_name = "Elasticsearch/test-index/_doc/2" +dsl_index_span_name = "Elasticsearch/test-index/_doc/:id" dsl_index_url = "/test-index/_doc/2" dsl_search_method = "POST" + +perform_request_mock_path = ( + "elastic_transport._node._http_urllib3.Urllib3HttpNode.perform_request" +) + + +def mock_response(body: str, status_code: int = 200): + return NodeApiResponse( + ApiResponseMeta( + status=status_code, + headers=HttpHeaders({}), + duration=100, + http_version="1.1", + node="node", + ), + body.encode(), + ) diff --git a/instrumentation/opentelemetry-instrumentation-elasticsearch/tests/test_elasticsearch.py b/instrumentation/opentelemetry-instrumentation-elasticsearch/tests/test_elasticsearch.py index 690cbe3d4c..b0ee170329 100644 --- a/instrumentation/opentelemetry-instrumentation-elasticsearch/tests/test_elasticsearch.py +++ b/instrumentation/opentelemetry-instrumentation-elasticsearch/tests/test_elasticsearch.py @@ -51,25 +51,25 @@ def normalize_arguments(doc_type, body=None): - if major_version == 7: - return {"document": body} if body else {} - return ( - {"body": body, "doc_type": doc_type} - if body - else {"doc_type": doc_type} - ) + if major_version < 7: + return ( + {"body": body, "doc_type": doc_type} + if body + else {"doc_type": doc_type} + ) + return {"document": body} if body else {} def get_elasticsearch_client(*args, **kwargs): client = Elasticsearch(*args, **kwargs) - if major_version == 7: + if major_version == 8: + client._verified_elasticsearch = True + elif major_version == 7: client.transport._verified_elasticsearch = True return client -@mock.patch( - "elasticsearch.connection.http_urllib3.Urllib3HttpConnection.perform_request" -) +@mock.patch(helpers.perform_request_mock_path) class TestElasticsearchIntegration(TestBase): search_attributes = { SpanAttributes.DB_SYSTEM: "elasticsearch", @@ -96,7 +96,7 @@ def tearDown(self): ElasticsearchInstrumentor().uninstrument() def test_instrumentor(self, request_mock): - request_mock.return_value = (1, {}, "{}") + request_mock.return_value = helpers.mock_response("{}") es = get_elasticsearch_client(hosts=["http://localhost:9200"]) es.index( @@ -147,7 +147,7 @@ def test_prefix_arg(self, request_mock): prefix = "prefix-from-env" ElasticsearchInstrumentor().uninstrument() ElasticsearchInstrumentor(span_name_prefix=prefix).instrument() - request_mock.return_value = (1, {}, "{}") + request_mock.return_value = helpers.mock_response("{}") self._test_prefix(prefix) def test_prefix_env(self, request_mock): @@ -156,7 +156,7 @@ def test_prefix_env(self, request_mock): os.environ[env_var] = prefix ElasticsearchInstrumentor().uninstrument() ElasticsearchInstrumentor().instrument() - request_mock.return_value = (1, {}, "{}") + request_mock.return_value = helpers.mock_response("{}") del os.environ[env_var] self._test_prefix(prefix) @@ -174,10 +174,8 @@ def _test_prefix(self, prefix): self.assertTrue(span.name.startswith(prefix)) def test_result_values(self, request_mock): - request_mock.return_value = ( - 1, - {}, - '{"found": false, "timed_out": true, "took": 7}', + request_mock.return_value = helpers.mock_response( + '{"found": false, "timed_out": true, "took": 7}' ) es = get_elasticsearch_client(hosts=["http://localhost:9200"]) es.get( @@ -201,9 +199,18 @@ def test_trace_error_unknown(self, request_mock): def test_trace_error_not_found(self, request_mock): msg = "record not found" - exc = elasticsearch.exceptions.NotFoundError(404, msg) - request_mock.return_value = (1, {}, "{}") - request_mock.side_effect = exc + if major_version == 8: + error = {"error": msg} + response = helpers.mock_response( + json.dumps(error), status_code=404 + ) + request_mock.return_value = response + exc = elasticsearch.exceptions.NotFoundError( + msg, meta=response.meta, body=None + ) + else: + exc = elasticsearch.exceptions.NotFoundError(404, msg) + request_mock.side_effect = exc self._test_trace_error(StatusCode.ERROR, exc) def _test_trace_error(self, code, exc): @@ -222,12 +229,13 @@ def _test_trace_error(self, code, exc): span = spans[0] self.assertFalse(span.status.is_ok) self.assertEqual(span.status.status_code, code) + message = getattr(exc, "message", str(exc)) self.assertEqual( - span.status.description, f"{type(exc).__name__}: {exc}" + span.status.description, f"{type(exc).__name__}: {message}" ) def test_parent(self, request_mock): - request_mock.return_value = (1, {}, "{}") + request_mock.return_value = helpers.mock_response("{}") es = get_elasticsearch_client(hosts=["http://localhost:9200"]) with self.tracer.start_as_current_span("parent"): es.index( @@ -245,7 +253,7 @@ def test_parent(self, request_mock): self.assertEqual(child.parent.span_id, parent.context.span_id) def test_multithread(self, request_mock): - request_mock.return_value = (1, {}, "{}") + request_mock.return_value = helpers.mock_response("{}") es = get_elasticsearch_client(hosts=["http://localhost:9200"]) ev = threading.Event() @@ -292,7 +300,9 @@ def target2(): self.assertIsNone(s3.parent) def test_dsl_search(self, request_mock): - request_mock.return_value = (1, {}, '{"hits": {"hits": []}}') + request_mock.return_value = helpers.mock_response( + '{"hits": {"hits": []}}' + ) client = get_elasticsearch_client(hosts=["http://localhost:9200"]) search = Search(using=client, index="test-index").filter( @@ -310,7 +320,9 @@ def test_dsl_search(self, request_mock): ) def test_dsl_search_sanitized(self, request_mock): - request_mock.return_value = (1, {}, '{"hits": {"hits": []}}') + request_mock.return_value = helpers.mock_response( + '{"hits": {"hits": []}}' + ) client = get_elasticsearch_client(hosts=["http://localhost:9200"]) search = Search(using=client, index="test-index").filter( "term", author="testing" @@ -327,7 +339,10 @@ def test_dsl_search_sanitized(self, request_mock): ) def test_dsl_create(self, request_mock): - request_mock.return_value = (1, {}, "{}") + request_mock.side_effect = [ + helpers.mock_response("{}", status_code=404), + helpers.mock_response("{}"), + ] client = get_elasticsearch_client(hosts=["http://localhost:9200"]) Article.init(using=client) @@ -354,7 +369,10 @@ def test_dsl_create(self, request_mock): ) def test_dsl_create_sanitized(self, request_mock): - request_mock.return_value = (1, {}, "{}") + request_mock.side_effect = [ + helpers.mock_response("{}", status_code=404), + helpers.mock_response("{}"), + ] client = get_elasticsearch_client(hosts=["http://localhost:9200"]) Article.init(using=client) @@ -370,7 +388,9 @@ def test_dsl_create_sanitized(self, request_mock): ) def test_dsl_index(self, request_mock): - request_mock.return_value = (1, {}, helpers.dsl_index_result[2]) + request_mock.return_value = helpers.mock_response( + helpers.dsl_index_result[2] + ) client = get_elasticsearch_client(hosts=["http://localhost:9200"]) article = Article( @@ -416,10 +436,8 @@ def request_hook(span, method, url, kwargs): ElasticsearchInstrumentor().uninstrument() ElasticsearchInstrumentor().instrument(request_hook=request_hook) - request_mock.return_value = ( - 1, - {}, - '{"found": false, "timed_out": true, "took": 7}', + request_mock.return_value = helpers.mock_response( + '{"found": false, "timed_out": true, "took": 7}' ) es = get_elasticsearch_client(hosts=["http://localhost:9200"]) index = "test-index" @@ -439,12 +457,26 @@ def request_hook(span, method, url, kwargs): "GET", spans[0].attributes[request_hook_method_attribute] ) expected_url = f"/{index}/_doc/{doc_id}" + if major_version == 8: + expected_url += "?realtime=true&refresh=true" self.assertEqual( expected_url, spans[0].attributes[request_hook_url_attribute], ) - if major_version == 7: + if major_version == 8: + expected_kwargs = { + "body": None, + "request_timeout": "", + "max_retries": "", + "retry_on_status": "", + "retry_on_timeout": "", + "client_meta": "", + "headers": { + "accept": "application/vnd.elasticsearch+json; compatible-with=8" + }, + } + elif major_version == 7: expected_kwargs = { **kwargs, "headers": {"accept": "application/json"}, @@ -452,8 +484,8 @@ def request_hook(span, method, url, kwargs): else: expected_kwargs = {**kwargs} self.assertEqual( - json.dumps(expected_kwargs), - spans[0].attributes[request_hook_kwargs_attribute], + expected_kwargs, + json.loads(spans[0].attributes[request_hook_kwargs_attribute]), ) def test_response_hook(self, request_mock): @@ -492,7 +524,9 @@ def response_hook(span, response): }, } - request_mock.return_value = (1, {}, json.dumps(response_payload)) + request_mock.return_value = helpers.mock_response( + json.dumps(response_payload) + ) es = get_elasticsearch_client(hosts=["http://localhost:9200"]) es.get( index="test-index", **normalize_arguments(doc_type="_doc"), id=1 @@ -512,7 +546,7 @@ def test_no_op_tracer_provider(self, request_mock): tracer_provider=trace.NoOpTracerProvider() ) response_payload = '{"found": false, "timed_out": true, "took": 7}' - request_mock.return_value = (1, {}, response_payload) + request_mock.return_value = helpers.mock_response(response_payload) es = get_elasticsearch_client(hosts=["http://localhost:9200"]) res = es.get( index="test-index", **normalize_arguments(doc_type="_doc"), id=1 @@ -543,7 +577,7 @@ def test_body_sanitization(self, _): ) def test_bulk(self, request_mock): - request_mock.return_value = (1, {}, "{}") + request_mock.return_value = helpers.mock_response("{}") es = get_elasticsearch_client(hosts=["http://localhost:9200"]) es.bulk( diff --git a/tox.ini b/tox.ini index ae11e0f24f..fecc9e5af7 100644 --- a/tox.ini +++ b/tox.ini @@ -92,8 +92,9 @@ envlist = ; below mean these dependencies are being used: ; 0: elasticsearch-dsl==6.4.0 elasticsearch==6.8.2 ; 1: elasticsearch-dsl==7.4.1 elasticsearch==7.17.9 - py3{8,9,10,11}-test-instrumentation-elasticsearch-{0,1} - pypy3-test-instrumentation-elasticsearch-{0,1} + ; 2: elasticsearch-dsl>=8.0,<8.13 elasticsearch>=8.0,<8.13 + py3{8,9,10,11}-test-instrumentation-elasticsearch-{0,1,2} + pypy3-test-instrumentation-elasticsearch-{0,1,2} lint-instrumentation-elasticsearch ; opentelemetry-instrumentation-falcon @@ -716,7 +717,8 @@ commands_pre = elasticsearch: pip install opentelemetry-test-utils@{env:CORE_REPO}\#egg=opentelemetry-test-utils&subdirectory=tests/opentelemetry-test-utils elasticsearch-0: pip install -r {toxinidir}/instrumentation/opentelemetry-instrumentation-elasticsearch/test-requirements-0.txt elasticsearch-1: pip install -r {toxinidir}/instrumentation/opentelemetry-instrumentation-elasticsearch/test-requirements-1.txt - lint-instrumentation-elasticsearch: pip install -r {toxinidir}/instrumentation/opentelemetry-instrumentation-elasticsearch/test-requirements-1.txt + elasticsearch-2: pip install -r {toxinidir}/instrumentation/opentelemetry-instrumentation-elasticsearch/test-requirements-2.txt + lint-instrumentation-elasticsearch: pip install -r {toxinidir}/instrumentation/opentelemetry-instrumentation-elasticsearch/test-requirements-2.txt asyncio: pip install opentelemetry-api@{env:CORE_REPO}\#egg=opentelemetry-api&subdirectory=opentelemetry-api asyncio: pip install opentelemetry-semantic-conventions@{env:CORE_REPO}\#egg=opentelemetry-semantic-conventions&subdirectory=opentelemetry-semantic-conventions From d0500c2f8a2160ef21ae4ef3fa3f522f3eea7f94 Mon Sep 17 00:00:00 2001 From: Diego Hurtado Date: Tue, 14 May 2024 15:26:31 -0500 Subject: [PATCH 07/56] Add error handling to opentelemetry-bootstrap -a (#2517) * Revert "Refactor bootstrap generation (#2101)" This reverts commit 1ee7261ea7117fbd22e2262e488402213a874125. * Add error handling to opentelemetry-bootstrap -a Fixes #2516 --------- Co-authored-by: Tammy Baylis <96076570+tammy-baylis-swi@users.noreply.github.com> --- .../instrumentation/bootstrap.py | 41 ++++++++++------- .../instrumentation/bootstrap_gen.py | 5 ++ scripts/otel_packaging.py | 46 +++++++------------ 3 files changed, 47 insertions(+), 45 deletions(-) diff --git a/opentelemetry-instrumentation/src/opentelemetry/instrumentation/bootstrap.py b/opentelemetry-instrumentation/src/opentelemetry/instrumentation/bootstrap.py index 0c8f0aa3c4..6f86a539b2 100644 --- a/opentelemetry-instrumentation/src/opentelemetry/instrumentation/bootstrap.py +++ b/opentelemetry-instrumentation/src/opentelemetry/instrumentation/bootstrap.py @@ -14,8 +14,14 @@ import argparse import logging -import subprocess import sys +from subprocess import ( + PIPE, + CalledProcessError, + Popen, + SubprocessError, + check_call, +) import pkg_resources @@ -34,7 +40,7 @@ def wrapper(package=None): if package: return func(package) return func() - except subprocess.SubprocessError as exp: + except SubprocessError as exp: cmd = getattr(exp, "cmd", None) if cmd: msg = f'Error calling system command "{" ".join(cmd)}"' @@ -48,18 +54,21 @@ def wrapper(package=None): @_syscall def _sys_pip_install(package): # explicit upgrade strategy to override potential pip config - subprocess.check_call( - [ - sys.executable, - "-m", - "pip", - "install", - "-U", - "--upgrade-strategy", - "only-if-needed", - package, - ] - ) + try: + check_call( + [ + sys.executable, + "-m", + "pip", + "install", + "-U", + "--upgrade-strategy", + "only-if-needed", + package, + ] + ) + except CalledProcessError as error: + print(error) def _pip_check(): @@ -70,8 +79,8 @@ def _pip_check(): 'opentelemetry-instrumentation-flask 1.0.1 has requirement opentelemetry-sdk<2.0,>=1.0, but you have opentelemetry-sdk 0.5.' To not be too restrictive, we'll only check for relevant packages. """ - with subprocess.Popen( - [sys.executable, "-m", "pip", "check"], stdout=subprocess.PIPE + with Popen( + [sys.executable, "-m", "pip", "check"], stdout=PIPE ) as check_pipe: pip_check = check_pipe.communicate()[0].decode() pip_check_lower = pip_check.lower() diff --git a/opentelemetry-instrumentation/src/opentelemetry/instrumentation/bootstrap_gen.py b/opentelemetry-instrumentation/src/opentelemetry/instrumentation/bootstrap_gen.py index 55d2f498a1..9eebd5bb38 100644 --- a/opentelemetry-instrumentation/src/opentelemetry/instrumentation/bootstrap_gen.py +++ b/opentelemetry-instrumentation/src/opentelemetry/instrumentation/bootstrap_gen.py @@ -24,6 +24,10 @@ "library": "aiohttp ~= 3.0", "instrumentation": "opentelemetry-instrumentation-aiohttp-client==0.46b0.dev", }, + { + "library": "aiohttp ~= 3.0", + "instrumentation": "opentelemetry-instrumentation-aiohttp-server==0.46b0.dev", + }, { "library": "aiopg >= 0.13.0, < 2.0.0", "instrumentation": "opentelemetry-instrumentation-aiopg==0.46b0.dev", @@ -187,6 +191,7 @@ "opentelemetry-instrumentation-dbapi==0.46b0.dev", "opentelemetry-instrumentation-logging==0.46b0.dev", "opentelemetry-instrumentation-sqlite3==0.46b0.dev", + "opentelemetry-instrumentation-threading==0.46b0.dev", "opentelemetry-instrumentation-urllib==0.46b0.dev", "opentelemetry-instrumentation-wsgi==0.46b0.dev", ] diff --git a/scripts/otel_packaging.py b/scripts/otel_packaging.py index c6c11c45fa..2f42e44189 100644 --- a/scripts/otel_packaging.py +++ b/scripts/otel_packaging.py @@ -12,55 +12,43 @@ # See the License for the specific language governing permissions and # limitations under the License. -from tomli import load -from os import path, listdir -from subprocess import check_output, CalledProcessError -from requests import get +import os +import subprocess +from subprocess import CalledProcessError -scripts_path = path.dirname(path.abspath(__file__)) -root_path = path.dirname(scripts_path) -instrumentations_path = path.join(root_path, "instrumentation") +import tomli + +scripts_path = os.path.dirname(os.path.abspath(__file__)) +root_path = os.path.dirname(scripts_path) +instrumentations_path = os.path.join(root_path, "instrumentation") def get_instrumentation_packages(): - for pkg in sorted(listdir(instrumentations_path)): - pkg_path = path.join(instrumentations_path, pkg) - if not path.isdir(pkg_path): + for pkg in sorted(os.listdir(instrumentations_path)): + pkg_path = os.path.join(instrumentations_path, pkg) + if not os.path.isdir(pkg_path): continue - error = f"Could not get version for package {pkg}" - try: - hatch_version = check_output( + version = subprocess.check_output( "hatch version", shell=True, cwd=pkg_path, - universal_newlines=True + universal_newlines=True, ) - except CalledProcessError as exc: print(f"Could not get hatch version from path {pkg_path}") print(exc.output) + raise exc - try: - response = get(f"https://pypi.org/pypi/{pkg}/json", timeout=10) - - except Exception: - print(error) - continue - - if response.status_code != 200: - print(error) - continue - - pyproject_toml_path = path.join(pkg_path, "pyproject.toml") + pyproject_toml_path = os.path.join(pkg_path, "pyproject.toml") with open(pyproject_toml_path, "rb") as file: - pyproject_toml = load(file) + pyproject_toml = tomli.load(file) instrumentation = { "name": pyproject_toml["project"]["name"], - "version": hatch_version.strip(), + "version": version.strip(), "instruments": pyproject_toml["project"]["optional-dependencies"][ "instruments" ], From 460fc335836c395db8472ecf464e7ecd94c08925 Mon Sep 17 00:00:00 2001 From: Guillermo Date: Wed, 15 May 2024 03:52:59 -0600 Subject: [PATCH 08/56] Fix typo in sample code (#2494) Co-authored-by: Riccardo Magliocchetti --- .../src/opentelemetry/instrumentation/tornado/__init__.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) 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 5c99457a39..be9129bda0 100644 --- a/instrumentation/opentelemetry-instrumentation-tornado/src/opentelemetry/instrumentation/tornado/__init__.py +++ b/instrumentation/opentelemetry-instrumentation-tornado/src/opentelemetry/instrumentation/tornado/__init__.py @@ -87,14 +87,14 @@ def client_request_hook(span, request): # will be called after a outgoing request made with # `tornado.httpclient.AsyncHTTPClient.fetch` finishes. # `response`` is an instance of ``Future[tornado.httpclient.HTTPResponse]`. - def client_resposne_hook(span, future): + def client_response_hook(span, future): pass # apply tornado instrumentation with hooks TornadoInstrumentor().instrument( server_request_hook=server_request_hook, client_request_hook=client_request_hook, - client_response_hook=client_resposne_hook + client_response_hook=client_response_hook ) Capture HTTP request and response headers From f8758c6902ed725864ff677f739829aa6bce2078 Mon Sep 17 00:00:00 2001 From: Leighton Chen Date: Thu, 16 May 2024 14:05:21 -0700 Subject: [PATCH 09/56] Implement functions resource detector (#2523) * Update .pylintrc * fn * Update CHANGELOG.md * commments * Add deployment.environment to functions detector * Revert "Add deployment.environment to functions detector" This reverts commit 5411759711b8bc9976705deb416d5ffd8f65590f. * Remove deployment.environment from readme * Release 0.1.5 --------- Co-authored-by: jeremydvoss --- .../CHANGELOG.md | 4 +- .../README.rst | 12 +- .../pyproject.toml | 1 + .../resource/detector/azure/__init__.py | 2 + .../resource/detector/azure/_constants.py | 6 + .../resource/detector/azure/_utils.py | 27 ++++- .../resource/detector/azure/app_service.py | 32 ++--- .../resource/detector/azure/functions.py | 68 +++++++++++ .../resource/detector/azure/version.py | 2 +- .../tests/test_app_service.py | 39 +++++++ .../tests/test_functions.py | 110 ++++++++++++++++++ 11 files changed, 274 insertions(+), 29 deletions(-) create mode 100644 resource/opentelemetry-resource-detector-azure/src/opentelemetry/resource/detector/azure/functions.py create mode 100644 resource/opentelemetry-resource-detector-azure/tests/test_functions.py diff --git a/resource/opentelemetry-resource-detector-azure/CHANGELOG.md b/resource/opentelemetry-resource-detector-azure/CHANGELOG.md index 8954fc5359..f77fce18f1 100644 --- a/resource/opentelemetry-resource-detector-azure/CHANGELOG.md +++ b/resource/opentelemetry-resource-detector-azure/CHANGELOG.md @@ -5,10 +5,12 @@ All notable changes to this project will be documented in this file. The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). -## Unreleased +## Version 0.1.5 (2024-05-16) - Ignore vm detector if already in other rps ([#2456](https://github.com/open-telemetry/opentelemetry-python-contrib/pull/2456)) +- Implement functions resource detector + ([#2523](https://github.com/open-telemetry/opentelemetry-python-contrib/pull/2523)) ## Version 0.1.4 (2024-04-05) diff --git a/resource/opentelemetry-resource-detector-azure/README.rst b/resource/opentelemetry-resource-detector-azure/README.rst index 6a376534ad..baf2dddbbe 100644 --- a/resource/opentelemetry-resource-detector-azure/README.rst +++ b/resource/opentelemetry-resource-detector-azure/README.rst @@ -60,7 +60,17 @@ The Azure App Service Resource Detector sets the following Resource Attributes: * ``service.instance.id`` set to the value of the ``WEBSITE_INSTANCE_ID`` environment variable. * ``azure.app.service.stamp`` set to the value of the ``WEBSITE_HOME_STAMPNAME`` environment variable. -The Azure VM Resource Detector sets the following Resource Attributes according to the response from the `Azure Metadata Service `_: + The Azure Functions Resource Detector sets the following Resource Attributes: + * ``service.name`` set to the value of the ``WEBSITE_SITE_NAME`` environment variable. + * ``process.id`` set to the process ID collected from the running process. + * ``cloud.platform`` set to ``azure_functions``. + * ``cloud.provider`` set to ``azure``. + * ``cloud.resource_id`` set using the ``WEBSITE_RESOURCE_GROUP``, ``WEBSITE_OWNER_NAME``, and ``WEBSITE_SITE_NAME`` environment variables. + * ``cloud.region`` set to the value of the ``REGION_NAME`` environment variable. + * ``faas.instance`` set to the value of the ``WEBSITE_INSTANCE_ID`` environment variable. + * ``faas.max_memory`` set to the value of the ``WEBSITE_MEMORY_LIMIT_MB`` environment variable. + +The Azure VM Resource Detector sets the following Resource Attributes according to the response from the `Azure Metadata Service `_: * ``azure.vm.scaleset.name`` set to the value of the ``vmScaleSetName`` field. * ``azure.vm.sku`` set to the value of the ``sku`` field. * ``cloud.platform`` set to the value of the ``azure_vm``. diff --git a/resource/opentelemetry-resource-detector-azure/pyproject.toml b/resource/opentelemetry-resource-detector-azure/pyproject.toml index 72260709f9..efa1b24ee7 100644 --- a/resource/opentelemetry-resource-detector-azure/pyproject.toml +++ b/resource/opentelemetry-resource-detector-azure/pyproject.toml @@ -29,6 +29,7 @@ dependencies = [ [project.entry-points.opentelemetry_resource_detector] azure_app_service = "opentelemetry.resource.detector.azure.app_service:AzureAppServiceResourceDetector" +azure_functions = "opentelemetry.resource.detector.azure.functions:AzureFunctionsResourceDetector" azure_vm = "opentelemetry.resource.detector.azure.vm:AzureVMResourceDetector" [project.urls] diff --git a/resource/opentelemetry-resource-detector-azure/src/opentelemetry/resource/detector/azure/__init__.py b/resource/opentelemetry-resource-detector-azure/src/opentelemetry/resource/detector/azure/__init__.py index 913b677c3e..628a8ab781 100644 --- a/resource/opentelemetry-resource-detector-azure/src/opentelemetry/resource/detector/azure/__init__.py +++ b/resource/opentelemetry-resource-detector-azure/src/opentelemetry/resource/detector/azure/__init__.py @@ -15,11 +15,13 @@ # pylint: disable=import-error from .app_service import AzureAppServiceResourceDetector +from .functions import AzureFunctionsResourceDetector from .version import __version__ from .vm import AzureVMResourceDetector __all__ = [ "AzureAppServiceResourceDetector", + "AzureFunctionsResourceDetector", "AzureVMResourceDetector", "__version__", ] diff --git a/resource/opentelemetry-resource-detector-azure/src/opentelemetry/resource/detector/azure/_constants.py b/resource/opentelemetry-resource-detector-azure/src/opentelemetry/resource/detector/azure/_constants.py index dddc6632ac..3a6415e0d5 100644 --- a/resource/opentelemetry-resource-detector-azure/src/opentelemetry/resource/detector/azure/_constants.py +++ b/resource/opentelemetry-resource-detector-azure/src/opentelemetry/resource/detector/azure/_constants.py @@ -43,6 +43,12 @@ # Functions _FUNCTIONS_WORKER_RUNTIME = "FUNCTIONS_WORKER_RUNTIME" +_WEBSITE_MEMORY_LIMIT_MB = "WEBSITE_MEMORY_LIMIT_MB" + +_FUNCTIONS_ATTRIBUTE_ENV_VARS = { + ResourceAttributes.FAAS_INSTANCE: _WEBSITE_INSTANCE_ID, + ResourceAttributes.FAAS_MAX_MEMORY: _WEBSITE_MEMORY_LIMIT_MB, +} # Vm diff --git a/resource/opentelemetry-resource-detector-azure/src/opentelemetry/resource/detector/azure/_utils.py b/resource/opentelemetry-resource-detector-azure/src/opentelemetry/resource/detector/azure/_utils.py index 3f73613945..62d00c5a6c 100644 --- a/resource/opentelemetry-resource-detector-azure/src/opentelemetry/resource/detector/azure/_utils.py +++ b/resource/opentelemetry-resource-detector-azure/src/opentelemetry/resource/detector/azure/_utils.py @@ -11,27 +11,44 @@ # 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 +from os import environ +from typing import Optional from ._constants import ( _AKS_ARM_NAMESPACE_ID, _FUNCTIONS_WORKER_RUNTIME, + _WEBSITE_OWNER_NAME, + _WEBSITE_RESOURCE_GROUP, _WEBSITE_SITE_NAME, ) def _is_on_aks() -> bool: - return os.environ.get(_AKS_ARM_NAMESPACE_ID) is not None + return environ.get(_AKS_ARM_NAMESPACE_ID) is not None def _is_on_app_service() -> bool: - return os.environ.get(_WEBSITE_SITE_NAME) is not None + return environ.get(_WEBSITE_SITE_NAME) is not None def _is_on_functions() -> bool: - return os.environ.get(_FUNCTIONS_WORKER_RUNTIME) is not None + return environ.get(_FUNCTIONS_WORKER_RUNTIME) is not None def _can_ignore_vm_detect() -> bool: return _is_on_aks() or _is_on_app_service() or _is_on_functions() + + +def _get_azure_resource_uri() -> Optional[str]: + website_site_name = environ.get(_WEBSITE_SITE_NAME) + website_resource_group = environ.get(_WEBSITE_RESOURCE_GROUP) + website_owner_name = environ.get(_WEBSITE_OWNER_NAME) + + subscription_id = website_owner_name + if website_owner_name and "+" in website_owner_name: + subscription_id = website_owner_name[0 : website_owner_name.index("+")] + + if not (website_site_name and website_resource_group and subscription_id): + return None + + return f"/subscriptions/{subscription_id}/resourceGroups/{website_resource_group}/providers/Microsoft.Web/sites/{website_site_name}" diff --git a/resource/opentelemetry-resource-detector-azure/src/opentelemetry/resource/detector/azure/app_service.py b/resource/opentelemetry-resource-detector-azure/src/opentelemetry/resource/detector/azure/app_service.py index 613d8f9410..41371b8eec 100644 --- a/resource/opentelemetry-resource-detector-azure/src/opentelemetry/resource/detector/azure/app_service.py +++ b/resource/opentelemetry-resource-detector-azure/src/opentelemetry/resource/detector/azure/app_service.py @@ -12,6 +12,7 @@ # See the License for the specific language governing permissions and # limitations under the License. +from typing import Optional from os import environ from opentelemetry.sdk.resources import Resource, ResourceDetector @@ -20,29 +21,32 @@ CloudProviderValues, ResourceAttributes, ) +from opentelemetry.resource.detector.azure._utils import _get_azure_resource_uri from ._constants import ( _APP_SERVICE_ATTRIBUTE_ENV_VARS, - _WEBSITE_OWNER_NAME, - _WEBSITE_RESOURCE_GROUP, _WEBSITE_SITE_NAME, ) +from opentelemetry.resource.detector.azure._utils import _is_on_functions + class AzureAppServiceResourceDetector(ResourceDetector): def detect(self) -> Resource: attributes = {} website_site_name = environ.get(_WEBSITE_SITE_NAME) if website_site_name: - attributes[ResourceAttributes.SERVICE_NAME] = website_site_name + # Functions resource detector takes priority with `service.name` and `cloud.platform` + if not _is_on_functions(): + attributes[ResourceAttributes.SERVICE_NAME] = website_site_name + attributes[ResourceAttributes.CLOUD_PLATFORM] = ( + CloudPlatformValues.AZURE_APP_SERVICE.value + ) attributes[ResourceAttributes.CLOUD_PROVIDER] = ( CloudProviderValues.AZURE.value ) - attributes[ResourceAttributes.CLOUD_PLATFORM] = ( - CloudPlatformValues.AZURE_APP_SERVICE.value - ) - azure_resource_uri = _get_azure_resource_uri(website_site_name) + azure_resource_uri = _get_azure_resource_uri() if azure_resource_uri: attributes[ResourceAttributes.CLOUD_RESOURCE_ID] = ( azure_resource_uri @@ -53,17 +57,3 @@ def detect(self) -> Resource: attributes[key] = value return Resource(attributes) - - -def _get_azure_resource_uri(website_site_name): - website_resource_group = environ.get(_WEBSITE_RESOURCE_GROUP) - website_owner_name = environ.get(_WEBSITE_OWNER_NAME) - - subscription_id = website_owner_name - if website_owner_name and "+" in website_owner_name: - subscription_id = website_owner_name[0 : website_owner_name.index("+")] - - if not (website_resource_group and subscription_id): - return None - - return f"/subscriptions/{subscription_id}/resourceGroups/{website_resource_group}/providers/Microsoft.Web/sites/{website_site_name}" diff --git a/resource/opentelemetry-resource-detector-azure/src/opentelemetry/resource/detector/azure/functions.py b/resource/opentelemetry-resource-detector-azure/src/opentelemetry/resource/detector/azure/functions.py new file mode 100644 index 0000000000..0bf9a10f86 --- /dev/null +++ b/resource/opentelemetry-resource-detector-azure/src/opentelemetry/resource/detector/azure/functions.py @@ -0,0 +1,68 @@ +# 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 os import environ, getpid + +from opentelemetry.sdk.resources import Resource, ResourceDetector +from opentelemetry.semconv.resource import ( + CloudPlatformValues, + CloudProviderValues, + ResourceAttributes, +) + +from ._constants import ( + _FUNCTIONS_ATTRIBUTE_ENV_VARS, + _REGION_NAME, + _WEBSITE_SITE_NAME, +) +from opentelemetry.resource.detector.azure._utils import ( + _get_azure_resource_uri, + _is_on_functions, +) + + +class AzureFunctionsResourceDetector(ResourceDetector): + def detect(self) -> Resource: + attributes = {} + if _is_on_functions(): + website_site_name = environ.get(_WEBSITE_SITE_NAME) + if website_site_name: + attributes[ResourceAttributes.SERVICE_NAME] = website_site_name + attributes[ResourceAttributes.PROCESS_PID] = getpid() + attributes[ResourceAttributes.CLOUD_PROVIDER] = ( + CloudProviderValues.AZURE.value + ) + attributes[ResourceAttributes.CLOUD_PLATFORM] = ( + CloudPlatformValues.AZURE_FUNCTIONS.value + ) + cloud_region = environ.get(_REGION_NAME) + if cloud_region: + attributes[ResourceAttributes.CLOUD_REGION] = cloud_region + azure_resource_uri = _get_azure_resource_uri() + if azure_resource_uri: + attributes[ResourceAttributes.CLOUD_RESOURCE_ID] = ( + azure_resource_uri + ) + for key, env_var in _FUNCTIONS_ATTRIBUTE_ENV_VARS.items(): + value = environ.get(env_var) + if value: + if key == ResourceAttributes.FAAS_MAX_MEMORY: + try: + value = int(value) + except ValueError: + continue + attributes[key] = value + + return Resource(attributes) + diff --git a/resource/opentelemetry-resource-detector-azure/src/opentelemetry/resource/detector/azure/version.py b/resource/opentelemetry-resource-detector-azure/src/opentelemetry/resource/detector/azure/version.py index f961659f70..fac29d773f 100644 --- a/resource/opentelemetry-resource-detector-azure/src/opentelemetry/resource/detector/azure/version.py +++ b/resource/opentelemetry-resource-detector-azure/src/opentelemetry/resource/detector/azure/version.py @@ -12,4 +12,4 @@ # See the License for the specific language governing permissions and # limitations under the License. -__version__ = "0.1.4" +__version__ = "0.1.5" diff --git a/resource/opentelemetry-resource-detector-azure/tests/test_app_service.py b/resource/opentelemetry-resource-detector-azure/tests/test_app_service.py index c5d2396dab..6c3d395994 100644 --- a/resource/opentelemetry-resource-detector-azure/tests/test_app_service.py +++ b/resource/opentelemetry-resource-detector-azure/tests/test_app_service.py @@ -68,6 +68,45 @@ def test_on_app_service(self): self.assertEqual( attributes["azure.app.service.stamp"], TEST_WEBSITE_HOME_STAMPNAME ) + + @patch.dict( + "os.environ", + { + "FUNCTIONS_WORKER_RUNTIME": "1", + "WEBSITE_SITE_NAME": TEST_WEBSITE_SITE_NAME, + "REGION_NAME": TEST_REGION_NAME, + "WEBSITE_SLOT_NAME": TEST_WEBSITE_SLOT_NAME, + "WEBSITE_HOSTNAME": TEST_WEBSITE_HOSTNAME, + "WEBSITE_INSTANCE_ID": TEST_WEBSITE_INSTANCE_ID, + "WEBSITE_HOME_STAMPNAME": TEST_WEBSITE_HOME_STAMPNAME, + "WEBSITE_RESOURCE_GROUP": TEST_WEBSITE_RESOURCE_GROUP, + "WEBSITE_OWNER_NAME": TEST_WEBSITE_OWNER_NAME, + }, + clear=True, + ) + def test_on_app_service_with_functions(self): + resource = AzureAppServiceResourceDetector().detect() + attributes = resource.attributes + self.assertIsNone(attributes.get("service.name")) + self.assertEqual(attributes["cloud.provider"], "azure") + self.assertIsNone(attributes.get("cloud.platform")) + + self.assertEqual( + attributes["cloud.resource_id"], + f"/subscriptions/{TEST_WEBSITE_OWNER_NAME}/resourceGroups/{TEST_WEBSITE_RESOURCE_GROUP}/providers/Microsoft.Web/sites/{TEST_WEBSITE_SITE_NAME}", + ) + + self.assertEqual(attributes["cloud.region"], TEST_REGION_NAME) + self.assertEqual( + attributes["deployment.environment"], TEST_WEBSITE_SLOT_NAME + ) + self.assertEqual(attributes["host.id"], TEST_WEBSITE_HOSTNAME) + self.assertEqual( + attributes["service.instance.id"], TEST_WEBSITE_INSTANCE_ID + ) + self.assertEqual( + attributes["azure.app.service.stamp"], TEST_WEBSITE_HOME_STAMPNAME + ) @patch.dict( "os.environ", diff --git a/resource/opentelemetry-resource-detector-azure/tests/test_functions.py b/resource/opentelemetry-resource-detector-azure/tests/test_functions.py new file mode 100644 index 0000000000..1f5354c500 --- /dev/null +++ b/resource/opentelemetry-resource-detector-azure/tests/test_functions.py @@ -0,0 +1,110 @@ +# 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 unittest +from unittest.mock import patch + +# pylint: disable=no-name-in-module +from opentelemetry.resource.detector.azure.functions import ( + AzureFunctionsResourceDetector, +) + +TEST_WEBSITE_SITE_NAME = "TEST_WEBSITE_SITE_NAME" +TEST_REGION_NAME = "TEST_REGION_NAME" +TEST_WEBSITE_INSTANCE_ID = "TEST_WEBSITE_INSTANCE_ID" + +TEST_WEBSITE_RESOURCE_GROUP = "TEST_WEBSITE_RESOURCE_GROUP" +TEST_WEBSITE_OWNER_NAME = "TEST_WEBSITE_OWNER_NAME" +TEST_WEBSITE_MEMORY_LIMIT_MB = "1024" + + +class TestAzureAppServiceResourceDetector(unittest.TestCase): + @patch.dict( + "os.environ", + { + "FUNCTIONS_WORKER_RUNTIME": "1", + "WEBSITE_SITE_NAME": TEST_WEBSITE_SITE_NAME, + "REGION_NAME": TEST_REGION_NAME, + "WEBSITE_INSTANCE_ID": TEST_WEBSITE_INSTANCE_ID, + "WEBSITE_RESOURCE_GROUP": TEST_WEBSITE_RESOURCE_GROUP, + "WEBSITE_OWNER_NAME": TEST_WEBSITE_OWNER_NAME, + "WEBSITE_MEMORY_LIMIT_MB": TEST_WEBSITE_MEMORY_LIMIT_MB, + }, + clear=True, + ) + @patch("opentelemetry.resource.detector.azure.functions.getpid") + def test_on_functions(self, pid_mock): + pid_mock.return_value = 1000 + resource = AzureFunctionsResourceDetector().detect() + attributes = resource.attributes + self.assertEqual(attributes["service.name"], TEST_WEBSITE_SITE_NAME) + self.assertEqual(attributes["cloud.provider"], "azure") + self.assertEqual(attributes["cloud.platform"], "azure_functions") + self.assertEqual(attributes["process.pid"], 1000) + + self.assertEqual( + attributes["cloud.resource_id"], + f"/subscriptions/{TEST_WEBSITE_OWNER_NAME}/resourceGroups/{TEST_WEBSITE_RESOURCE_GROUP}/providers/Microsoft.Web/sites/{TEST_WEBSITE_SITE_NAME}", + ) + + self.assertEqual(attributes["cloud.region"], TEST_REGION_NAME) + self.assertEqual(attributes["faas.instance"], TEST_WEBSITE_INSTANCE_ID) + self.assertEqual(attributes["faas.max_memory"], 1024) + + @patch.dict( + "os.environ", + { + "FUNCTIONS_WORKER_RUNTIME": "1", + "WEBSITE_SITE_NAME": TEST_WEBSITE_SITE_NAME, + "REGION_NAME": TEST_REGION_NAME, + "WEBSITE_INSTANCE_ID": TEST_WEBSITE_INSTANCE_ID, + "WEBSITE_RESOURCE_GROUP": TEST_WEBSITE_RESOURCE_GROUP, + "WEBSITE_OWNER_NAME": TEST_WEBSITE_OWNER_NAME, + "WEBSITE_MEMORY_LIMIT_MB": "error", + }, + clear=True, + ) + @patch("opentelemetry.resource.detector.azure.functions.getpid") + def test_on_functions_error_memory(self, pid_mock): + pid_mock.return_value = 1000 + resource = AzureFunctionsResourceDetector().detect() + attributes = resource.attributes + self.assertEqual(attributes["service.name"], TEST_WEBSITE_SITE_NAME) + self.assertEqual(attributes["cloud.provider"], "azure") + self.assertEqual(attributes["cloud.platform"], "azure_functions") + self.assertEqual(attributes["process.pid"], 1000) + + self.assertEqual( + attributes["cloud.resource_id"], + f"/subscriptions/{TEST_WEBSITE_OWNER_NAME}/resourceGroups/{TEST_WEBSITE_RESOURCE_GROUP}/providers/Microsoft.Web/sites/{TEST_WEBSITE_SITE_NAME}", + ) + + self.assertEqual(attributes["cloud.region"], TEST_REGION_NAME) + self.assertEqual(attributes["faas.instance"], TEST_WEBSITE_INSTANCE_ID) + self.assertIsNone(attributes.get("faas.max_memory")) + + @patch.dict( + "os.environ", + { + "WEBSITE_SITE_NAME": TEST_WEBSITE_SITE_NAME, + "REGION_NAME": TEST_REGION_NAME, + "WEBSITE_INSTANCE_ID": TEST_WEBSITE_INSTANCE_ID, + "WEBSITE_RESOURCE_GROUP": TEST_WEBSITE_RESOURCE_GROUP, + "WEBSITE_OWNER_NAME": TEST_WEBSITE_OWNER_NAME, + "WEBSITE_MEMORY_LIMIT_MB": TEST_WEBSITE_MEMORY_LIMIT_MB, + }, + clear=True, + ) + def test_off_app_service(self): + resource = AzureFunctionsResourceDetector().detect() + self.assertEqual(resource.attributes, {}) From f4f3042f85fa68565c4da3f96d437b15d78e1063 Mon Sep 17 00:00:00 2001 From: Povilas Versockas Date: Wed, 22 May 2024 07:48:54 +0300 Subject: [PATCH 10/56] fix(async-io): check for __name__ atribute when tracing coroutine (#2521) --- CHANGELOG.md | 2 + .../instrumentation/asyncio/__init__.py | 2 + .../tests/test_asyncio_anext.py | 56 +++++++++++++++++++ 3 files changed, 60 insertions(+) create mode 100644 instrumentation/opentelemetry-instrumentation-asyncio/tests/test_asyncio_anext.py diff --git a/CHANGELOG.md b/CHANGELOG.md index d10983c10b..b963cfddc2 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -53,6 +53,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ([#2474](https://github.com/open-telemetry/opentelemetry-python-contrib/pull/2474)) - `opentelemetry-instrumentation-elasticsearch` Improved support for version 8 ([#2420](https://github.com/open-telemetry/opentelemetry-python-contrib/pull/2420)) +- `opentelemetry-instrumentation-asyncio` Check for __name__ attribute in the coroutine + ([#2521](https://github.com/open-telemetry/opentelemetry-python-contrib/pull/2521)) ## Version 1.24.0/0.45b0 (2024-03-28) 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 72aa5fd2aa..6d82da6cd0 100644 --- a/instrumentation/opentelemetry-instrumentation-asyncio/src/opentelemetry/instrumentation/asyncio/__init__.py +++ b/instrumentation/opentelemetry-instrumentation-asyncio/src/opentelemetry/instrumentation/asyncio/__init__.py @@ -261,6 +261,8 @@ def trace_item(self, coro_or_future): return coro_or_future async def trace_coroutine(self, coro): + if not hasattr(coro, "__name__"): + return start = default_timer() attr = { "type": "coroutine", diff --git a/instrumentation/opentelemetry-instrumentation-asyncio/tests/test_asyncio_anext.py b/instrumentation/opentelemetry-instrumentation-asyncio/tests/test_asyncio_anext.py new file mode 100644 index 0000000000..9ce3fc4b33 --- /dev/null +++ b/instrumentation/opentelemetry-instrumentation-asyncio/tests/test_asyncio_anext.py @@ -0,0 +1,56 @@ +# 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 asyncio +from unittest.mock import patch + +# pylint: disable=no-name-in-module +from opentelemetry.instrumentation.asyncio import AsyncioInstrumentor +from opentelemetry.instrumentation.asyncio.environment_variables import ( + OTEL_PYTHON_ASYNCIO_COROUTINE_NAMES_TO_TRACE, +) +from opentelemetry.test.test_base import TestBase +from opentelemetry.trace import get_tracer + + +class TestAsyncioAnext(TestBase): + @patch.dict( + "os.environ", + {OTEL_PYTHON_ASYNCIO_COROUTINE_NAMES_TO_TRACE: "async_func"}, + ) + def setUp(self): + super().setUp() + AsyncioInstrumentor().instrument() + self._tracer = get_tracer( + __name__, + ) + + def tearDown(self): + super().tearDown() + AsyncioInstrumentor().uninstrument() + + # Asyncio anext() does not have __name__ attribute, which is used to determine if the coroutine should be traced. + # This test is to ensure that the instrumentation does not break when the coroutine does not have __name__ attribute. + def test_asyncio_anext(self): + async def main(): + async def async_gen(): + for it in range(2): + yield it + + async_gen_instance = async_gen() + agen = anext(async_gen_instance) + await asyncio.create_task(agen) + + asyncio.run(main()) + spans = self.memory_exporter.get_finished_spans() + self.assertEqual(len(spans), 0) From c28f9b837f386cffd9b0f8800f7653a85ca5c60e Mon Sep 17 00:00:00 2001 From: Jeremy Voss Date: Wed, 22 May 2024 10:45:10 -0700 Subject: [PATCH 11/56] Update functions detector readme (#2533) --- .../README.rst | 21 ++++++++++--------- 1 file changed, 11 insertions(+), 10 deletions(-) diff --git a/resource/opentelemetry-resource-detector-azure/README.rst b/resource/opentelemetry-resource-detector-azure/README.rst index baf2dddbbe..19a0f97f32 100644 --- a/resource/opentelemetry-resource-detector-azure/README.rst +++ b/resource/opentelemetry-resource-detector-azure/README.rst @@ -9,6 +9,7 @@ OpenTelemetry Resource detectors for Azure This library contains OpenTelemetry `Resource Detectors `_ for the following Azure resources: * `Azure App Service `_ * `Azure Virtual Machines `_ + * `Azure Functions (Experimental) `_ Installation ------------ @@ -60,16 +61,6 @@ The Azure App Service Resource Detector sets the following Resource Attributes: * ``service.instance.id`` set to the value of the ``WEBSITE_INSTANCE_ID`` environment variable. * ``azure.app.service.stamp`` set to the value of the ``WEBSITE_HOME_STAMPNAME`` environment variable. - The Azure Functions Resource Detector sets the following Resource Attributes: - * ``service.name`` set to the value of the ``WEBSITE_SITE_NAME`` environment variable. - * ``process.id`` set to the process ID collected from the running process. - * ``cloud.platform`` set to ``azure_functions``. - * ``cloud.provider`` set to ``azure``. - * ``cloud.resource_id`` set using the ``WEBSITE_RESOURCE_GROUP``, ``WEBSITE_OWNER_NAME``, and ``WEBSITE_SITE_NAME`` environment variables. - * ``cloud.region`` set to the value of the ``REGION_NAME`` environment variable. - * ``faas.instance`` set to the value of the ``WEBSITE_INSTANCE_ID`` environment variable. - * ``faas.max_memory`` set to the value of the ``WEBSITE_MEMORY_LIMIT_MB`` environment variable. - The Azure VM Resource Detector sets the following Resource Attributes according to the response from the `Azure Metadata Service `_: * ``azure.vm.scaleset.name`` set to the value of the ``vmScaleSetName`` field. * ``azure.vm.sku`` set to the value of the ``sku`` field. @@ -84,6 +75,16 @@ The Azure VM Resource Detector sets the following Resource Attributes according * ``os.version`` set to the value of the ``version`` field. * ``service.instance.id`` set to the value of the ``vmId`` field. +The Azure Functions Resource Detector is currently experimental. It sets the following Resource Attributes: + * ``service.name`` set to the value of the ``WEBSITE_SITE_NAME`` environment variable. + * ``process.id`` set to the process ID collected from the running process. + * ``cloud.platform`` set to ``azure_functions``. + * ``cloud.provider`` set to ``azure``. + * ``cloud.resource_id`` set using the ``WEBSITE_RESOURCE_GROUP``, ``WEBSITE_OWNER_NAME``, and ``WEBSITE_SITE_NAME`` environment variables. + * ``cloud.region`` set to the value of the ``REGION_NAME`` environment variable. + * ``faas.instance`` set to the value of the ``WEBSITE_INSTANCE_ID`` environment variable. + * ``faas.max_memory`` set to the value of the ``WEBSITE_MEMORY_LIMIT_MB`` environment variable. + For more information, see the `Semantic Conventions for Cloud Resource Attributes `_. References From da75015fade9f8adf58416fdeb8684a4a263d7b8 Mon Sep 17 00:00:00 2001 From: Adin Hodovic Date: Thu, 23 May 2024 11:02:46 +0200 Subject: [PATCH 12/56] fix: Ensure compability with Psycopg3 to extract libpq build version (#2500) * fix: Ensure compability with Psycopg3 to extract libpq build version Struggling with getting dbapi and psycopg3 working. Think this is the error, __libpq_version does not exist on psycopg3 https://github.com/psycopg/psycopg/blob/master/psycopg/psycopg/pq/pq_ctypes.py#L1220 * docs: Add changelog entry * docs: Fix spelling --------- Co-authored-by: Riccardo Magliocchetti Co-authored-by: Shalev Roda <65566801+shalevr@users.noreply.github.com> --- CHANGELOG.md | 4 +-- .../instrumentation/dbapi/__init__.py | 9 ++++++- .../tests/test_dbapi_integration.py | 26 +++++++++++++++++++ 3 files changed, 36 insertions(+), 3 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index b963cfddc2..038706f35c 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -39,6 +39,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ### Fixed +- `opentelemetry-instrumentation-dbapi` Fix compatibility with Psycopg3 to extract libpq build version (#2500)[https://github.com/open-telemetry/opentelemetry-python-contrib/pull/2500] - `opentelemetry-instrumentation-grpc` AioClientInterceptor should propagate with a Metadata object ([#2363](https://github.com/open-telemetry/opentelemetry-python-contrib/pull/2363)) - `opentelemetry-instrumentation-boto3sqs` Instrument Session and resource @@ -126,7 +127,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ([#1959](https://github.com/open-telemetry/opentelemetry-python-contrib/pull/1959)) - `opentelemetry-resource-detector-azure` Added dependency for Cloud Resource ID attribute ([#2072](https://github.com/open-telemetry/opentelemetry-python-contrib/pull/2072)) - + ## Version 1.21.0/0.42b0 (2023-11-01) ### Added @@ -1540,4 +1541,3 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 - `opentelemetry-resource-detector-azure` Suppress instrumentation for `urllib` call ([#2178](https://github.com/open-telemetry/opentelemetry-python-contrib/pull/2178)) - AwsLambdaInstrumentor handles and re-raises function exception ([#2245](https://github.com/open-telemetry/opentelemetry-python-contrib/pull/2245)) - diff --git a/instrumentation/opentelemetry-instrumentation-dbapi/src/opentelemetry/instrumentation/dbapi/__init__.py b/instrumentation/opentelemetry-instrumentation-dbapi/src/opentelemetry/instrumentation/dbapi/__init__.py index b0acbed185..0857d2989b 100644 --- a/instrumentation/opentelemetry-instrumentation-dbapi/src/opentelemetry/instrumentation/dbapi/__init__.py +++ b/instrumentation/opentelemetry-instrumentation-dbapi/src/opentelemetry/instrumentation/dbapi/__init__.py @@ -427,12 +427,19 @@ def traced_execution( if args and self._commenter_enabled: try: args_list = list(args) + if hasattr(self._connect_module, "__libpq_version__"): + libpq_version = self._connect_module.__libpq_version__ + else: + libpq_version = ( + self._connect_module.pq.__build_version__ + ) + commenter_data = { # Psycopg2/framework information "db_driver": f"psycopg2:{self._connect_module.__version__.split(' ')[0]}", "dbapi_threadsafety": self._connect_module.threadsafety, "dbapi_level": self._connect_module.apilevel, - "libpq_version": self._connect_module.__libpq_version__, + "libpq_version": libpq_version, "driver_paramstyle": self._connect_module.paramstyle, } if self._commenter_options.get( diff --git a/instrumentation/opentelemetry-instrumentation-dbapi/tests/test_dbapi_integration.py b/instrumentation/opentelemetry-instrumentation-dbapi/tests/test_dbapi_integration.py index 0d19ce8373..d0835e93e6 100644 --- a/instrumentation/opentelemetry-instrumentation-dbapi/tests/test_dbapi_integration.py +++ b/instrumentation/opentelemetry-instrumentation-dbapi/tests/test_dbapi_integration.py @@ -275,6 +275,32 @@ def test_executemany_comment(self): r"Select 1 /\*dbapi_threadsafety=123,driver_paramstyle='test',libpq_version=123,traceparent='\d{1,2}-[a-zA-Z0-9_]{32}-[a-zA-Z0-9_]{16}-\d{1,2}'\*/;", ) + def test_compatible_build_version_psycopg_psycopg2_libpq(self): + connect_module = mock.MagicMock() + connect_module.__version__ = mock.MagicMock() + connect_module.pq = mock.MagicMock() + connect_module.pq.__build_version__ = 123 + connect_module.apilevel = 123 + connect_module.threadsafety = 123 + connect_module.paramstyle = "test" + + db_integration = dbapi.DatabaseApiIntegration( + "testname", + "testcomponent", + enable_commenter=True, + commenter_options={"db_driver": False, "dbapi_level": False}, + connect_module=connect_module, + ) + mock_connection = db_integration.wrapped_connection( + mock_connect, {}, {} + ) + cursor = mock_connection.cursor() + cursor.executemany("Select 1;") + self.assertRegex( + cursor.query, + r"Select 1 /\*dbapi_threadsafety=123,driver_paramstyle='test',libpq_version=123,traceparent='\d{1,2}-[a-zA-Z0-9_]{32}-[a-zA-Z0-9_]{16}-\d{1,2}'\*/;", + ) + def test_executemany_flask_integration_comment(self): connect_module = mock.MagicMock() connect_module.__version__ = mock.MagicMock() From 66a107fa49fc6d264ae6d690c09c9f04bc4a5dd7 Mon Sep 17 00:00:00 2001 From: Povilas Versockas Date: Fri, 24 May 2024 02:28:50 +0300 Subject: [PATCH 13/56] fix(async-io): return coro when __name__ is not present (#2541) --- .../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 6d82da6cd0..fc1b535270 100644 --- a/instrumentation/opentelemetry-instrumentation-asyncio/src/opentelemetry/instrumentation/asyncio/__init__.py +++ b/instrumentation/opentelemetry-instrumentation-asyncio/src/opentelemetry/instrumentation/asyncio/__init__.py @@ -262,7 +262,7 @@ def trace_item(self, coro_or_future): async def trace_coroutine(self, coro): if not hasattr(coro, "__name__"): - return + return coro start = default_timer() attr = { "type": "coroutine", From 78285a5795db18e25126f1452a92a536a611b1be Mon Sep 17 00:00:00 2001 From: Leighton Chen Date: Fri, 24 May 2024 10:49:18 -0700 Subject: [PATCH 14/56] Pin codespell version to fix builds (#2550) --- tox.ini | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tox.ini b/tox.ini index fecc9e5af7..0f1e8badcc 100644 --- a/tox.ini +++ b/tox.ini @@ -1206,7 +1206,7 @@ commands = basepython: python3 recreate = True deps = - codespell + codespell==2.2.6 commands = codespell From c1a51fde96c0f53ca185c3816be9fe69cba4f528 Mon Sep 17 00:00:00 2001 From: Riccardo Magliocchetti Date: Fri, 24 May 2024 19:57:29 +0200 Subject: [PATCH 15/56] Pre Python 3.12 enablement fixes (#2529) --- .../test-requirements.txt | 2 +- .../tests/test_botocore_dynamodb.py | 12 ++++++------ .../tests/test_utils.py | 2 +- tox.ini | 4 ++-- 4 files changed, 10 insertions(+), 10 deletions(-) diff --git a/instrumentation/opentelemetry-instrumentation-botocore/test-requirements.txt b/instrumentation/opentelemetry-instrumentation-botocore/test-requirements.txt index 9dcf9f9c0d..7c11b1e063 100644 --- a/instrumentation/opentelemetry-instrumentation-botocore/test-requirements.txt +++ b/instrumentation/opentelemetry-instrumentation-botocore/test-requirements.txt @@ -28,7 +28,7 @@ jsonschema==4.21.1 jsonschema-specifications==2023.12.1 junit-xml==1.9 MarkupSafe==2.0.1 -moto==2.2.20 +moto==3.1.19 mpmath==1.3.0 networkx==3.1 packaging==23.2 diff --git a/instrumentation/opentelemetry-instrumentation-botocore/tests/test_botocore_dynamodb.py b/instrumentation/opentelemetry-instrumentation-botocore/tests/test_botocore_dynamodb.py index 1b7f5bb0cb..12ebe8f2b7 100644 --- a/instrumentation/opentelemetry-instrumentation-botocore/tests/test_botocore_dynamodb.py +++ b/instrumentation/opentelemetry-instrumentation-botocore/tests/test_botocore_dynamodb.py @@ -324,14 +324,14 @@ def test_get_item(self): Key={"id": {"S": "1"}}, ConsistentRead=True, AttributesToGet=["id"], - ProjectionExpression="1,2", + ProjectionExpression="PE", ReturnConsumedCapacity="TOTAL", ) span = self.assert_span("GetItem") self.assert_table_names(span, self.default_table_name) self.assert_consistent_read(span, True) - self.assert_projection(span, "1,2") + self.assert_projection(span, "PE") self.assert_consumed_capacity(span, self.default_table_name) @mock_dynamodb2 @@ -390,7 +390,7 @@ def test_query(self): } }, ScanIndexForward=True, - ProjectionExpression="1,2", + ProjectionExpression="PE", ReturnConsumedCapacity="TOTAL", ) @@ -403,7 +403,7 @@ def test_query(self): self.assert_consistent_read(span, True) self.assert_index_name(span, "lsi") self.assert_limit(span, 42) - self.assert_projection(span, "1,2") + self.assert_projection(span, "PE") self.assert_select(span, "ALL_ATTRIBUTES") self.assert_consumed_capacity(span, self.default_table_name) @@ -419,7 +419,7 @@ def test_scan(self): Select="ALL_ATTRIBUTES", TotalSegments=17, Segment=21, - ProjectionExpression="1,2", + ProjectionExpression="PE", ConsistentRead=True, ReturnConsumedCapacity="TOTAL", ) @@ -440,7 +440,7 @@ def test_scan(self): self.assert_consistent_read(span, True) self.assert_index_name(span, "lsi") self.assert_limit(span, 42) - self.assert_projection(span, "1,2") + self.assert_projection(span, "PE") self.assert_select(span, "ALL_ATTRIBUTES") self.assert_consumed_capacity(span, self.default_table_name) diff --git a/instrumentation/opentelemetry-instrumentation-pika/tests/test_utils.py b/instrumentation/opentelemetry-instrumentation-pika/tests/test_utils.py index d651ea64c9..7c0aa7a715 100644 --- a/instrumentation/opentelemetry-instrumentation-pika/tests/test_utils.py +++ b/instrumentation/opentelemetry-instrumentation-pika/tests/test_utils.py @@ -558,7 +558,7 @@ def test_decorate_deque_proxy( self.assertEqual(res, evt) generator_info.pending_events.popleft.assert_called_once() extract.assert_not_called() - context_get_current.not_called() + context_get_current.assert_not_called() context_detach.assert_called_once() context_attach.assert_not_called() get_span.assert_not_called() diff --git a/tox.ini b/tox.ini index 0f1e8badcc..d6fb9eee10 100644 --- a/tox.ini +++ b/tox.ini @@ -1198,8 +1198,8 @@ deps = -r dev-requirements.txt commands = - black --config {toxinidir}/pyproject.toml {{toxinidir}} --diff --check - isort --settings-path {toxinidir}/.isort.cfg {{toxinidir}} --diff --check-only + black --config {toxinidir}/pyproject.toml {toxinidir} --diff --check + isort --settings-path {toxinidir}/.isort.cfg {toxinidir} --diff --check-only flake8 --config {toxinidir}/.flake8 {toxinidir} [testenv:spellcheck] From e6409568c11f5ec1341e85770f2f01dded676d7a Mon Sep 17 00:00:00 2001 From: Riccardo Magliocchetti Date: Fri, 24 May 2024 20:12:53 +0200 Subject: [PATCH 16/56] Reenable pylint broad exception (#2536) --- .pylintrc | 2 +- .../tests/test_aiopg_integration.py | 11 +++++++---- .../tests/mocks/lambda_function.py | 1 + .../tests/test_dbapi_integration.py | 3 +++ .../tests/test_aio_client_interceptor_hooks.py | 4 ++-- .../tests/test_client_interceptor_hooks.py | 4 ++-- .../tests/test_psycopg_integration.py | 6 +++--- .../tests/test_urllib_integration.py | 2 +- 8 files changed, 20 insertions(+), 13 deletions(-) diff --git a/.pylintrc b/.pylintrc index 114dadef75..9f6c80faa9 100644 --- a/.pylintrc +++ b/.pylintrc @@ -492,4 +492,4 @@ min-public-methods=2 # Exceptions that will emit a warning when being caught. Defaults to # "Exception". -overgeneral-exceptions=Exception +overgeneral-exceptions=builtins.Exception diff --git a/instrumentation/opentelemetry-instrumentation-aiopg/tests/test_aiopg_integration.py b/instrumentation/opentelemetry-instrumentation-aiopg/tests/test_aiopg_integration.py index fb76bd0f38..c497ae4564 100644 --- a/instrumentation/opentelemetry-instrumentation-aiopg/tests/test_aiopg_integration.py +++ b/instrumentation/opentelemetry-instrumentation-aiopg/tests/test_aiopg_integration.py @@ -17,6 +17,7 @@ from unittest.mock import MagicMock import aiopg +import psycopg2 import opentelemetry.instrumentation.aiopg from opentelemetry import trace as trace_api @@ -384,7 +385,9 @@ def test_span_failed(self): span.attributes[SpanAttributes.DB_STATEMENT], "Test query" ) self.assertIs(span.status.status_code, trace_api.StatusCode.ERROR) - self.assertEqual(span.status.description, "Exception: Test Exception") + self.assertEqual( + span.status.description, "ProgrammingError: Test Exception" + ) def test_executemany(self): db_integration = AiopgIntegration(self.tracer, "testcomponent") @@ -570,17 +573,17 @@ class MockCursor: # pylint: disable=unused-argument, no-self-use async def execute(self, query, params=None, throw_exception=False): if throw_exception: - raise Exception("Test Exception") + raise psycopg2.ProgrammingError("Test Exception") # pylint: disable=unused-argument, no-self-use async def executemany(self, query, params=None, throw_exception=False): if throw_exception: - raise Exception("Test Exception") + raise psycopg2.ProgrammingError("Test Exception") # pylint: disable=unused-argument, no-self-use async def callproc(self, query, params=None, throw_exception=False): if throw_exception: - raise Exception("Test Exception") + raise psycopg2.ProgrammingError("Test Exception") def close(self): pass diff --git a/instrumentation/opentelemetry-instrumentation-aws-lambda/tests/mocks/lambda_function.py b/instrumentation/opentelemetry-instrumentation-aws-lambda/tests/mocks/lambda_function.py index a878d0f06a..539c896a0b 100644 --- a/instrumentation/opentelemetry-instrumentation-aws-lambda/tests/mocks/lambda_function.py +++ b/instrumentation/opentelemetry-instrumentation-aws-lambda/tests/mocks/lambda_function.py @@ -22,4 +22,5 @@ def rest_api_handler(event, context): def handler_exc(event, context): + # pylint: disable=broad-exception-raised raise Exception("500 internal server error") diff --git a/instrumentation/opentelemetry-instrumentation-dbapi/tests/test_dbapi_integration.py b/instrumentation/opentelemetry-instrumentation-dbapi/tests/test_dbapi_integration.py index d0835e93e6..eb2d628a3a 100644 --- a/instrumentation/opentelemetry-instrumentation-dbapi/tests/test_dbapi_integration.py +++ b/instrumentation/opentelemetry-instrumentation-dbapi/tests/test_dbapi_integration.py @@ -419,11 +419,13 @@ def __init__(self) -> None: # pylint: disable=unused-argument, no-self-use def execute(self, query, params=None, throw_exception=False): if throw_exception: + # pylint: disable=broad-exception-raised raise Exception("Test Exception") # pylint: disable=unused-argument, no-self-use def executemany(self, query, params=None, throw_exception=False): if throw_exception: + # pylint: disable=broad-exception-raised raise Exception("Test Exception") self.query = query self.params = params @@ -431,4 +433,5 @@ def executemany(self, query, params=None, throw_exception=False): # pylint: disable=unused-argument, no-self-use def callproc(self, query, params=None, throw_exception=False): if throw_exception: + # pylint: disable=broad-exception-raised raise Exception("Test Exception") diff --git a/instrumentation/opentelemetry-instrumentation-grpc/tests/test_aio_client_interceptor_hooks.py b/instrumentation/opentelemetry-instrumentation-grpc/tests/test_aio_client_interceptor_hooks.py index fe906b26c1..9086d8b0f7 100644 --- a/instrumentation/opentelemetry-instrumentation-grpc/tests/test_aio_client_interceptor_hooks.py +++ b/instrumentation/opentelemetry-instrumentation-grpc/tests/test_aio_client_interceptor_hooks.py @@ -47,11 +47,11 @@ def response_hook(span, response): def request_hook_with_exception(_span, _request): - raise Exception() + raise Exception() # pylint: disable=broad-exception-raised def response_hook_with_exception(_span, _response): - raise Exception() + raise Exception() # pylint: disable=broad-exception-raised @pytest.mark.asyncio diff --git a/instrumentation/opentelemetry-instrumentation-grpc/tests/test_client_interceptor_hooks.py b/instrumentation/opentelemetry-instrumentation-grpc/tests/test_client_interceptor_hooks.py index aeecffc71c..ac65c76c34 100644 --- a/instrumentation/opentelemetry-instrumentation-grpc/tests/test_client_interceptor_hooks.py +++ b/instrumentation/opentelemetry-instrumentation-grpc/tests/test_client_interceptor_hooks.py @@ -73,11 +73,11 @@ def response_hook(span, response): def request_hook_with_exception(_span, _request): - raise Exception() + raise Exception() # pylint: disable=broad-exception-raised def response_hook_with_exception(_span, _response): - raise Exception() + raise Exception() # pylint: disable=broad-exception-raised class TestHooks(TestBase): diff --git a/instrumentation/opentelemetry-instrumentation-psycopg/tests/test_psycopg_integration.py b/instrumentation/opentelemetry-instrumentation-psycopg/tests/test_psycopg_integration.py index 4fbcac6042..e2b3ed917a 100644 --- a/instrumentation/opentelemetry-instrumentation-psycopg/tests/test_psycopg_integration.py +++ b/instrumentation/opentelemetry-instrumentation-psycopg/tests/test_psycopg_integration.py @@ -53,17 +53,17 @@ def __init__(self, *args, **kwargs): # pylint: disable=unused-argument, no-self-use async def execute(self, query, params=None, throw_exception=False): if throw_exception: - raise Exception("Test Exception") + raise psycopg.Error("Test Exception") # pylint: disable=unused-argument, no-self-use async def executemany(self, query, params=None, throw_exception=False): if throw_exception: - raise Exception("Test Exception") + raise psycopg.Error("Test Exception") # pylint: disable=unused-argument, no-self-use async def callproc(self, query, params=None, throw_exception=False): if throw_exception: - raise Exception("Test Exception") + raise psycopg.Error("Test Exception") async def __aenter__(self, *args, **kwargs): return self diff --git a/instrumentation/opentelemetry-instrumentation-urllib/tests/test_urllib_integration.py b/instrumentation/opentelemetry-instrumentation-urllib/tests/test_urllib_integration.py index 36189e12c1..f73f0d1b97 100644 --- a/instrumentation/opentelemetry-instrumentation-urllib/tests/test_urllib_integration.py +++ b/instrumentation/opentelemetry-instrumentation-urllib/tests/test_urllib_integration.py @@ -99,7 +99,7 @@ def timeout_exception_callback(*_, **__): @staticmethod def base_exception_callback(*_, **__): - raise Exception("test") + raise Exception("test") # pylint: disable=broad-exception-raised def assert_span(self, exporter=None, num_spans=1): if exporter is None: From 65b4f850a03135bff18a95e62465da881c25f0ec Mon Sep 17 00:00:00 2001 From: Tim Hutchinson Date: Fri, 24 May 2024 15:06:53 -0400 Subject: [PATCH 17/56] Preserve brackets around literal IPv6 hosts (#2552) --- CHANGELOG.md | 1 + .../src/opentelemetry/util/http/__init__.py | 6 +---- .../tests/test_remove_credentials.py | 27 +++++++++++++++++++ 3 files changed, 29 insertions(+), 5 deletions(-) create mode 100644 util/opentelemetry-util-http/tests/test_remove_credentials.py diff --git a/CHANGELOG.md b/CHANGELOG.md index 038706f35c..3232e6fef8 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -56,6 +56,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ([#2420](https://github.com/open-telemetry/opentelemetry-python-contrib/pull/2420)) - `opentelemetry-instrumentation-asyncio` Check for __name__ attribute in the coroutine ([#2521](https://github.com/open-telemetry/opentelemetry-python-contrib/pull/2521)) +- `opentelemetry-util-http` Preserve brackets around literal IPv6 hosts ([#2552](https://github.com/open-telemetry/opentelemetry-python-contrib/pull/2552)) ## Version 1.24.0/0.45b0 (2024-03-28) diff --git a/util/opentelemetry-util-http/src/opentelemetry/util/http/__init__.py b/util/opentelemetry-util-http/src/opentelemetry/util/http/__init__.py index 1f7ce98937..e8a2cf2034 100644 --- a/util/opentelemetry-util-http/src/opentelemetry/util/http/__init__.py +++ b/util/opentelemetry-util-http/src/opentelemetry/util/http/__init__.py @@ -166,11 +166,7 @@ def remove_url_credentials(url: str) -> str: parsed = urlparse(url) if all([parsed.scheme, parsed.netloc]): # checks for valid url parsed_url = urlparse(url) - netloc = ( - (":".join(((parsed_url.hostname or ""), str(parsed_url.port)))) - if parsed_url.port - else (parsed_url.hostname or "") - ) + _, _, netloc = parsed.netloc.rpartition("@") return urlunparse( ( parsed_url.scheme, diff --git a/util/opentelemetry-util-http/tests/test_remove_credentials.py b/util/opentelemetry-util-http/tests/test_remove_credentials.py new file mode 100644 index 0000000000..b6243145f5 --- /dev/null +++ b/util/opentelemetry-util-http/tests/test_remove_credentials.py @@ -0,0 +1,27 @@ +import unittest + +from opentelemetry.util.http import remove_url_credentials + + +class TestRemoveUrlCredentials(unittest.TestCase): + def test_remove_no_credentials(self): + url = "http://opentelemetry.io:8080/test/path?query=value" + cleaned_url = remove_url_credentials(url) + self.assertEqual(cleaned_url, url) + + def test_remove_credentials(self): + url = "http://someuser:somepass@opentelemetry.io:8080/test/path?query=value" + cleaned_url = remove_url_credentials(url) + self.assertEqual( + cleaned_url, "http://opentelemetry.io:8080/test/path?query=value" + ) + + def test_remove_credentials_ipv4_literal(self): + url = "http://someuser:somepass@127.0.0.1:8080/test/path?query=value" + cleaned_url = remove_url_credentials(url) + self.assertEqual(cleaned_url, "http://127.0.0.1:8080/test/path?query=value") + + def test_remove_credentials_ipv6_literal(self): + url = "http://someuser:somepass@[::1]:8080/test/path?query=value" + cleaned_url = remove_url_credentials(url) + self.assertEqual(cleaned_url, "http://[::1]:8080/test/path?query=value") From eb8e45695e88510a611d2cc04f14cdf56036968a Mon Sep 17 00:00:00 2001 From: Riccardo Magliocchetti Date: Fri, 24 May 2024 22:13:37 +0200 Subject: [PATCH 18/56] elasticsearch: don't produce spans if native elasticsearch support is enabled (#2524) --- CHANGELOG.md | 3 ++ .../instrumentation/elasticsearch/__init__.py | 27 +++++++++++++- .../test-requirements-2.txt | 6 ++-- .../tests/test_elasticsearch.py | 35 +++++++++++++++++-- tox.ini | 2 +- 5 files changed, 66 insertions(+), 7 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 3232e6fef8..a75e1537cc 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -54,10 +54,13 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ([#2474](https://github.com/open-telemetry/opentelemetry-python-contrib/pull/2474)) - `opentelemetry-instrumentation-elasticsearch` Improved support for version 8 ([#2420](https://github.com/open-telemetry/opentelemetry-python-contrib/pull/2420)) +- `opentelemetry-instrumentation-elasticsearch` Disabling instrumentation with native OTel support enabled + ([#2524](https://github.com/open-telemetry/opentelemetry-python-contrib/pull/2524)) - `opentelemetry-instrumentation-asyncio` Check for __name__ attribute in the coroutine ([#2521](https://github.com/open-telemetry/opentelemetry-python-contrib/pull/2521)) - `opentelemetry-util-http` Preserve brackets around literal IPv6 hosts ([#2552](https://github.com/open-telemetry/opentelemetry-python-contrib/pull/2552)) + ## Version 1.24.0/0.45b0 (2024-03-28) ### Added diff --git a/instrumentation/opentelemetry-instrumentation-elasticsearch/src/opentelemetry/instrumentation/elasticsearch/__init__.py b/instrumentation/opentelemetry-instrumentation-elasticsearch/src/opentelemetry/instrumentation/elasticsearch/__init__.py index acf4596fb0..f8d7920e20 100644 --- a/instrumentation/opentelemetry-instrumentation-elasticsearch/src/opentelemetry/instrumentation/elasticsearch/__init__.py +++ b/instrumentation/opentelemetry-instrumentation-elasticsearch/src/opentelemetry/instrumentation/elasticsearch/__init__.py @@ -16,6 +16,15 @@ This library allows tracing HTTP elasticsearch made by the `elasticsearch `_ library. +.. warning:: + The elasticsearch package got native OpenTelemetry support since version + `8.13 `_. + To avoid duplicated tracing this instrumentation disables itself if it finds an elasticsearch client + that has OpenTelemetry support enabled. + + Please be aware that the two libraries may use a different semantic convention, see + `elasticsearch documentation `_. + Usage ----- @@ -54,7 +63,7 @@ def response_hook(span: Span, response: dict) for example: -.. code: python +.. code-block: python from opentelemetry.instrumentation.elasticsearch import ElasticsearchInstrumentor import elasticsearch @@ -81,6 +90,7 @@ def response_hook(span, response): """ import re +import warnings from logging import getLogger from os import environ from typing import Collection @@ -197,6 +207,16 @@ def _wrap_perform_request( ): # pylint: disable=R0912,R0914 def wrapper(wrapped, _, args, kwargs): + # if wrapped elasticsearch has native OTel instrumentation just call the wrapped function + otel_span = kwargs.get("otel_span") + if otel_span and otel_span.otel_span: + warnings.warn( + "Instrumentation disabled, relying on elasticsearch native OTel support, see " + "https://opentelemetry-python-contrib.readthedocs.io/en/latest/instrumentation/elasticsearch/elasticsearch.html", + Warning, + ) + return wrapped(*args, **kwargs) + method = url = None try: method, url, *_ = args @@ -249,6 +269,11 @@ def normalize_kwargs(k, v): v = str(v) elif isinstance(v, elastic_transport.HttpHeaders): v = dict(v) + elif isinstance( + v, elastic_transport.OpenTelemetrySpan + ): + # the transport Span is always a dummy one + v = None return (k, v) hook_kwargs = dict( diff --git a/instrumentation/opentelemetry-instrumentation-elasticsearch/test-requirements-2.txt b/instrumentation/opentelemetry-instrumentation-elasticsearch/test-requirements-2.txt index 23d87f93dd..6b0d677ec7 100644 --- a/instrumentation/opentelemetry-instrumentation-elasticsearch/test-requirements-2.txt +++ b/instrumentation/opentelemetry-instrumentation-elasticsearch/test-requirements-2.txt @@ -1,9 +1,9 @@ asgiref==3.7.2 attrs==23.2.0 Deprecated==1.2.14 -elasticsearch==8.12.1 -elasticsearch-dsl==8.12.0 -elastic-transport==8.12.0 +elasticsearch==8.13.1 +elasticsearch-dsl==8.13.1 +elastic-transport==8.13.0 importlib-metadata==6.11.0 iniconfig==2.0.0 packaging==23.2 diff --git a/instrumentation/opentelemetry-instrumentation-elasticsearch/tests/test_elasticsearch.py b/instrumentation/opentelemetry-instrumentation-elasticsearch/tests/test_elasticsearch.py index b0ee170329..b7e24d87c9 100644 --- a/instrumentation/opentelemetry-instrumentation-elasticsearch/tests/test_elasticsearch.py +++ b/instrumentation/opentelemetry-instrumentation-elasticsearch/tests/test_elasticsearch.py @@ -23,6 +23,7 @@ import elasticsearch.exceptions from elasticsearch import Elasticsearch from elasticsearch_dsl import Search +from pytest import mark import opentelemetry.instrumentation.elasticsearch from opentelemetry import trace @@ -36,7 +37,7 @@ from . import sanitization_queries # pylint: disable=no-name-in-module -major_version = elasticsearch.VERSION[0] +major_version, minor_version = elasticsearch.VERSION[:2] if major_version == 8: from . import helpers_es8 as helpers # pylint: disable=no-name-in-module @@ -70,6 +71,9 @@ def get_elasticsearch_client(*args, **kwargs): @mock.patch(helpers.perform_request_mock_path) +@mock.patch.dict( + os.environ, {"OTEL_PYTHON_INSTRUMENTATION_ELASTICSEARCH_ENABLED": "false"} +) class TestElasticsearchIntegration(TestBase): search_attributes = { SpanAttributes.DB_SYSTEM: "elasticsearch", @@ -110,7 +114,6 @@ def test_instrumentor(self, request_mock): span = spans_list[0] # Check version and name in span's instrumentation info - # self.assertEqualSpanInstrumentationInfo(span, opentelemetry.instrumentation.elasticsearch) self.assertEqualSpanInstrumentationInfo( span, opentelemetry.instrumentation.elasticsearch ) @@ -475,6 +478,7 @@ def request_hook(span, method, url, kwargs): "headers": { "accept": "application/vnd.elasticsearch+json; compatible-with=8" }, + "otel_span": None, } elif major_version == 7: expected_kwargs = { @@ -607,3 +611,30 @@ def test_bulk(self, request_mock): self.assertEqualSpanInstrumentationInfo( span, opentelemetry.instrumentation.elasticsearch ) + + @mark.skipif( + (major_version, minor_version) < (8, 13), + reason="Native OTel since elasticsearch 8.13", + ) + @mock.patch.dict( + os.environ, + {"OTEL_PYTHON_INSTRUMENTATION_ELASTICSEARCH_ENABLED": "true"}, + ) + def test_instrumentation_is_disabled_if_native_support_enabled( + self, request_mock + ): + request_mock.return_value = helpers.mock_response("{}") + + es = get_elasticsearch_client(hosts=["http://localhost:9200"]) + es.index( + index="sw", + id=1, + **normalize_arguments(body={"name": "adam"}, doc_type="_doc"), + ) + + spans_list = self.get_finished_spans() + self.assertEqual(len(spans_list), 1) + span = spans_list[0] + + # Check that name in span's instrumentation info is not from this instrumentation + self.assertEqual(span.instrumentation_info.name, "elasticsearch-api") diff --git a/tox.ini b/tox.ini index d6fb9eee10..a014306640 100644 --- a/tox.ini +++ b/tox.ini @@ -92,7 +92,7 @@ envlist = ; below mean these dependencies are being used: ; 0: elasticsearch-dsl==6.4.0 elasticsearch==6.8.2 ; 1: elasticsearch-dsl==7.4.1 elasticsearch==7.17.9 - ; 2: elasticsearch-dsl>=8.0,<8.13 elasticsearch>=8.0,<8.13 + ; 2: elasticsearch-dsl==8.13.1 elasticsearch==8.13.1 py3{8,9,10,11}-test-instrumentation-elasticsearch-{0,1,2} pypy3-test-instrumentation-elasticsearch-{0,1,2} lint-instrumentation-elasticsearch From 88111d0a8381bdc440c660b7e802dc951607392a Mon Sep 17 00:00:00 2001 From: Martin Stolle <121817095+stollero@users.noreply.github.com> Date: Tue, 28 May 2024 20:34:28 +0200 Subject: [PATCH 19/56] fix(requests): Fix wrong time unit for duration histogram (#2553) --- CHANGELOG.md | 3 ++- .../src/opentelemetry/instrumentation/requests/__init__.py | 4 +--- 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index a75e1537cc..7ba8e6d3e2 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -58,9 +58,10 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ([#2524](https://github.com/open-telemetry/opentelemetry-python-contrib/pull/2524)) - `opentelemetry-instrumentation-asyncio` Check for __name__ attribute in the coroutine ([#2521](https://github.com/open-telemetry/opentelemetry-python-contrib/pull/2521)) +- `opentelemetry-instrumentation-requests` Fix wrong time unit for duration histogram + ([#2553](https://github.com/open-telemetry/opentelemetry-python-contrib/pull/2553)) - `opentelemetry-util-http` Preserve brackets around literal IPv6 hosts ([#2552](https://github.com/open-telemetry/opentelemetry-python-contrib/pull/2552)) - ## Version 1.24.0/0.45b0 (2024-03-28) ### Added 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 12797d6f5e..8c54482a46 100644 --- a/instrumentation/opentelemetry-instrumentation-requests/src/opentelemetry/instrumentation/requests/__init__.py +++ b/instrumentation/opentelemetry-instrumentation-requests/src/opentelemetry/instrumentation/requests/__init__.py @@ -229,9 +229,7 @@ def get_or_create_headers(): exception = exc result = getattr(exc, "response", None) finally: - elapsed_time = max( - round((default_timer() - start_time) * 1000), 0 - ) + elapsed_time = max(default_timer() - start_time, 0) if isinstance(result, Response): span_attributes = {} From 59a737c285f7e3b0e3901781d805f6ecdad41e45 Mon Sep 17 00:00:00 2001 From: Mike Goldsmith Date: Tue, 28 May 2024 19:49:00 +0100 Subject: [PATCH 20/56] Add key predicate to baggage span processor (#2535) * Add key predicate to baggage span processor * add changelog entry * fix linting * more linter fixes --------- Co-authored-by: Diego Hurtado --- CHANGELOG.md | 2 + .../README.rst | 29 +++++++ .../processor/baggage/__init__.py | 4 +- .../processor/baggage/processor.py | 15 +++- .../tests/test_baggage_processor.py | 86 ++++++++++++++++++- 5 files changed, 126 insertions(+), 10 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 7ba8e6d3e2..6876e2cf9e 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -36,6 +36,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ([#2397](https://github.com/open-telemetry/opentelemetry-python-contrib/pull/2397))) - `opentelemetry-processor-baggage` Initial release ([#2436](https://github.com/open-telemetry/opentelemetry-python-contrib/pull/2436)) +- `opentelemetry-processor-baggage` Add baggage key predicate + ([#2535](https://github.com/open-telemetry/opentelemetry-python-contrib/pull/2535)) ### Fixed diff --git a/processor/opentelemetry-processor-baggage/README.rst b/processor/opentelemetry-processor-baggage/README.rst index 2768758a99..a111166cef 100644 --- a/processor/opentelemetry-processor-baggage/README.rst +++ b/processor/opentelemetry-processor-baggage/README.rst @@ -20,3 +20,32 @@ Do not put sensitive information in Baggage. To repeat: a consequence of adding data to Baggage is that the keys and values will appear in all outgoing HTTP headers from the application. + +## Usage + +Add the span processor when configuring the tracer provider. + +To configure the span processor to copy all baggage entries during configuration: + +```python +from opentelemetry.processor.baggage import BaggageSpanProcessor, ALLOW_ALL_BAGGAGE_KEYS + +tracer_provider = TracerProvider() +tracer_provider.add_span_processor(BaggageSpanProcessor(ALLOW_ALL_BAGGAGE_KEYS)) +``` + +Alternatively, you can provide a custom baggage key predicate to select which baggage keys you want to copy. + +For example, to only copy baggage entries that start with `my-key`: + +```python +starts_with_predicate = lambda baggage_key: baggage_key.startswith("my-key") +tracer_provider.add_span_processor(BaggageSpanProcessor(starts_with_predicate)) +``` + +For example, to only copy baggage entries that match the regex `^key.+`: + +```python +regex_predicate = lambda baggage_key: baggage_key.startswith("^key.+") +tracer_provider.add_span_processor(BaggageSpanProcessor(regex_predicate)) +``` \ No newline at end of file diff --git a/processor/opentelemetry-processor-baggage/src/opentelemetry/processor/baggage/__init__.py b/processor/opentelemetry-processor-baggage/src/opentelemetry/processor/baggage/__init__.py index a740c66491..fcff749d64 100644 --- a/processor/opentelemetry-processor-baggage/src/opentelemetry/processor/baggage/__init__.py +++ b/processor/opentelemetry-processor-baggage/src/opentelemetry/processor/baggage/__init__.py @@ -14,7 +14,7 @@ # pylint: disable=import-error -from .processor import BaggageSpanProcessor +from .processor import ALLOW_ALL_BAGGAGE_KEYS, BaggageSpanProcessor from .version import __version__ -__all__ = ["BaggageSpanProcessor", "__version__"] +__all__ = ["ALLOW_ALL_BAGGAGE_KEYS", "BaggageSpanProcessor", "__version__"] diff --git a/processor/opentelemetry-processor-baggage/src/opentelemetry/processor/baggage/processor.py b/processor/opentelemetry-processor-baggage/src/opentelemetry/processor/baggage/processor.py index 36df06a94c..d14cf3a7e6 100644 --- a/processor/opentelemetry-processor-baggage/src/opentelemetry/processor/baggage/processor.py +++ b/processor/opentelemetry-processor-baggage/src/opentelemetry/processor/baggage/processor.py @@ -12,13 +12,19 @@ # See the License for the specific language governing permissions and # limitations under the License. -from typing import Optional +from typing import Callable, Optional from opentelemetry.baggage import get_all as get_all_baggage from opentelemetry.context import Context from opentelemetry.sdk.trace.export import SpanProcessor from opentelemetry.trace import Span +# A BaggageKeyPredicate is a function that takes a baggage key and returns a boolean +BaggageKeyPredicateT = Callable[[str], bool] + +# A BaggageKeyPredicate that always returns True, allowing all baggage keys to be added to spans +ALLOW_ALL_BAGGAGE_KEYS: BaggageKeyPredicateT = lambda _: True + class BaggageSpanProcessor(SpanProcessor): """ @@ -44,12 +50,13 @@ class BaggageSpanProcessor(SpanProcessor): """ - def __init__(self) -> None: - pass + def __init__(self, baggage_key_predicate: BaggageKeyPredicateT) -> None: + self._baggage_key_predicate = baggage_key_predicate def on_start( self, span: "Span", parent_context: Optional[Context] = None ) -> None: baggage = get_all_baggage(parent_context) for key, value in baggage.items(): - span.set_attribute(key, value) + if self._baggage_key_predicate(key): + span.set_attribute(key, value) diff --git a/processor/opentelemetry-processor-baggage/tests/test_baggage_processor.py b/processor/opentelemetry-processor-baggage/tests/test_baggage_processor.py index 63a71c3cba..fb89ef5eb1 100644 --- a/processor/opentelemetry-processor-baggage/tests/test_baggage_processor.py +++ b/processor/opentelemetry-processor-baggage/tests/test_baggage_processor.py @@ -12,12 +12,16 @@ # See the License for the specific language governing permissions and # limitations under the License. +import re import unittest from opentelemetry.baggage import get_all as get_all_baggage from opentelemetry.baggage import set_baggage from opentelemetry.context import attach, detach -from opentelemetry.processor.baggage import BaggageSpanProcessor +from opentelemetry.processor.baggage import ( + ALLOW_ALL_BAGGAGE_KEYS, + BaggageSpanProcessor, +) from opentelemetry.sdk.trace import TracerProvider from opentelemetry.sdk.trace.export import SpanProcessor from opentelemetry.trace import Span, Tracer @@ -25,13 +29,77 @@ class BaggageSpanProcessorTest(unittest.TestCase): def test_check_the_baggage(self): - self.assertIsInstance(BaggageSpanProcessor(), SpanProcessor) + self.assertIsInstance( + BaggageSpanProcessor(ALLOW_ALL_BAGGAGE_KEYS), SpanProcessor + ) def test_set_baggage_attaches_to_child_spans_and_detaches_properly_with_context( self, ): tracer_provider = TracerProvider() - tracer_provider.add_span_processor(BaggageSpanProcessor()) + tracer_provider.add_span_processor( + BaggageSpanProcessor(ALLOW_ALL_BAGGAGE_KEYS) + ) + + # tracer has no baggage to start + tracer = tracer_provider.get_tracer("my-tracer") + self.assertIsInstance(tracer, Tracer) + self.assertEqual(get_all_baggage(), {}) + # set baggage in context + ctx = set_baggage("queen", "bee") + with tracer.start_as_current_span( + name="bumble", context=ctx + ) as bumble_span: + # span should have baggage key-value pair in context + self.assertEqual(get_all_baggage(ctx), {"queen": "bee"}) + # span should have baggage key-value pair in attribute + self.assertEqual(bumble_span._attributes["queen"], "bee") + with tracer.start_as_current_span( + name="child_span", context=ctx + ) as child_span: + self.assertIsInstance(child_span, Span) + # child span should have baggage key-value pair in context + self.assertEqual(get_all_baggage(ctx), {"queen": "bee"}) + # child span should have baggage key-value pair in attribute + self.assertEqual(child_span._attributes["queen"], "bee") + + def test_baggage_span_processor_with_string_prefix( + self, + ): + tracer_provider = TracerProvider() + tracer_provider.add_span_processor( + BaggageSpanProcessor(self.has_prefix) + ) + + # tracer has no baggage to start + tracer = tracer_provider.get_tracer("my-tracer") + self.assertIsInstance(tracer, Tracer) + self.assertEqual(get_all_baggage(), {}) + # set baggage in context + ctx = set_baggage("queen", "bee") + with tracer.start_as_current_span( + name="bumble", context=ctx + ) as bumble_span: + # span should have baggage key-value pair in context + self.assertEqual(get_all_baggage(ctx), {"queen": "bee"}) + # span should have baggage key-value pair in attribute + self.assertEqual(bumble_span._attributes["queen"], "bee") + with tracer.start_as_current_span( + name="child_span", context=ctx + ) as child_span: + self.assertIsInstance(child_span, Span) + # child span should have baggage key-value pair in context + self.assertEqual(get_all_baggage(ctx), {"queen": "bee"}) + # child span should have baggage key-value pair in attribute + self.assertEqual(child_span._attributes["queen"], "bee") + + def test_baggage_span_processor_with_regex( + self, + ): + tracer_provider = TracerProvider() + tracer_provider.add_span_processor( + BaggageSpanProcessor(self.matches_regex) + ) # tracer has no baggage to start tracer = tracer_provider.get_tracer("my-tracer") @@ -59,7 +127,9 @@ def test_set_baggage_attaches_to_child_spans_and_detaches_properly_with_token( self, ): tracer_provider = TracerProvider() - tracer_provider.add_span_processor(BaggageSpanProcessor()) + tracer_provider.add_span_processor( + BaggageSpanProcessor(ALLOW_ALL_BAGGAGE_KEYS) + ) # tracer has no baggage to start tracer = tracer_provider.get_tracer("my-tracer") @@ -87,3 +157,11 @@ def test_set_baggage_attaches_to_child_spans_and_detaches_properly_with_token( detach(moar_token) detach(honey_token) self.assertEqual(get_all_baggage(), {}) + + @staticmethod + def has_prefix(baggage_key: str) -> bool: + return baggage_key.startswith("que") + + @staticmethod + def matches_regex(baggage_key: str) -> bool: + return re.match(r"que.*", baggage_key) is not None From ac97b004571474f22e06a46b0e056e48900b607e Mon Sep 17 00:00:00 2001 From: Riccardo Magliocchetti Date: Tue, 28 May 2024 23:31:44 +0200 Subject: [PATCH 21/56] Fix typos in test names (#2558) --- .../tests/test_fastapi_instrumentation.py | 2 +- .../tests/test_automatic.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/instrumentation/opentelemetry-instrumentation-fastapi/tests/test_fastapi_instrumentation.py b/instrumentation/opentelemetry-instrumentation-fastapi/tests/test_fastapi_instrumentation.py index 4269dfa2e4..f9261ad5db 100644 --- a/instrumentation/opentelemetry-instrumentation-fastapi/tests/test_fastapi_instrumentation.py +++ b/instrumentation/opentelemetry-instrumentation-fastapi/tests/test_fastapi_instrumentation.py @@ -279,7 +279,7 @@ def test_basic_post_request_metric_success(self): if isinstance(point, NumberDataPoint): self.assertEqual(point.value, 0) - def test_metric_uninstruemnt_app(self): + def test_metric_uninstrument_app(self): self._client.get("/foobar") self._instrumentor.uninstrument_app(self._app) self._client.get("/foobar") diff --git a/instrumentation/opentelemetry-instrumentation-pyramid/tests/test_automatic.py b/instrumentation/opentelemetry-instrumentation-pyramid/tests/test_automatic.py index 4715e0b461..7b48e16e17 100644 --- a/instrumentation/opentelemetry-instrumentation-pyramid/tests/test_automatic.py +++ b/instrumentation/opentelemetry-instrumentation-pyramid/tests/test_automatic.py @@ -245,7 +245,7 @@ def test_basic_metric_success(self): ) self.assertEqual(point.value, 0) - def test_metric_uninstruemnt(self): + def test_metric_uninstrument(self): self.client.get("/hello/756") PyramidInstrumentor().uninstrument() self.config = Configurator() From f7cef147390fd39070630ac3730f3a6475a05e34 Mon Sep 17 00:00:00 2001 From: Riccardo Magliocchetti Date: Tue, 28 May 2024 23:56:38 +0200 Subject: [PATCH 22/56] distro: decouple default configuration test from environment (#2561) --- opentelemetry-distro/tests/test_distro.py | 17 +++++------------ 1 file changed, 5 insertions(+), 12 deletions(-) diff --git a/opentelemetry-distro/tests/test_distro.py b/opentelemetry-distro/tests/test_distro.py index dd8f9c4cc4..ea7b9f08c8 100644 --- a/opentelemetry-distro/tests/test_distro.py +++ b/opentelemetry-distro/tests/test_distro.py @@ -14,7 +14,7 @@ # type: ignore import os -from unittest import TestCase +from unittest import TestCase, mock from pkg_resources import DistributionNotFound, require @@ -33,17 +33,10 @@ def test_package_available(self): except DistributionNotFound: self.fail("opentelemetry-distro not installed") + @mock.patch.dict("os.environ", {}, clear=True) def test_default_configuration(self): distro = OpenTelemetryDistro() - self.assertIsNone(os.environ.get(OTEL_TRACES_EXPORTER)) - self.assertIsNone(os.environ.get(OTEL_METRICS_EXPORTER)) distro.configure() - self.assertEqual( - "otlp", os.environ.get(OTEL_TRACES_EXPORTER) - ) - self.assertEqual( - "otlp", os.environ.get(OTEL_METRICS_EXPORTER) - ) - self.assertEqual( - "grpc", os.environ.get(OTEL_EXPORTER_OTLP_PROTOCOL) - ) + self.assertEqual("otlp", os.environ.get(OTEL_TRACES_EXPORTER)) + self.assertEqual("otlp", os.environ.get(OTEL_METRICS_EXPORTER)) + self.assertEqual("grpc", os.environ.get(OTEL_EXPORTER_OTLP_PROTOCOL)) From 25e429aaf98e0eb43ab907b61940cea9c2b86717 Mon Sep 17 00:00:00 2001 From: Riccardo Magliocchetti Date: Wed, 29 May 2024 01:18:09 +0200 Subject: [PATCH 23/56] instrumentation: revise BaseDistro.load_instrumentor documentation (#2530) --- .../src/opentelemetry/instrumentation/distro.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/opentelemetry-instrumentation/src/opentelemetry/instrumentation/distro.py b/opentelemetry-instrumentation/src/opentelemetry/instrumentation/distro.py index cc1c99c1e0..93646bbb2f 100644 --- a/opentelemetry-instrumentation/src/opentelemetry/instrumentation/distro.py +++ b/opentelemetry-instrumentation/src/opentelemetry/instrumentation/distro.py @@ -50,9 +50,10 @@ def configure(self, **kwargs): def load_instrumentor( # pylint: disable=no-self-use self, entry_point: EntryPoint, **kwargs ): - """Takes a collection of instrumentation entry points - and activates them by instantiating and calling instrument() - on each one. + """Takes an instrumentation entry point and activates it by instantiating + and calling instrument() on it. + This is called for each opentelemetry_instrumentor entry point by auto + instrumentation. Distros can override this method to customize the behavior by inspecting each entry point and configuring them in special ways, From bd9156fff84e4d30592d118aa8ee9e3d5d5499f9 Mon Sep 17 00:00:00 2001 From: Riccardo Magliocchetti Date: Wed, 29 May 2024 17:56:27 +0200 Subject: [PATCH 24/56] Remove unrelated packages from test requirements (#2559) * botocore: remove random packages from test-requirements Refs #1736 * boto: remove random packages from test requirements Refs #1736 * tox: re-enable boto3sqs tests with pypy3 * threading: remove confluent-kafka from test requirements --- .../test-requirements.txt | 34 ++----------------- .../test-requirements.txt | 30 +--------------- .../test-requirements.txt | 1 - tox.ini | 3 +- 4 files changed, 4 insertions(+), 64 deletions(-) diff --git a/instrumentation/opentelemetry-instrumentation-boto/test-requirements.txt b/instrumentation/opentelemetry-instrumentation-boto/test-requirements.txt index 92c356ebe1..4f8c5d2b67 100644 --- a/instrumentation/opentelemetry-instrumentation-boto/test-requirements.txt +++ b/instrumentation/opentelemetry-instrumentation-boto/test-requirements.txt @@ -1,69 +1,39 @@ -annotated-types==0.6.0 asgiref==3.7.2 attrs==23.2.0 -aws-sam-translator==1.85.0 -aws-xray-sdk==2.12.1 boto==2.49.0 boto3==1.34.44 botocore==1.34.44 certifi==2024.2.2 cffi==1.16.0 -cfn-lint==0.85.2 charset-normalizer==3.3.2 cryptography==42.0.3 Deprecated==1.2.14 docker==7.0.0 -ecdsa==0.18.0 -graphql-core==3.2.3 idna==3.6 importlib-metadata==6.11.0 -importlib-resources==6.1.1 iniconfig==2.0.0 -Jinja2==3.1.3 +Jinja2==3.1.4 jmespath==1.0.1 -jschema-to-python==1.2.3 -jsondiff==2.0.0 -jsonpatch==1.33 -jsonpickle==3.0.2 -jsonpointer==2.4 -jsonschema==4.21.1 -jsonschema-specifications==2023.12.1 -junit-xml==1.9 MarkupSafe==2.1.5 moto==2.3.2 -mpmath==1.3.0 -networkx==3.1 packaging==23.2 -pbr==6.0.0 -pkgutil_resolve_name==1.3.10 pluggy==1.4.0 py==1.11.0 py-cpuinfo==9.0.0 -pyasn1==0.5.1 pycparser==2.21 -pydantic==2.6.1 -pydantic_core==2.16.2 pytest==7.1.3 pytest-benchmark==4.0.0 python-dateutil==2.8.2 -python-jose==3.3.0 pytz==2024.1 PyYAML==6.0.1 -referencing==0.33.0 -regex==2023.12.25 requests==2.31.0 responses==0.25.0 -rpds-py==0.18.0 -rsa==4.9 s3transfer==0.10.0 -sarif-om==1.0.4 six==1.16.0 -sshpubkeys==3.3.1 -sympy==1.12 tomli==2.0.1 typing_extensions==4.9.0 urllib3==1.26.18 -Werkzeug==3.0.1 +Werkzeug==2.1.2 wrapt==1.16.0 xmltodict==0.13.0 zipp==3.17.0 diff --git a/instrumentation/opentelemetry-instrumentation-botocore/test-requirements.txt b/instrumentation/opentelemetry-instrumentation-botocore/test-requirements.txt index 7c11b1e063..7229f0f721 100644 --- a/instrumentation/opentelemetry-instrumentation-botocore/test-requirements.txt +++ b/instrumentation/opentelemetry-instrumentation-botocore/test-requirements.txt @@ -1,63 +1,35 @@ -annotated-types==0.6.0 asgiref==3.7.2 attrs==23.2.0 -aws-sam-translator==1.85.0 aws-xray-sdk==2.12.1 boto3==1.28.80 botocore==1.31.80 certifi==2024.2.2 cffi==1.16.0 -cfn-lint==0.85.2 charset-normalizer==3.3.2 cryptography==42.0.5 Deprecated==1.2.14 docker==7.0.0 -ecdsa==0.18.0 idna==3.6 importlib-metadata==6.11.0 -importlib-resources==6.1.1 iniconfig==2.0.0 -Jinja2==3.1.3 +Jinja2==3.1.4 jmespath==1.0.1 -jschema-to-python==1.2.3 -jsondiff==2.0.0 -jsonpatch==1.33 -jsonpickle==3.0.3 -jsonpointer==2.4 -jsonschema==4.21.1 -jsonschema-specifications==2023.12.1 -junit-xml==1.9 MarkupSafe==2.0.1 moto==3.1.19 -mpmath==1.3.0 -networkx==3.1 packaging==23.2 -pbr==6.0.0 -pkgutil_resolve_name==1.3.10 pluggy==1.4.0 py==1.11.0 py-cpuinfo==9.0.0 -pyasn1==0.5.1 pycparser==2.21 -pydantic==2.6.2 -pydantic_core==2.16.3 pytest==7.1.3 pytest-benchmark==4.0.0 python-dateutil==2.8.2 -python-jose==3.3.0 pytz==2024.1 PyYAML==6.0.1 -referencing==0.33.0 -regex==2023.12.25 requests==2.31.0 responses==0.25.0 -rpds-py==0.18.0 -rsa==4.9 s3transfer==0.7.0 -sarif-om==1.0.4 six==1.16.0 -sshpubkeys==3.3.1 -sympy==1.12 tomli==2.0.1 typing_extensions==4.9.0 urllib3==1.26.18 diff --git a/instrumentation/opentelemetry-instrumentation-threading/test-requirements.txt b/instrumentation/opentelemetry-instrumentation-threading/test-requirements.txt index ffda21f234..4f9b027918 100644 --- a/instrumentation/opentelemetry-instrumentation-threading/test-requirements.txt +++ b/instrumentation/opentelemetry-instrumentation-threading/test-requirements.txt @@ -1,6 +1,5 @@ asgiref==3.7.2 attrs==23.2.0 -confluent-kafka==2.3.0 Deprecated==1.2.14 importlib-metadata==6.11.0 iniconfig==2.0.0 diff --git a/tox.ini b/tox.ini index a014306640..e97476a850 100644 --- a/tox.ini +++ b/tox.ini @@ -54,8 +54,7 @@ envlist = ; opentelemetry-instrumentation-boto3sqs py3{8,9,10,11}-test-instrumentation-boto3sqs - ; FIXME: see https://github.com/open-telemetry/opentelemetry-python-contrib/issues/1736 - ; pypy3-test-instrumentation-boto3sqs + pypy3-test-instrumentation-boto3sqs lint-instrumentation-boto3sqs ; opentelemetry-instrumentation-django From 7bddbb54195be4004275c83ef2592b362e443dc8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Em=C3=ADdio=20Neto?= <9735060+emdneto@users.noreply.github.com> Date: Wed, 29 May 2024 14:17:50 -0300 Subject: [PATCH 25/56] fix: remove dependency on sdk for system-metrics instrumentation (#2557) --- .../pyproject.toml | 1 - .../opentelemetry/instrumentation/system_metrics/__init__.py | 5 ++--- 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/instrumentation/opentelemetry-instrumentation-system-metrics/pyproject.toml b/instrumentation/opentelemetry-instrumentation-system-metrics/pyproject.toml index fe60ca1251..aa2d8083ec 100644 --- a/instrumentation/opentelemetry-instrumentation-system-metrics/pyproject.toml +++ b/instrumentation/opentelemetry-instrumentation-system-metrics/pyproject.toml @@ -26,7 +26,6 @@ classifiers = [ dependencies = [ "opentelemetry-instrumentation == 0.46b0.dev", "opentelemetry-api ~= 1.11", - "opentelemetry-sdk ~= 1.11", "psutil ~= 5.9", ] diff --git a/instrumentation/opentelemetry-instrumentation-system-metrics/src/opentelemetry/instrumentation/system_metrics/__init__.py b/instrumentation/opentelemetry-instrumentation-system-metrics/src/opentelemetry/instrumentation/system_metrics/__init__.py index 74d4f6a431..6342d287d5 100644 --- a/instrumentation/opentelemetry-instrumentation-system-metrics/src/opentelemetry/instrumentation/system_metrics/__init__.py +++ b/instrumentation/opentelemetry-instrumentation-system-metrics/src/opentelemetry/instrumentation/system_metrics/__init__.py @@ -91,7 +91,6 @@ from opentelemetry.instrumentation.system_metrics.package import _instruments from opentelemetry.instrumentation.system_metrics.version import __version__ from opentelemetry.metrics import CallbackOptions, Observation, get_meter -from opentelemetry.sdk.util import get_dict_as_key _logger = logging.getLogger(__name__) @@ -638,8 +637,8 @@ def _get_system_network_connections( net_connection, metric ) - connection_counters_key = get_dict_as_key( - self._system_network_connections_labels + connection_counters_key = tuple( + sorted(self._system_network_connections_labels.items()) ) if connection_counters_key in connection_counters: From 41792e7bb322455705088b18c3a4e1e530fe01c7 Mon Sep 17 00:00:00 2001 From: dferrochio Date: Thu, 30 May 2024 18:27:35 -0300 Subject: [PATCH 26/56] Add confluent kafka producer poll and flush returns (#2527) --- CHANGELOG.md | 1 + .../confluent_kafka/__init__.py | 4 +- .../tests/test_instrumentation.py | 34 ++++++++++++- .../tests/utils.py | 48 ++++++++++++++++++- 4 files changed, 82 insertions(+), 5 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 6876e2cf9e..c9cafd2dc1 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -9,6 +9,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ### Breaking changes +- Add return statement to Confluent kafka Producer poll() and flush() calls when instrumented by ConfluentKafkaInstrumentor().instrument_producer() ([#2527](https://github.com/open-telemetry/opentelemetry-python-contrib/pull/2527)) - Rename `type` attribute to `asgi.event.type` in `opentelemetry-instrumentation-asgi` ([#2300](https://github.com/open-telemetry/opentelemetry-python-contrib/pull/2300)) - Rename AwsLambdaInstrumentor span attributes `faas.id` to `cloud.resource_id`, `faas.execution` to `faas.invocation_id` diff --git a/instrumentation/opentelemetry-instrumentation-confluent-kafka/src/opentelemetry/instrumentation/confluent_kafka/__init__.py b/instrumentation/opentelemetry-instrumentation-confluent-kafka/src/opentelemetry/instrumentation/confluent_kafka/__init__.py index c869d03dd9..30181d39c2 100644 --- a/instrumentation/opentelemetry-instrumentation-confluent-kafka/src/opentelemetry/instrumentation/confluent_kafka/__init__.py +++ b/instrumentation/opentelemetry-instrumentation-confluent-kafka/src/opentelemetry/instrumentation/confluent_kafka/__init__.py @@ -151,10 +151,10 @@ def __init__(self, producer: Producer, tracer: Tracer): self._tracer = tracer def flush(self, timeout=-1): - self._producer.flush(timeout) + return self._producer.flush(timeout) def poll(self, timeout=-1): - self._producer.poll(timeout) + return self._producer.poll(timeout) def produce( self, topic, value=None, *args, **kwargs diff --git a/instrumentation/opentelemetry-instrumentation-confluent-kafka/tests/test_instrumentation.py b/instrumentation/opentelemetry-instrumentation-confluent-kafka/tests/test_instrumentation.py index 21d5bd6f83..205de27733 100644 --- a/instrumentation/opentelemetry-instrumentation-confluent-kafka/tests/test_instrumentation.py +++ b/instrumentation/opentelemetry-instrumentation-confluent-kafka/tests/test_instrumentation.py @@ -31,7 +31,7 @@ ) from opentelemetry.test.test_base import TestBase -from .utils import MockConsumer, MockedMessage +from .utils import MockConsumer, MockedMessage, MockedProducer class TestConfluentKafka(TestBase): @@ -246,3 +246,35 @@ def _compare_spans(self, spans, expected_spans): self.assertEqual( expected_attribute_value, span.attributes[attribute_key] ) + + def test_producer_poll(self) -> None: + instrumentation = ConfluentKafkaInstrumentor() + message_queue = [] + + producer = MockedProducer( + message_queue, + { + "bootstrap.servers": "localhost:29092", + }, + ) + + producer = instrumentation.instrument_producer(producer) + producer.produce(topic="topic-1", key="key-1", value="value-1") + msg = producer.poll() + self.assertIsNotNone(msg) + + def test_producer_flush(self) -> None: + instrumentation = ConfluentKafkaInstrumentor() + message_queue = [] + + producer = MockedProducer( + message_queue, + { + "bootstrap.servers": "localhost:29092", + }, + ) + + producer = instrumentation.instrument_producer(producer) + producer.produce(topic="topic-1", key="key-1", value="value-1") + msg = producer.flush() + self.assertIsNotNone(msg) diff --git a/instrumentation/opentelemetry-instrumentation-confluent-kafka/tests/utils.py b/instrumentation/opentelemetry-instrumentation-confluent-kafka/tests/utils.py index 798daaeff4..92e11798f6 100644 --- a/instrumentation/opentelemetry-instrumentation-confluent-kafka/tests/utils.py +++ b/instrumentation/opentelemetry-instrumentation-confluent-kafka/tests/utils.py @@ -1,4 +1,6 @@ -from confluent_kafka import Consumer +from typing import Optional + +from confluent_kafka import Consumer, Producer class MockConsumer(Consumer): @@ -20,11 +22,21 @@ def poll(self, timeout=None): class MockedMessage: - def __init__(self, topic: str, partition: int, offset: int, headers): + def __init__( + self, + topic: str, + partition: int, + offset: int, + headers, + key: Optional[str] = None, + value: Optional[str] = None, + ): self._topic = topic self._partition = partition self._offset = offset self._headers = headers + self._key = key + self._value = value def topic(self): return self._topic @@ -37,3 +49,35 @@ def offset(self): def headers(self): return self._headers + + def key(self): + return self._key + + def value(self): + return self._value + + +class MockedProducer(Producer): + def __init__(self, queue, config): + self._queue = queue + super().__init__(config) + + def produce( + self, *args, **kwargs + ): # pylint: disable=keyword-arg-before-vararg + self._queue.append( + MockedMessage( + topic=kwargs.get("topic"), + partition=0, + offset=0, + headers=[], + key=kwargs.get("key"), + value=kwargs.get("value"), + ) + ) + + def poll(self, *args, **kwargs): + return len(self._queue) + + def flush(self, *args, **kwargs): + return len(self._queue) From 728976fb10e595a445e0a87be26717d5c069c9a8 Mon Sep 17 00:00:00 2001 From: Alexander Shadchin Date: Fri, 31 May 2024 00:50:53 +0300 Subject: [PATCH 27/56] Fix net peer attribute for unix socket connection (#2493) --- CHANGELOG.md | 1 + .../instrumentation/redis/util.py | 12 +-- .../tests/test_redis.py | 85 +++++++++++++++++++ 3 files changed, 92 insertions(+), 6 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index c9cafd2dc1..17152f3fa7 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -64,6 +64,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 - `opentelemetry-instrumentation-requests` Fix wrong time unit for duration histogram ([#2553](https://github.com/open-telemetry/opentelemetry-python-contrib/pull/2553)) - `opentelemetry-util-http` Preserve brackets around literal IPv6 hosts ([#2552](https://github.com/open-telemetry/opentelemetry-python-contrib/pull/2552)) +- `opentelemetry-util-redis` Fix net peer attribute for unix socket connection ([#2493](https://github.com/open-telemetry/opentelemetry-python-contrib/pull/2493)) ## Version 1.24.0/0.45b0 (2024-03-28) diff --git a/instrumentation/opentelemetry-instrumentation-redis/src/opentelemetry/instrumentation/redis/util.py b/instrumentation/opentelemetry-instrumentation-redis/src/opentelemetry/instrumentation/redis/util.py index 2a24ead79a..4703bc271f 100644 --- a/instrumentation/opentelemetry-instrumentation-redis/src/opentelemetry/instrumentation/redis/util.py +++ b/instrumentation/opentelemetry-instrumentation-redis/src/opentelemetry/instrumentation/redis/util.py @@ -29,7 +29,12 @@ def _extract_conn_attributes(conn_kwargs): } db = conn_kwargs.get("db", 0) attributes[SpanAttributes.DB_REDIS_DATABASE_INDEX] = db - try: + if "path" in conn_kwargs: + attributes[SpanAttributes.NET_PEER_NAME] = conn_kwargs.get("path", "") + attributes[SpanAttributes.NET_TRANSPORT] = ( + NetTransportValues.OTHER.value + ) + else: attributes[SpanAttributes.NET_PEER_NAME] = conn_kwargs.get( "host", "localhost" ) @@ -39,11 +44,6 @@ def _extract_conn_attributes(conn_kwargs): attributes[SpanAttributes.NET_TRANSPORT] = ( NetTransportValues.IP_TCP.value ) - except KeyError: - attributes[SpanAttributes.NET_PEER_NAME] = conn_kwargs.get("path", "") - attributes[SpanAttributes.NET_TRANSPORT] = ( - NetTransportValues.OTHER.value - ) return attributes diff --git a/instrumentation/opentelemetry-instrumentation-redis/tests/test_redis.py b/instrumentation/opentelemetry-instrumentation-redis/tests/test_redis.py index 2d2670fee3..4a2fce5026 100644 --- a/instrumentation/opentelemetry-instrumentation-redis/tests/test_redis.py +++ b/instrumentation/opentelemetry-instrumentation-redis/tests/test_redis.py @@ -20,6 +20,11 @@ from opentelemetry import trace from opentelemetry.instrumentation.redis import RedisInstrumentor +from opentelemetry.semconv.trace import ( + DbSystemValues, + NetTransportValues, + SpanAttributes, +) from opentelemetry.test.test_base import TestBase from opentelemetry.trace import SpanKind @@ -226,3 +231,83 @@ def test_no_op_tracer_provider(self): spans = self.memory_exporter.get_finished_spans() self.assertEqual(len(spans), 0) + + def test_attributes_default(self): + redis_client = redis.Redis() + + with mock.patch.object(redis_client, "connection"): + redis_client.set("key", "value") + + spans = self.memory_exporter.get_finished_spans() + self.assertEqual(len(spans), 1) + + span = spans[0] + self.assertEqual( + span.attributes[SpanAttributes.DB_SYSTEM], + DbSystemValues.REDIS.value, + ) + self.assertEqual( + span.attributes[SpanAttributes.DB_REDIS_DATABASE_INDEX], 0 + ) + self.assertEqual( + span.attributes[SpanAttributes.NET_PEER_NAME], "localhost" + ) + self.assertEqual(span.attributes[SpanAttributes.NET_PEER_PORT], 6379) + self.assertEqual( + span.attributes[SpanAttributes.NET_TRANSPORT], + NetTransportValues.IP_TCP.value, + ) + + def test_attributes_tcp(self): + redis_client = redis.Redis.from_url("redis://foo:bar@1.1.1.1:6380/1") + + with mock.patch.object(redis_client, "connection"): + redis_client.set("key", "value") + + spans = self.memory_exporter.get_finished_spans() + self.assertEqual(len(spans), 1) + + span = spans[0] + self.assertEqual( + span.attributes[SpanAttributes.DB_SYSTEM], + DbSystemValues.REDIS.value, + ) + self.assertEqual( + span.attributes[SpanAttributes.DB_REDIS_DATABASE_INDEX], 1 + ) + self.assertEqual( + span.attributes[SpanAttributes.NET_PEER_NAME], "1.1.1.1" + ) + self.assertEqual(span.attributes[SpanAttributes.NET_PEER_PORT], 6380) + self.assertEqual( + span.attributes[SpanAttributes.NET_TRANSPORT], + NetTransportValues.IP_TCP.value, + ) + + def test_attributes_unix_socket(self): + redis_client = redis.Redis.from_url( + "unix://foo@/path/to/socket.sock?db=3&password=bar" + ) + + with mock.patch.object(redis_client, "connection"): + redis_client.set("key", "value") + + spans = self.memory_exporter.get_finished_spans() + self.assertEqual(len(spans), 1) + + span = spans[0] + self.assertEqual( + span.attributes[SpanAttributes.DB_SYSTEM], + DbSystemValues.REDIS.value, + ) + self.assertEqual( + span.attributes[SpanAttributes.DB_REDIS_DATABASE_INDEX], 3 + ) + self.assertEqual( + span.attributes[SpanAttributes.NET_PEER_NAME], + "/path/to/socket.sock", + ) + self.assertEqual( + span.attributes[SpanAttributes.NET_TRANSPORT], + NetTransportValues.OTHER.value, + ) From dc711e870ec086c1e598c9f9b6191b8a7eeba42e Mon Sep 17 00:00:00 2001 From: Rytis Bagdziunas Date: Fri, 31 May 2024 00:48:22 +0200 Subject: [PATCH 28/56] Ensure httpx non-client methods are instrumented (#2538) * Ensure httpx non-client methods are instrumented * Update changelog * Added subTest to distinguish tests inside a loop * Updated changelog * Add a comment explaining private attribute usage --------- Co-authored-by: Diego Hurtado --- CHANGELOG.md | 5 +++- .../instrumentation/httpx/__init__.py | 6 +++-- .../tests/test_httpx_integration.py | 24 +++++++++++++++++++ 3 files changed, 32 insertions(+), 3 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 17152f3fa7..72ff7ac52c 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -42,7 +42,10 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ### Fixed -- `opentelemetry-instrumentation-dbapi` Fix compatibility with Psycopg3 to extract libpq build version (#2500)[https://github.com/open-telemetry/opentelemetry-python-contrib/pull/2500] +- `opentelemetry-instrumentation-dbapi` Fix compatibility with Psycopg3 to extract libpq build version + ([#2500](https://github.com/open-telemetry/opentelemetry-python-contrib/pull/2500)) +- `opentelemetry-instrumentation-httpx` Ensure httpx.get or httpx.request like methods are instrumented + ([#2538](https://github.com/open-telemetry/opentelemetry-python-contrib/pull/2538)) - `opentelemetry-instrumentation-grpc` AioClientInterceptor should propagate with a Metadata object ([#2363](https://github.com/open-telemetry/opentelemetry-python-contrib/pull/2363)) - `opentelemetry-instrumentation-boto3sqs` Instrument Session and resource 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 7fcc7128be..850e76eea3 100644 --- a/instrumentation/opentelemetry-instrumentation-httpx/src/opentelemetry/instrumentation/httpx/__init__.py +++ b/instrumentation/opentelemetry-instrumentation-httpx/src/opentelemetry/instrumentation/httpx/__init__.py @@ -564,11 +564,13 @@ def _instrument(self, **kwargs): tracer_provider = kwargs.get("tracer_provider") _InstrumentedClient._tracer_provider = tracer_provider _InstrumentedAsyncClient._tracer_provider = tracer_provider - httpx.Client = _InstrumentedClient + # Intentionally using a private attribute here, see: + # https://github.com/open-telemetry/opentelemetry-python-contrib/pull/2538#discussion_r1610603719 + httpx.Client = httpx._api.Client = _InstrumentedClient httpx.AsyncClient = _InstrumentedAsyncClient def _uninstrument(self, **kwargs): - httpx.Client = self._original_client + httpx.Client = httpx._api.Client = self._original_client httpx.AsyncClient = self._original_async_client _InstrumentedClient._tracer_provider = None _InstrumentedClient._request_hook = None diff --git a/instrumentation/opentelemetry-instrumentation-httpx/tests/test_httpx_integration.py b/instrumentation/opentelemetry-instrumentation-httpx/tests/test_httpx_integration.py index c3f668cafe..d64db1a8f5 100644 --- a/instrumentation/opentelemetry-instrumentation-httpx/tests/test_httpx_integration.py +++ b/instrumentation/opentelemetry-instrumentation-httpx/tests/test_httpx_integration.py @@ -532,12 +532,36 @@ def test_instrument_client(self): self.assertEqual(result.text, "Hello!") self.assert_span(num_spans=1) + def test_instrumentation_without_client(self): + + HTTPXClientInstrumentor().instrument() + results = [ + httpx.get(self.URL), + httpx.request("GET", self.URL), + ] + with httpx.stream("GET", self.URL) as stream: + stream.read() + results.append(stream) + + spans = self.assert_span(num_spans=len(results)) + for idx, res in enumerate(results): + with self.subTest(idx=idx, res=res): + self.assertEqual(res.text, "Hello!") + self.assertEqual( + spans[idx].attributes[SpanAttributes.HTTP_URL], + self.URL, + ) + + HTTPXClientInstrumentor().uninstrument() + def test_uninstrument(self): HTTPXClientInstrumentor().instrument() HTTPXClientInstrumentor().uninstrument() client = self.create_client() result = self.perform_request(self.URL, client=client) + result_no_client = httpx.get(self.URL) self.assertEqual(result.text, "Hello!") + self.assertEqual(result_no_client.text, "Hello!") self.assert_span(num_spans=0) def test_uninstrument_client(self): From 0db9dbe3113d61c037d773b8f55fc75f4a846992 Mon Sep 17 00:00:00 2001 From: OpenTelemetry Bot <107717825+opentelemetrybot@users.noreply.github.com> Date: Fri, 31 May 2024 03:48:51 +0200 Subject: [PATCH 29/56] Update version to 1.26.0.dev/0.47b0.dev (#2568) --- .github/workflows/instrumentations_0.yml | 2 +- .github/workflows/instrumentations_1.yml | 2 +- .github/workflows/lint.yml | 2 +- .github/workflows/test.yml | 2 +- CHANGELOG.md | 13 ++- _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 | 6 +- .../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 | 2 +- .../instrumentation/sklearn/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 | 96 ++++++++--------- .../contrib-instrumentations/version.py | 2 +- opentelemetry-distro/pyproject.toml | 4 +- .../src/opentelemetry/distro/version.py | 2 +- .../instrumentation/bootstrap_gen.py | 100 +++++++++--------- .../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 +- 116 files changed, 285 insertions(+), 280 deletions(-) diff --git a/.github/workflows/instrumentations_0.yml b/.github/workflows/instrumentations_0.yml index a138621633..5fb21ad672 100644 --- a/.github/workflows/instrumentations_0.yml +++ b/.github/workflows/instrumentations_0.yml @@ -6,7 +6,7 @@ on: - 'release/*' pull_request: env: - CORE_REPO_SHA: 955c92e91b5cd4bcfb43c39efcef086b040471d2 + CORE_REPO_SHA: 141a6a2e473ef7f0ec4915dfb71e3c0fa595283e jobs: instrumentations-0: diff --git a/.github/workflows/instrumentations_1.yml b/.github/workflows/instrumentations_1.yml index 904f2ee999..2bab23d7d2 100644 --- a/.github/workflows/instrumentations_1.yml +++ b/.github/workflows/instrumentations_1.yml @@ -6,7 +6,7 @@ on: - 'release/*' pull_request: env: - CORE_REPO_SHA: 955c92e91b5cd4bcfb43c39efcef086b040471d2 + CORE_REPO_SHA: 141a6a2e473ef7f0ec4915dfb71e3c0fa595283e jobs: instrumentations-1: diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml index 39afb3ee96..859b567824 100644 --- a/.github/workflows/lint.yml +++ b/.github/workflows/lint.yml @@ -6,7 +6,7 @@ on: - 'release/*' pull_request: env: - CORE_REPO_SHA: 955c92e91b5cd4bcfb43c39efcef086b040471d2 + CORE_REPO_SHA: 141a6a2e473ef7f0ec4915dfb71e3c0fa595283e jobs: lint-3_11: diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index a129c6e7ce..ee66efac64 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -6,7 +6,7 @@ on: - 'release/*' pull_request: env: - CORE_REPO_SHA: 47d5ad7aae5aef31238ca66e55dc550b307c7b35 + CORE_REPO_SHA: 141a6a2e473ef7f0ec4915dfb71e3c0fa595283e jobs: misc: diff --git a/CHANGELOG.md b/CHANGELOG.md index 72ff7ac52c..778f16c54b 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -7,6 +7,15 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ## Unreleased +### Fixed + +- `opentelemetry-instrumentation-dbapi` Fix compatibility with Psycopg3 to extract libpq build version + ([#2500](https://github.com/open-telemetry/opentelemetry-python-contrib/pull/2500)) +- `opentelemetry-instrumentation-httpx` Ensure httpx.get or httpx.request like methods are instrumented + ([#2538](https://github.com/open-telemetry/opentelemetry-python-contrib/pull/2538)) + +## Version 1.25.0/0.46b0 (2024-05-30) + ### Breaking changes - Add return statement to Confluent kafka Producer poll() and flush() calls when instrumented by ConfluentKafkaInstrumentor().instrument_producer() ([#2527](https://github.com/open-telemetry/opentelemetry-python-contrib/pull/2527)) @@ -42,10 +51,6 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ### Fixed -- `opentelemetry-instrumentation-dbapi` Fix compatibility with Psycopg3 to extract libpq build version - ([#2500](https://github.com/open-telemetry/opentelemetry-python-contrib/pull/2500)) -- `opentelemetry-instrumentation-httpx` Ensure httpx.get or httpx.request like methods are instrumented - ([#2538](https://github.com/open-telemetry/opentelemetry-python-contrib/pull/2538)) - `opentelemetry-instrumentation-grpc` AioClientInterceptor should propagate with a Metadata object ([#2363](https://github.com/open-telemetry/opentelemetry-python-contrib/pull/2363)) - `opentelemetry-instrumentation-boto3sqs` Instrument Session and resource diff --git a/_template/version.py b/_template/version.py index ff4933b20b..b6955b0eca 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.46b0.dev" +__version__ = "0.47b0.dev" diff --git a/eachdist.ini b/eachdist.ini index 60f1154a83..7f170e4947 100644 --- a/eachdist.ini +++ b/eachdist.ini @@ -16,7 +16,7 @@ sortfirst= ext/* [stable] -version=1.25.0.dev +version=1.26.0.dev packages= opentelemetry-sdk @@ -34,7 +34,7 @@ packages= opentelemetry-api [prerelease] -version=0.46b0.dev +version=0.47b0.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 ff4933b20b..b6955b0eca 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.46b0.dev" +__version__ = "0.47b0.dev" diff --git a/exporter/opentelemetry-exporter-richconsole/pyproject.toml b/exporter/opentelemetry-exporter-richconsole/pyproject.toml index 9fb32c772c..aa672ac84d 100644 --- a/exporter/opentelemetry-exporter-richconsole/pyproject.toml +++ b/exporter/opentelemetry-exporter-richconsole/pyproject.toml @@ -26,7 +26,7 @@ classifiers = [ dependencies = [ "opentelemetry-api ~= 1.12", "opentelemetry-sdk ~= 1.12", - "opentelemetry-semantic-conventions == 0.46b0.dev", + "opentelemetry-semantic-conventions == 0.47b0.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 ff4933b20b..b6955b0eca 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.46b0.dev" +__version__ = "0.47b0.dev" diff --git a/instrumentation/opentelemetry-instrumentation-aio-pika/pyproject.toml b/instrumentation/opentelemetry-instrumentation-aio-pika/pyproject.toml index 73c10fffce..71956d28ce 100644 --- a/instrumentation/opentelemetry-instrumentation-aio-pika/pyproject.toml +++ b/instrumentation/opentelemetry-instrumentation-aio-pika/pyproject.toml @@ -25,7 +25,7 @@ classifiers = [ ] dependencies = [ "opentelemetry-api ~= 1.5", - "opentelemetry-instrumentation == 0.46b0.dev", + "opentelemetry-instrumentation == 0.47b0.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 ff4933b20b..b6955b0eca 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.46b0.dev" +__version__ = "0.47b0.dev" diff --git a/instrumentation/opentelemetry-instrumentation-aiohttp-client/pyproject.toml b/instrumentation/opentelemetry-instrumentation-aiohttp-client/pyproject.toml index 17b92b2cf8..4eb0b25b17 100644 --- a/instrumentation/opentelemetry-instrumentation-aiohttp-client/pyproject.toml +++ b/instrumentation/opentelemetry-instrumentation-aiohttp-client/pyproject.toml @@ -25,9 +25,9 @@ classifiers = [ ] dependencies = [ "opentelemetry-api ~= 1.12", - "opentelemetry-instrumentation == 0.46b0.dev", - "opentelemetry-semantic-conventions == 0.46b0.dev", - "opentelemetry-util-http == 0.46b0.dev", + "opentelemetry-instrumentation == 0.47b0.dev", + "opentelemetry-semantic-conventions == 0.47b0.dev", + "opentelemetry-util-http == 0.47b0.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 604195c10e..deef26c62f 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.46b0.dev" +__version__ = "0.47b0.dev" diff --git a/instrumentation/opentelemetry-instrumentation-aiohttp-server/pyproject.toml b/instrumentation/opentelemetry-instrumentation-aiohttp-server/pyproject.toml index f85cfd6e39..a335800216 100644 --- a/instrumentation/opentelemetry-instrumentation-aiohttp-server/pyproject.toml +++ b/instrumentation/opentelemetry-instrumentation-aiohttp-server/pyproject.toml @@ -25,9 +25,9 @@ classifiers = [ ] dependencies = [ "opentelemetry-api ~= 1.12", - "opentelemetry-instrumentation == 0.46b0.dev", - "opentelemetry-semantic-conventions == 0.46b0.dev", - "opentelemetry-util-http == 0.46b0.dev", + "opentelemetry-instrumentation == 0.47b0.dev", + "opentelemetry-semantic-conventions == 0.47b0.dev", + "opentelemetry-util-http == 0.47b0.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 ff4933b20b..b6955b0eca 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.46b0.dev" +__version__ = "0.47b0.dev" diff --git a/instrumentation/opentelemetry-instrumentation-aiopg/pyproject.toml b/instrumentation/opentelemetry-instrumentation-aiopg/pyproject.toml index 4a01639d37..17d4513dc9 100644 --- a/instrumentation/opentelemetry-instrumentation-aiopg/pyproject.toml +++ b/instrumentation/opentelemetry-instrumentation-aiopg/pyproject.toml @@ -25,8 +25,8 @@ classifiers = [ ] dependencies = [ "opentelemetry-api ~= 1.12", - "opentelemetry-instrumentation == 0.46b0.dev", - "opentelemetry-instrumentation-dbapi == 0.46b0.dev", + "opentelemetry-instrumentation == 0.47b0.dev", + "opentelemetry-instrumentation-dbapi == 0.47b0.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 ff4933b20b..b6955b0eca 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.46b0.dev" +__version__ = "0.47b0.dev" diff --git a/instrumentation/opentelemetry-instrumentation-asgi/pyproject.toml b/instrumentation/opentelemetry-instrumentation-asgi/pyproject.toml index a4072bac7d..3e7fc8b9c9 100644 --- a/instrumentation/opentelemetry-instrumentation-asgi/pyproject.toml +++ b/instrumentation/opentelemetry-instrumentation-asgi/pyproject.toml @@ -26,9 +26,9 @@ classifiers = [ dependencies = [ "asgiref ~= 3.0", "opentelemetry-api ~= 1.12", - "opentelemetry-instrumentation == 0.46b0.dev", - "opentelemetry-semantic-conventions == 0.46b0.dev", - "opentelemetry-util-http == 0.46b0.dev", + "opentelemetry-instrumentation == 0.47b0.dev", + "opentelemetry-semantic-conventions == 0.47b0.dev", + "opentelemetry-util-http == 0.47b0.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 ff4933b20b..b6955b0eca 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.46b0.dev" +__version__ = "0.47b0.dev" diff --git a/instrumentation/opentelemetry-instrumentation-asyncio/pyproject.toml b/instrumentation/opentelemetry-instrumentation-asyncio/pyproject.toml index 540da184be..b6b272a57a 100644 --- a/instrumentation/opentelemetry-instrumentation-asyncio/pyproject.toml +++ b/instrumentation/opentelemetry-instrumentation-asyncio/pyproject.toml @@ -25,9 +25,9 @@ classifiers = [ ] dependencies = [ "opentelemetry-api ~= 1.14", - "opentelemetry-instrumentation == 0.46b0.dev", - "opentelemetry-semantic-conventions == 0.46b0.dev", - "opentelemetry-test-utils == 0.46b0.dev", + "opentelemetry-instrumentation == 0.47b0.dev", + "opentelemetry-semantic-conventions == 0.47b0.dev", + "opentelemetry-test-utils == 0.47b0.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 ff4933b20b..b6955b0eca 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.46b0.dev" +__version__ = "0.47b0.dev" diff --git a/instrumentation/opentelemetry-instrumentation-asyncpg/pyproject.toml b/instrumentation/opentelemetry-instrumentation-asyncpg/pyproject.toml index 6cdd2e7294..9f4f9edd8a 100644 --- a/instrumentation/opentelemetry-instrumentation-asyncpg/pyproject.toml +++ b/instrumentation/opentelemetry-instrumentation-asyncpg/pyproject.toml @@ -25,8 +25,8 @@ classifiers = [ ] dependencies = [ "opentelemetry-api ~= 1.12", - "opentelemetry-instrumentation == 0.46b0.dev", - "opentelemetry-semantic-conventions == 0.46b0.dev", + "opentelemetry-instrumentation == 0.47b0.dev", + "opentelemetry-semantic-conventions == 0.47b0.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 ff4933b20b..b6955b0eca 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.46b0.dev" +__version__ = "0.47b0.dev" diff --git a/instrumentation/opentelemetry-instrumentation-aws-lambda/pyproject.toml b/instrumentation/opentelemetry-instrumentation-aws-lambda/pyproject.toml index 3088c47dbe..8e559db99b 100644 --- a/instrumentation/opentelemetry-instrumentation-aws-lambda/pyproject.toml +++ b/instrumentation/opentelemetry-instrumentation-aws-lambda/pyproject.toml @@ -21,9 +21,9 @@ classifiers = [ "Programming Language :: Python :: 3.8", ] dependencies = [ - "opentelemetry-instrumentation == 0.46b0.dev", + "opentelemetry-instrumentation == 0.47b0.dev", "opentelemetry-propagator-aws-xray == 1.0.1", - "opentelemetry-semantic-conventions == 0.46b0.dev", + "opentelemetry-semantic-conventions == 0.47b0.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 ff4933b20b..b6955b0eca 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.46b0.dev" +__version__ = "0.47b0.dev" diff --git a/instrumentation/opentelemetry-instrumentation-boto/pyproject.toml b/instrumentation/opentelemetry-instrumentation-boto/pyproject.toml index 87a323f996..8ddd1f3884 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.46b0.dev", - "opentelemetry-semantic-conventions == 0.46b0.dev", + "opentelemetry-instrumentation == 0.47b0.dev", + "opentelemetry-semantic-conventions == 0.47b0.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 ff4933b20b..b6955b0eca 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.46b0.dev" +__version__ = "0.47b0.dev" diff --git a/instrumentation/opentelemetry-instrumentation-boto3sqs/pyproject.toml b/instrumentation/opentelemetry-instrumentation-boto3sqs/pyproject.toml index 2da67c9848..295204abb8 100644 --- a/instrumentation/opentelemetry-instrumentation-boto3sqs/pyproject.toml +++ b/instrumentation/opentelemetry-instrumentation-boto3sqs/pyproject.toml @@ -25,8 +25,8 @@ classifiers = [ ] dependencies = [ "opentelemetry-api ~= 1.12", - "opentelemetry-instrumentation == 0.46b0.dev", - "opentelemetry-semantic-conventions == 0.46b0.dev", + "opentelemetry-instrumentation == 0.47b0.dev", + "opentelemetry-semantic-conventions == 0.47b0.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 ff4933b20b..b6955b0eca 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.46b0.dev" +__version__ = "0.47b0.dev" diff --git a/instrumentation/opentelemetry-instrumentation-botocore/pyproject.toml b/instrumentation/opentelemetry-instrumentation-botocore/pyproject.toml index 7b0b34d255..7749163b51 100644 --- a/instrumentation/opentelemetry-instrumentation-botocore/pyproject.toml +++ b/instrumentation/opentelemetry-instrumentation-botocore/pyproject.toml @@ -25,8 +25,8 @@ classifiers = [ ] dependencies = [ "opentelemetry-api ~= 1.12", - "opentelemetry-instrumentation == 0.46b0.dev", - "opentelemetry-semantic-conventions == 0.46b0.dev", + "opentelemetry-instrumentation == 0.47b0.dev", + "opentelemetry-semantic-conventions == 0.47b0.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 ff4933b20b..b6955b0eca 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.46b0.dev" +__version__ = "0.47b0.dev" diff --git a/instrumentation/opentelemetry-instrumentation-cassandra/pyproject.toml b/instrumentation/opentelemetry-instrumentation-cassandra/pyproject.toml index 85f187922e..7c55c88b8f 100644 --- a/instrumentation/opentelemetry-instrumentation-cassandra/pyproject.toml +++ b/instrumentation/opentelemetry-instrumentation-cassandra/pyproject.toml @@ -25,8 +25,8 @@ classifiers = [ ] dependencies = [ "opentelemetry-api ~= 1.12", - "opentelemetry-instrumentation == 0.46b0.dev", - "opentelemetry-semantic-conventions == 0.46b0.dev", + "opentelemetry-instrumentation == 0.47b0.dev", + "opentelemetry-semantic-conventions == 0.47b0.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 ff4933b20b..b6955b0eca 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.46b0.dev" +__version__ = "0.47b0.dev" diff --git a/instrumentation/opentelemetry-instrumentation-celery/pyproject.toml b/instrumentation/opentelemetry-instrumentation-celery/pyproject.toml index 7b0027425f..e4b734c0f7 100644 --- a/instrumentation/opentelemetry-instrumentation-celery/pyproject.toml +++ b/instrumentation/opentelemetry-instrumentation-celery/pyproject.toml @@ -25,8 +25,8 @@ classifiers = [ ] dependencies = [ "opentelemetry-api ~= 1.12", - "opentelemetry-instrumentation == 0.46b0.dev", - "opentelemetry-semantic-conventions == 0.46b0.dev", + "opentelemetry-instrumentation == 0.47b0.dev", + "opentelemetry-semantic-conventions == 0.47b0.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 ff4933b20b..b6955b0eca 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.46b0.dev" +__version__ = "0.47b0.dev" diff --git a/instrumentation/opentelemetry-instrumentation-confluent-kafka/pyproject.toml b/instrumentation/opentelemetry-instrumentation-confluent-kafka/pyproject.toml index 9baeaeb40e..13e7ca94cd 100644 --- a/instrumentation/opentelemetry-instrumentation-confluent-kafka/pyproject.toml +++ b/instrumentation/opentelemetry-instrumentation-confluent-kafka/pyproject.toml @@ -21,7 +21,7 @@ classifiers = [ "Programming Language :: Python :: 3.8", ] dependencies = [ - "opentelemetry-instrumentation == 0.46b0.dev", + "opentelemetry-instrumentation == 0.47b0.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 ff4933b20b..b6955b0eca 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.46b0.dev" +__version__ = "0.47b0.dev" diff --git a/instrumentation/opentelemetry-instrumentation-dbapi/pyproject.toml b/instrumentation/opentelemetry-instrumentation-dbapi/pyproject.toml index e726768535..cf8b2d5dd2 100644 --- a/instrumentation/opentelemetry-instrumentation-dbapi/pyproject.toml +++ b/instrumentation/opentelemetry-instrumentation-dbapi/pyproject.toml @@ -25,8 +25,8 @@ classifiers = [ ] dependencies = [ "opentelemetry-api ~= 1.12", - "opentelemetry-instrumentation == 0.46b0.dev", - "opentelemetry-semantic-conventions == 0.46b0.dev", + "opentelemetry-instrumentation == 0.47b0.dev", + "opentelemetry-semantic-conventions == 0.47b0.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 17627b21dc..db4e3a0022 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.46b0.dev" +__version__ = "0.47b0.dev" _instruments = tuple() diff --git a/instrumentation/opentelemetry-instrumentation-django/pyproject.toml b/instrumentation/opentelemetry-instrumentation-django/pyproject.toml index c8869d7b29..74a9b10a59 100644 --- a/instrumentation/opentelemetry-instrumentation-django/pyproject.toml +++ b/instrumentation/opentelemetry-instrumentation-django/pyproject.toml @@ -25,15 +25,15 @@ classifiers = [ ] dependencies = [ "opentelemetry-api ~= 1.12", - "opentelemetry-instrumentation == 0.46b0.dev", - "opentelemetry-instrumentation-wsgi == 0.46b0.dev", - "opentelemetry-semantic-conventions == 0.46b0.dev", - "opentelemetry-util-http == 0.46b0.dev", + "opentelemetry-instrumentation == 0.47b0.dev", + "opentelemetry-instrumentation-wsgi == 0.47b0.dev", + "opentelemetry-semantic-conventions == 0.47b0.dev", + "opentelemetry-util-http == 0.47b0.dev", ] [project.optional-dependencies] asgi = [ - "opentelemetry-instrumentation-asgi == 0.46b0.dev", + "opentelemetry-instrumentation-asgi == 0.47b0.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 ff4933b20b..b6955b0eca 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.46b0.dev" +__version__ = "0.47b0.dev" diff --git a/instrumentation/opentelemetry-instrumentation-elasticsearch/pyproject.toml b/instrumentation/opentelemetry-instrumentation-elasticsearch/pyproject.toml index f5ba221b7f..b16f79f2ca 100644 --- a/instrumentation/opentelemetry-instrumentation-elasticsearch/pyproject.toml +++ b/instrumentation/opentelemetry-instrumentation-elasticsearch/pyproject.toml @@ -25,8 +25,8 @@ classifiers = [ ] dependencies = [ "opentelemetry-api ~= 1.12", - "opentelemetry-instrumentation == 0.46b0.dev", - "opentelemetry-semantic-conventions == 0.46b0.dev", + "opentelemetry-instrumentation == 0.47b0.dev", + "opentelemetry-semantic-conventions == 0.47b0.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 ff4933b20b..b6955b0eca 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.46b0.dev" +__version__ = "0.47b0.dev" diff --git a/instrumentation/opentelemetry-instrumentation-falcon/pyproject.toml b/instrumentation/opentelemetry-instrumentation-falcon/pyproject.toml index 93787a010d..14e92041fa 100644 --- a/instrumentation/opentelemetry-instrumentation-falcon/pyproject.toml +++ b/instrumentation/opentelemetry-instrumentation-falcon/pyproject.toml @@ -25,10 +25,10 @@ classifiers = [ ] dependencies = [ "opentelemetry-api ~= 1.12", - "opentelemetry-instrumentation == 0.46b0.dev", - "opentelemetry-instrumentation-wsgi == 0.46b0.dev", - "opentelemetry-semantic-conventions == 0.46b0.dev", - "opentelemetry-util-http == 0.46b0.dev", + "opentelemetry-instrumentation == 0.47b0.dev", + "opentelemetry-instrumentation-wsgi == 0.47b0.dev", + "opentelemetry-semantic-conventions == 0.47b0.dev", + "opentelemetry-util-http == 0.47b0.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 ff4933b20b..b6955b0eca 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.46b0.dev" +__version__ = "0.47b0.dev" diff --git a/instrumentation/opentelemetry-instrumentation-fastapi/pyproject.toml b/instrumentation/opentelemetry-instrumentation-fastapi/pyproject.toml index 0e11179de2..c8cff0d46d 100644 --- a/instrumentation/opentelemetry-instrumentation-fastapi/pyproject.toml +++ b/instrumentation/opentelemetry-instrumentation-fastapi/pyproject.toml @@ -25,10 +25,10 @@ classifiers = [ ] dependencies = [ "opentelemetry-api ~= 1.12", - "opentelemetry-instrumentation == 0.46b0.dev", - "opentelemetry-instrumentation-asgi == 0.46b0.dev", - "opentelemetry-semantic-conventions == 0.46b0.dev", - "opentelemetry-util-http == 0.46b0.dev", + "opentelemetry-instrumentation == 0.47b0.dev", + "opentelemetry-instrumentation-asgi == 0.47b0.dev", + "opentelemetry-semantic-conventions == 0.47b0.dev", + "opentelemetry-util-http == 0.47b0.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 ff4933b20b..b6955b0eca 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.46b0.dev" +__version__ = "0.47b0.dev" diff --git a/instrumentation/opentelemetry-instrumentation-flask/pyproject.toml b/instrumentation/opentelemetry-instrumentation-flask/pyproject.toml index 2bc1335a51..f0abd0dc04 100644 --- a/instrumentation/opentelemetry-instrumentation-flask/pyproject.toml +++ b/instrumentation/opentelemetry-instrumentation-flask/pyproject.toml @@ -25,10 +25,10 @@ classifiers = [ ] dependencies = [ "opentelemetry-api ~= 1.12", - "opentelemetry-instrumentation == 0.46b0.dev", - "opentelemetry-instrumentation-wsgi == 0.46b0.dev", - "opentelemetry-semantic-conventions == 0.46b0.dev", - "opentelemetry-util-http == 0.46b0.dev", + "opentelemetry-instrumentation == 0.47b0.dev", + "opentelemetry-instrumentation-wsgi == 0.47b0.dev", + "opentelemetry-semantic-conventions == 0.47b0.dev", + "opentelemetry-util-http == 0.47b0.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 ff4933b20b..b6955b0eca 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.46b0.dev" +__version__ = "0.47b0.dev" diff --git a/instrumentation/opentelemetry-instrumentation-grpc/pyproject.toml b/instrumentation/opentelemetry-instrumentation-grpc/pyproject.toml index 7deffb71e7..6acda1ff8b 100644 --- a/instrumentation/opentelemetry-instrumentation-grpc/pyproject.toml +++ b/instrumentation/opentelemetry-instrumentation-grpc/pyproject.toml @@ -25,8 +25,8 @@ classifiers = [ ] dependencies = [ "opentelemetry-api ~= 1.12", - "opentelemetry-instrumentation == 0.46b0.dev", - "opentelemetry-semantic-conventions == 0.46b0.dev", + "opentelemetry-instrumentation == 0.47b0.dev", + "opentelemetry-semantic-conventions == 0.47b0.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 ff4933b20b..b6955b0eca 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.46b0.dev" +__version__ = "0.47b0.dev" diff --git a/instrumentation/opentelemetry-instrumentation-httpx/pyproject.toml b/instrumentation/opentelemetry-instrumentation-httpx/pyproject.toml index e4e5575d96..8e94e70de8 100644 --- a/instrumentation/opentelemetry-instrumentation-httpx/pyproject.toml +++ b/instrumentation/opentelemetry-instrumentation-httpx/pyproject.toml @@ -25,9 +25,9 @@ classifiers = [ ] dependencies = [ "opentelemetry-api ~= 1.12", - "opentelemetry-instrumentation == 0.46b0.dev", - "opentelemetry-semantic-conventions == 0.46b0.dev", - "opentelemetry-util-http == 0.46b0.dev", + "opentelemetry-instrumentation == 0.47b0.dev", + "opentelemetry-semantic-conventions == 0.47b0.dev", + "opentelemetry-util-http == 0.47b0.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 ff4933b20b..b6955b0eca 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.46b0.dev" +__version__ = "0.47b0.dev" diff --git a/instrumentation/opentelemetry-instrumentation-jinja2/pyproject.toml b/instrumentation/opentelemetry-instrumentation-jinja2/pyproject.toml index 6284496ebd..a93fe78d7e 100644 --- a/instrumentation/opentelemetry-instrumentation-jinja2/pyproject.toml +++ b/instrumentation/opentelemetry-instrumentation-jinja2/pyproject.toml @@ -25,7 +25,7 @@ classifiers = [ ] dependencies = [ "opentelemetry-api ~= 1.12", - "opentelemetry-instrumentation == 0.46b0.dev", + "opentelemetry-instrumentation == 0.47b0.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 ff4933b20b..b6955b0eca 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.46b0.dev" +__version__ = "0.47b0.dev" diff --git a/instrumentation/opentelemetry-instrumentation-kafka-python/pyproject.toml b/instrumentation/opentelemetry-instrumentation-kafka-python/pyproject.toml index 580c076a82..bd06b90f06 100644 --- a/instrumentation/opentelemetry-instrumentation-kafka-python/pyproject.toml +++ b/instrumentation/opentelemetry-instrumentation-kafka-python/pyproject.toml @@ -25,8 +25,8 @@ classifiers = [ ] dependencies = [ "opentelemetry-api ~= 1.5", - "opentelemetry-instrumentation == 0.46b0.dev", - "opentelemetry-semantic-conventions == 0.46b0.dev", + "opentelemetry-instrumentation == 0.47b0.dev", + "opentelemetry-semantic-conventions == 0.47b0.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 ff4933b20b..b6955b0eca 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.46b0.dev" +__version__ = "0.47b0.dev" diff --git a/instrumentation/opentelemetry-instrumentation-logging/pyproject.toml b/instrumentation/opentelemetry-instrumentation-logging/pyproject.toml index 57572ce634..df254c9d60 100644 --- a/instrumentation/opentelemetry-instrumentation-logging/pyproject.toml +++ b/instrumentation/opentelemetry-instrumentation-logging/pyproject.toml @@ -25,7 +25,7 @@ classifiers = [ ] dependencies = [ "opentelemetry-api ~= 1.12", - "opentelemetry-instrumentation == 0.46b0.dev", + "opentelemetry-instrumentation == 0.47b0.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 17627b21dc..db4e3a0022 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.46b0.dev" +__version__ = "0.47b0.dev" _instruments = tuple() diff --git a/instrumentation/opentelemetry-instrumentation-mysql/pyproject.toml b/instrumentation/opentelemetry-instrumentation-mysql/pyproject.toml index 481748c007..1c66bb932c 100644 --- a/instrumentation/opentelemetry-instrumentation-mysql/pyproject.toml +++ b/instrumentation/opentelemetry-instrumentation-mysql/pyproject.toml @@ -25,8 +25,8 @@ classifiers = [ ] dependencies = [ "opentelemetry-api ~= 1.12", - "opentelemetry-instrumentation == 0.46b0.dev", - "opentelemetry-instrumentation-dbapi == 0.46b0.dev", + "opentelemetry-instrumentation == 0.47b0.dev", + "opentelemetry-instrumentation-dbapi == 0.47b0.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 ff4933b20b..b6955b0eca 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.46b0.dev" +__version__ = "0.47b0.dev" diff --git a/instrumentation/opentelemetry-instrumentation-mysqlclient/pyproject.toml b/instrumentation/opentelemetry-instrumentation-mysqlclient/pyproject.toml index c9db02e22f..bb4f62975a 100644 --- a/instrumentation/opentelemetry-instrumentation-mysqlclient/pyproject.toml +++ b/instrumentation/opentelemetry-instrumentation-mysqlclient/pyproject.toml @@ -25,8 +25,8 @@ classifiers = [ ] dependencies = [ "opentelemetry-api ~= 1.12", - "opentelemetry-instrumentation == 0.46b0.dev", - "opentelemetry-instrumentation-dbapi == 0.46b0.dev", + "opentelemetry-instrumentation == 0.47b0.dev", + "opentelemetry-instrumentation-dbapi == 0.47b0.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 ff4933b20b..b6955b0eca 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.46b0.dev" +__version__ = "0.47b0.dev" diff --git a/instrumentation/opentelemetry-instrumentation-pika/pyproject.toml b/instrumentation/opentelemetry-instrumentation-pika/pyproject.toml index a41b7297a8..011bee252c 100644 --- a/instrumentation/opentelemetry-instrumentation-pika/pyproject.toml +++ b/instrumentation/opentelemetry-instrumentation-pika/pyproject.toml @@ -24,7 +24,7 @@ classifiers = [ "Programming Language :: Python :: 3.11", ] dependencies = [ - "opentelemetry-instrumentation == 0.46b0.dev", + "opentelemetry-instrumentation == 0.47b0.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 ff4933b20b..b6955b0eca 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.46b0.dev" +__version__ = "0.47b0.dev" diff --git a/instrumentation/opentelemetry-instrumentation-psycopg/pyproject.toml b/instrumentation/opentelemetry-instrumentation-psycopg/pyproject.toml index d2328035fb..8790a02026 100644 --- a/instrumentation/opentelemetry-instrumentation-psycopg/pyproject.toml +++ b/instrumentation/opentelemetry-instrumentation-psycopg/pyproject.toml @@ -26,8 +26,8 @@ classifiers = [ ] dependencies = [ "opentelemetry-api ~= 1.12", - "opentelemetry-instrumentation == 0.46b0.dev", - "opentelemetry-instrumentation-dbapi == 0.46b0.dev", + "opentelemetry-instrumentation == 0.47b0.dev", + "opentelemetry-instrumentation-dbapi == 0.47b0.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 ff4933b20b..b6955b0eca 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.46b0.dev" +__version__ = "0.47b0.dev" diff --git a/instrumentation/opentelemetry-instrumentation-psycopg2/pyproject.toml b/instrumentation/opentelemetry-instrumentation-psycopg2/pyproject.toml index 399d5dc466..ebc3ed592a 100644 --- a/instrumentation/opentelemetry-instrumentation-psycopg2/pyproject.toml +++ b/instrumentation/opentelemetry-instrumentation-psycopg2/pyproject.toml @@ -25,8 +25,8 @@ classifiers = [ ] dependencies = [ "opentelemetry-api ~= 1.12", - "opentelemetry-instrumentation == 0.46b0.dev", - "opentelemetry-instrumentation-dbapi == 0.46b0.dev", + "opentelemetry-instrumentation == 0.47b0.dev", + "opentelemetry-instrumentation-dbapi == 0.47b0.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 ff4933b20b..b6955b0eca 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.46b0.dev" +__version__ = "0.47b0.dev" diff --git a/instrumentation/opentelemetry-instrumentation-pymemcache/pyproject.toml b/instrumentation/opentelemetry-instrumentation-pymemcache/pyproject.toml index f7f3bc1905..46ce5870a7 100644 --- a/instrumentation/opentelemetry-instrumentation-pymemcache/pyproject.toml +++ b/instrumentation/opentelemetry-instrumentation-pymemcache/pyproject.toml @@ -25,8 +25,8 @@ classifiers = [ ] dependencies = [ "opentelemetry-api ~= 1.12", - "opentelemetry-instrumentation == 0.46b0.dev", - "opentelemetry-semantic-conventions == 0.46b0.dev", + "opentelemetry-instrumentation == 0.47b0.dev", + "opentelemetry-semantic-conventions == 0.47b0.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 ff4933b20b..b6955b0eca 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.46b0.dev" +__version__ = "0.47b0.dev" diff --git a/instrumentation/opentelemetry-instrumentation-pymongo/pyproject.toml b/instrumentation/opentelemetry-instrumentation-pymongo/pyproject.toml index 7c1c8a03a5..bc921d0dd5 100644 --- a/instrumentation/opentelemetry-instrumentation-pymongo/pyproject.toml +++ b/instrumentation/opentelemetry-instrumentation-pymongo/pyproject.toml @@ -25,8 +25,8 @@ classifiers = [ ] dependencies = [ "opentelemetry-api ~= 1.12", - "opentelemetry-instrumentation == 0.46b0.dev", - "opentelemetry-semantic-conventions == 0.46b0.dev", + "opentelemetry-instrumentation == 0.47b0.dev", + "opentelemetry-semantic-conventions == 0.47b0.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 ff4933b20b..b6955b0eca 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.46b0.dev" +__version__ = "0.47b0.dev" diff --git a/instrumentation/opentelemetry-instrumentation-pymysql/pyproject.toml b/instrumentation/opentelemetry-instrumentation-pymysql/pyproject.toml index 858fea62fa..39eb241054 100644 --- a/instrumentation/opentelemetry-instrumentation-pymysql/pyproject.toml +++ b/instrumentation/opentelemetry-instrumentation-pymysql/pyproject.toml @@ -25,8 +25,8 @@ classifiers = [ ] dependencies = [ "opentelemetry-api ~= 1.12", - "opentelemetry-instrumentation == 0.46b0.dev", - "opentelemetry-instrumentation-dbapi == 0.46b0.dev", + "opentelemetry-instrumentation == 0.47b0.dev", + "opentelemetry-instrumentation-dbapi == 0.47b0.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 ff4933b20b..b6955b0eca 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.46b0.dev" +__version__ = "0.47b0.dev" diff --git a/instrumentation/opentelemetry-instrumentation-pyramid/pyproject.toml b/instrumentation/opentelemetry-instrumentation-pyramid/pyproject.toml index 49a61287f6..221e74a602 100644 --- a/instrumentation/opentelemetry-instrumentation-pyramid/pyproject.toml +++ b/instrumentation/opentelemetry-instrumentation-pyramid/pyproject.toml @@ -25,10 +25,10 @@ classifiers = [ ] dependencies = [ "opentelemetry-api ~= 1.12", - "opentelemetry-instrumentation == 0.46b0.dev", - "opentelemetry-instrumentation-wsgi == 0.46b0.dev", - "opentelemetry-semantic-conventions == 0.46b0.dev", - "opentelemetry-util-http == 0.46b0.dev", + "opentelemetry-instrumentation == 0.47b0.dev", + "opentelemetry-instrumentation-wsgi == 0.47b0.dev", + "opentelemetry-semantic-conventions == 0.47b0.dev", + "opentelemetry-util-http == 0.47b0.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 ff4933b20b..b6955b0eca 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.46b0.dev" +__version__ = "0.47b0.dev" diff --git a/instrumentation/opentelemetry-instrumentation-redis/pyproject.toml b/instrumentation/opentelemetry-instrumentation-redis/pyproject.toml index 76b049b7c8..0139ba5fb8 100644 --- a/instrumentation/opentelemetry-instrumentation-redis/pyproject.toml +++ b/instrumentation/opentelemetry-instrumentation-redis/pyproject.toml @@ -25,8 +25,8 @@ classifiers = [ ] dependencies = [ "opentelemetry-api ~= 1.12", - "opentelemetry-instrumentation == 0.46b0.dev", - "opentelemetry-semantic-conventions == 0.46b0.dev", + "opentelemetry-instrumentation == 0.47b0.dev", + "opentelemetry-semantic-conventions == 0.47b0.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 ff4933b20b..b6955b0eca 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.46b0.dev" +__version__ = "0.47b0.dev" diff --git a/instrumentation/opentelemetry-instrumentation-remoulade/pyproject.toml b/instrumentation/opentelemetry-instrumentation-remoulade/pyproject.toml index ba23cc0b0a..5b4d838d56 100644 --- a/instrumentation/opentelemetry-instrumentation-remoulade/pyproject.toml +++ b/instrumentation/opentelemetry-instrumentation-remoulade/pyproject.toml @@ -25,8 +25,8 @@ classifiers = [ ] dependencies = [ "opentelemetry-api ~= 1.12", - "opentelemetry-instrumentation == 0.46b0.dev", - "opentelemetry-semantic-conventions == 0.46b0.dev", + "opentelemetry-instrumentation == 0.47b0.dev", + "opentelemetry-semantic-conventions == 0.47b0.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 ff4933b20b..b6955b0eca 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.46b0.dev" +__version__ = "0.47b0.dev" diff --git a/instrumentation/opentelemetry-instrumentation-requests/pyproject.toml b/instrumentation/opentelemetry-instrumentation-requests/pyproject.toml index 6252ab3de9..b3a56b7976 100644 --- a/instrumentation/opentelemetry-instrumentation-requests/pyproject.toml +++ b/instrumentation/opentelemetry-instrumentation-requests/pyproject.toml @@ -25,9 +25,9 @@ classifiers = [ ] dependencies = [ "opentelemetry-api ~= 1.12", - "opentelemetry-instrumentation == 0.46b0.dev", - "opentelemetry-semantic-conventions == 0.46b0.dev", - "opentelemetry-util-http == 0.46b0.dev", + "opentelemetry-instrumentation == 0.47b0.dev", + "opentelemetry-semantic-conventions == 0.47b0.dev", + "opentelemetry-util-http == 0.47b0.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 ff4933b20b..b6955b0eca 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.46b0.dev" +__version__ = "0.47b0.dev" diff --git a/instrumentation/opentelemetry-instrumentation-sklearn/pyproject.toml b/instrumentation/opentelemetry-instrumentation-sklearn/pyproject.toml index ebda48982a..22fb150cf8 100644 --- a/instrumentation/opentelemetry-instrumentation-sklearn/pyproject.toml +++ b/instrumentation/opentelemetry-instrumentation-sklearn/pyproject.toml @@ -25,7 +25,7 @@ classifiers = [ ] dependencies = [ "opentelemetry-api ~= 1.12", - "opentelemetry-instrumentation == 0.46b0.dev", + "opentelemetry-instrumentation == 0.47b0.dev", ] [project.optional-dependencies] diff --git a/instrumentation/opentelemetry-instrumentation-sklearn/src/opentelemetry/instrumentation/sklearn/version.py b/instrumentation/opentelemetry-instrumentation-sklearn/src/opentelemetry/instrumentation/sklearn/version.py index 604195c10e..deef26c62f 100644 --- a/instrumentation/opentelemetry-instrumentation-sklearn/src/opentelemetry/instrumentation/sklearn/version.py +++ b/instrumentation/opentelemetry-instrumentation-sklearn/src/opentelemetry/instrumentation/sklearn/version.py @@ -12,4 +12,4 @@ # See the License for the specific language governing permissions and # limitations under the License. -__version__ = "0.46b0.dev" +__version__ = "0.47b0.dev" diff --git a/instrumentation/opentelemetry-instrumentation-sqlalchemy/pyproject.toml b/instrumentation/opentelemetry-instrumentation-sqlalchemy/pyproject.toml index 338606aa6e..ee602ead86 100644 --- a/instrumentation/opentelemetry-instrumentation-sqlalchemy/pyproject.toml +++ b/instrumentation/opentelemetry-instrumentation-sqlalchemy/pyproject.toml @@ -25,8 +25,8 @@ classifiers = [ ] dependencies = [ "opentelemetry-api ~= 1.12", - "opentelemetry-instrumentation == 0.46b0.dev", - "opentelemetry-semantic-conventions == 0.46b0.dev", + "opentelemetry-instrumentation == 0.47b0.dev", + "opentelemetry-semantic-conventions == 0.47b0.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 ff4933b20b..b6955b0eca 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.46b0.dev" +__version__ = "0.47b0.dev" diff --git a/instrumentation/opentelemetry-instrumentation-sqlite3/pyproject.toml b/instrumentation/opentelemetry-instrumentation-sqlite3/pyproject.toml index 05bda3d1d0..ddc1eb1fab 100644 --- a/instrumentation/opentelemetry-instrumentation-sqlite3/pyproject.toml +++ b/instrumentation/opentelemetry-instrumentation-sqlite3/pyproject.toml @@ -25,8 +25,8 @@ classifiers = [ ] dependencies = [ "opentelemetry-api ~= 1.12", - "opentelemetry-instrumentation == 0.46b0.dev", - "opentelemetry-instrumentation-dbapi == 0.46b0.dev", + "opentelemetry-instrumentation == 0.47b0.dev", + "opentelemetry-instrumentation-dbapi == 0.47b0.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 17627b21dc..db4e3a0022 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.46b0.dev" +__version__ = "0.47b0.dev" _instruments = tuple() diff --git a/instrumentation/opentelemetry-instrumentation-starlette/pyproject.toml b/instrumentation/opentelemetry-instrumentation-starlette/pyproject.toml index 69805b660c..bf087d64d2 100644 --- a/instrumentation/opentelemetry-instrumentation-starlette/pyproject.toml +++ b/instrumentation/opentelemetry-instrumentation-starlette/pyproject.toml @@ -25,10 +25,10 @@ classifiers = [ ] dependencies = [ "opentelemetry-api ~= 1.12", - "opentelemetry-instrumentation == 0.46b0.dev", - "opentelemetry-instrumentation-asgi == 0.46b0.dev", - "opentelemetry-semantic-conventions == 0.46b0.dev", - "opentelemetry-util-http == 0.46b0.dev", + "opentelemetry-instrumentation == 0.47b0.dev", + "opentelemetry-instrumentation-asgi == 0.47b0.dev", + "opentelemetry-semantic-conventions == 0.47b0.dev", + "opentelemetry-util-http == 0.47b0.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 ff4933b20b..b6955b0eca 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.46b0.dev" +__version__ = "0.47b0.dev" diff --git a/instrumentation/opentelemetry-instrumentation-system-metrics/pyproject.toml b/instrumentation/opentelemetry-instrumentation-system-metrics/pyproject.toml index aa2d8083ec..6847372597 100644 --- a/instrumentation/opentelemetry-instrumentation-system-metrics/pyproject.toml +++ b/instrumentation/opentelemetry-instrumentation-system-metrics/pyproject.toml @@ -24,7 +24,7 @@ classifiers = [ "Programming Language :: Python :: 3.11", ] dependencies = [ - "opentelemetry-instrumentation == 0.46b0.dev", + "opentelemetry-instrumentation == 0.47b0.dev", "opentelemetry-api ~= 1.11", "psutil ~= 5.9", ] 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 ff4933b20b..b6955b0eca 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.46b0.dev" +__version__ = "0.47b0.dev" diff --git a/instrumentation/opentelemetry-instrumentation-threading/pyproject.toml b/instrumentation/opentelemetry-instrumentation-threading/pyproject.toml index 16874b13f9..418bf5e537 100644 --- a/instrumentation/opentelemetry-instrumentation-threading/pyproject.toml +++ b/instrumentation/opentelemetry-instrumentation-threading/pyproject.toml @@ -25,7 +25,7 @@ classifiers = [ ] dependencies = [ "opentelemetry-api ~= 1.12", - "opentelemetry-instrumentation == 0.46b0.dev", + "opentelemetry-instrumentation == 0.47b0.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 ff4933b20b..b6955b0eca 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.46b0.dev" +__version__ = "0.47b0.dev" diff --git a/instrumentation/opentelemetry-instrumentation-tornado/pyproject.toml b/instrumentation/opentelemetry-instrumentation-tornado/pyproject.toml index ea1c48f011..345d226a55 100644 --- a/instrumentation/opentelemetry-instrumentation-tornado/pyproject.toml +++ b/instrumentation/opentelemetry-instrumentation-tornado/pyproject.toml @@ -24,9 +24,9 @@ classifiers = [ ] dependencies = [ "opentelemetry-api ~= 1.12", - "opentelemetry-instrumentation == 0.46b0.dev", - "opentelemetry-semantic-conventions == 0.46b0.dev", - "opentelemetry-util-http == 0.46b0.dev", + "opentelemetry-instrumentation == 0.47b0.dev", + "opentelemetry-semantic-conventions == 0.47b0.dev", + "opentelemetry-util-http == 0.47b0.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 ff4933b20b..b6955b0eca 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.46b0.dev" +__version__ = "0.47b0.dev" diff --git a/instrumentation/opentelemetry-instrumentation-tortoiseorm/pyproject.toml b/instrumentation/opentelemetry-instrumentation-tortoiseorm/pyproject.toml index 62e5da5b54..1d5d30aa45 100644 --- a/instrumentation/opentelemetry-instrumentation-tortoiseorm/pyproject.toml +++ b/instrumentation/opentelemetry-instrumentation-tortoiseorm/pyproject.toml @@ -25,8 +25,8 @@ classifiers = [ ] dependencies = [ "opentelemetry-api ~= 1.12", - "opentelemetry-instrumentation == 0.46b0.dev", - "opentelemetry-semantic-conventions == 0.46b0.dev", + "opentelemetry-instrumentation == 0.47b0.dev", + "opentelemetry-semantic-conventions == 0.47b0.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 ff4933b20b..b6955b0eca 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.46b0.dev" +__version__ = "0.47b0.dev" diff --git a/instrumentation/opentelemetry-instrumentation-urllib/pyproject.toml b/instrumentation/opentelemetry-instrumentation-urllib/pyproject.toml index 1011912a53..cc1594a31e 100644 --- a/instrumentation/opentelemetry-instrumentation-urllib/pyproject.toml +++ b/instrumentation/opentelemetry-instrumentation-urllib/pyproject.toml @@ -25,9 +25,9 @@ classifiers = [ ] dependencies = [ "opentelemetry-api ~= 1.12", - "opentelemetry-instrumentation == 0.46b0.dev", - "opentelemetry-semantic-conventions == 0.46b0.dev", - "opentelemetry-util-http == 0.46b0.dev", + "opentelemetry-instrumentation == 0.47b0.dev", + "opentelemetry-semantic-conventions == 0.47b0.dev", + "opentelemetry-util-http == 0.47b0.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 17627b21dc..db4e3a0022 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.46b0.dev" +__version__ = "0.47b0.dev" _instruments = tuple() diff --git a/instrumentation/opentelemetry-instrumentation-urllib3/pyproject.toml b/instrumentation/opentelemetry-instrumentation-urllib3/pyproject.toml index b5fafc0fe9..e4a6892b23 100644 --- a/instrumentation/opentelemetry-instrumentation-urllib3/pyproject.toml +++ b/instrumentation/opentelemetry-instrumentation-urllib3/pyproject.toml @@ -25,9 +25,9 @@ classifiers = [ ] dependencies = [ "opentelemetry-api ~= 1.12", - "opentelemetry-instrumentation == 0.46b0.dev", - "opentelemetry-semantic-conventions == 0.46b0.dev", - "opentelemetry-util-http == 0.46b0.dev", + "opentelemetry-instrumentation == 0.47b0.dev", + "opentelemetry-semantic-conventions == 0.47b0.dev", + "opentelemetry-util-http == 0.47b0.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 ff4933b20b..b6955b0eca 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.46b0.dev" +__version__ = "0.47b0.dev" diff --git a/instrumentation/opentelemetry-instrumentation-wsgi/pyproject.toml b/instrumentation/opentelemetry-instrumentation-wsgi/pyproject.toml index e3e8bca651..32766c2def 100644 --- a/instrumentation/opentelemetry-instrumentation-wsgi/pyproject.toml +++ b/instrumentation/opentelemetry-instrumentation-wsgi/pyproject.toml @@ -25,9 +25,9 @@ classifiers = [ ] dependencies = [ "opentelemetry-api ~= 1.12", - "opentelemetry-instrumentation == 0.46b0.dev", - "opentelemetry-semantic-conventions == 0.46b0.dev", - "opentelemetry-util-http == 0.46b0.dev", + "opentelemetry-instrumentation == 0.47b0.dev", + "opentelemetry-semantic-conventions == 0.47b0.dev", + "opentelemetry-util-http == 0.47b0.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 ff4933b20b..b6955b0eca 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.46b0.dev" +__version__ = "0.47b0.dev" diff --git a/opentelemetry-contrib-instrumentations/pyproject.toml b/opentelemetry-contrib-instrumentations/pyproject.toml index 7e4afad6f7..ff100a1ca6 100644 --- a/opentelemetry-contrib-instrumentations/pyproject.toml +++ b/opentelemetry-contrib-instrumentations/pyproject.toml @@ -28,54 +28,54 @@ classifiers = [ "Programming Language :: Python :: 3.11", ] dependencies = [ - "opentelemetry-instrumentation-aio-pika==0.46b0.dev", - "opentelemetry-instrumentation-aiohttp-client==0.46b0.dev", - "opentelemetry-instrumentation-aiohttp-server==0.46b0.dev", - "opentelemetry-instrumentation-aiopg==0.46b0.dev", - "opentelemetry-instrumentation-asgi==0.46b0.dev", - "opentelemetry-instrumentation-asyncio==0.46b0.dev", - "opentelemetry-instrumentation-asyncpg==0.46b0.dev", - "opentelemetry-instrumentation-aws-lambda==0.46b0.dev", - "opentelemetry-instrumentation-boto==0.46b0.dev", - "opentelemetry-instrumentation-boto3sqs==0.46b0.dev", - "opentelemetry-instrumentation-botocore==0.46b0.dev", - "opentelemetry-instrumentation-cassandra==0.46b0.dev", - "opentelemetry-instrumentation-celery==0.46b0.dev", - "opentelemetry-instrumentation-confluent-kafka==0.46b0.dev", - "opentelemetry-instrumentation-dbapi==0.46b0.dev", - "opentelemetry-instrumentation-django==0.46b0.dev", - "opentelemetry-instrumentation-elasticsearch==0.46b0.dev", - "opentelemetry-instrumentation-falcon==0.46b0.dev", - "opentelemetry-instrumentation-fastapi==0.46b0.dev", - "opentelemetry-instrumentation-flask==0.46b0.dev", - "opentelemetry-instrumentation-grpc==0.46b0.dev", - "opentelemetry-instrumentation-httpx==0.46b0.dev", - "opentelemetry-instrumentation-jinja2==0.46b0.dev", - "opentelemetry-instrumentation-kafka-python==0.46b0.dev", - "opentelemetry-instrumentation-logging==0.46b0.dev", - "opentelemetry-instrumentation-mysql==0.46b0.dev", - "opentelemetry-instrumentation-mysqlclient==0.46b0.dev", - "opentelemetry-instrumentation-pika==0.46b0.dev", - "opentelemetry-instrumentation-psycopg==0.46b0.dev", - "opentelemetry-instrumentation-psycopg2==0.46b0.dev", - "opentelemetry-instrumentation-pymemcache==0.46b0.dev", - "opentelemetry-instrumentation-pymongo==0.46b0.dev", - "opentelemetry-instrumentation-pymysql==0.46b0.dev", - "opentelemetry-instrumentation-pyramid==0.46b0.dev", - "opentelemetry-instrumentation-redis==0.46b0.dev", - "opentelemetry-instrumentation-remoulade==0.46b0.dev", - "opentelemetry-instrumentation-requests==0.46b0.dev", - "opentelemetry-instrumentation-sklearn==0.46b0.dev", - "opentelemetry-instrumentation-sqlalchemy==0.46b0.dev", - "opentelemetry-instrumentation-sqlite3==0.46b0.dev", - "opentelemetry-instrumentation-starlette==0.46b0.dev", - "opentelemetry-instrumentation-system-metrics==0.46b0.dev", - "opentelemetry-instrumentation-threading==0.46b0.dev", - "opentelemetry-instrumentation-tornado==0.46b0.dev", - "opentelemetry-instrumentation-tortoiseorm==0.46b0.dev", - "opentelemetry-instrumentation-urllib==0.46b0.dev", - "opentelemetry-instrumentation-urllib3==0.46b0.dev", - "opentelemetry-instrumentation-wsgi==0.46b0.dev", + "opentelemetry-instrumentation-aio-pika==0.47b0.dev", + "opentelemetry-instrumentation-aiohttp-client==0.47b0.dev", + "opentelemetry-instrumentation-aiohttp-server==0.47b0.dev", + "opentelemetry-instrumentation-aiopg==0.47b0.dev", + "opentelemetry-instrumentation-asgi==0.47b0.dev", + "opentelemetry-instrumentation-asyncio==0.47b0.dev", + "opentelemetry-instrumentation-asyncpg==0.47b0.dev", + "opentelemetry-instrumentation-aws-lambda==0.47b0.dev", + "opentelemetry-instrumentation-boto==0.47b0.dev", + "opentelemetry-instrumentation-boto3sqs==0.47b0.dev", + "opentelemetry-instrumentation-botocore==0.47b0.dev", + "opentelemetry-instrumentation-cassandra==0.47b0.dev", + "opentelemetry-instrumentation-celery==0.47b0.dev", + "opentelemetry-instrumentation-confluent-kafka==0.47b0.dev", + "opentelemetry-instrumentation-dbapi==0.47b0.dev", + "opentelemetry-instrumentation-django==0.47b0.dev", + "opentelemetry-instrumentation-elasticsearch==0.47b0.dev", + "opentelemetry-instrumentation-falcon==0.47b0.dev", + "opentelemetry-instrumentation-fastapi==0.47b0.dev", + "opentelemetry-instrumentation-flask==0.47b0.dev", + "opentelemetry-instrumentation-grpc==0.47b0.dev", + "opentelemetry-instrumentation-httpx==0.47b0.dev", + "opentelemetry-instrumentation-jinja2==0.47b0.dev", + "opentelemetry-instrumentation-kafka-python==0.47b0.dev", + "opentelemetry-instrumentation-logging==0.47b0.dev", + "opentelemetry-instrumentation-mysql==0.47b0.dev", + "opentelemetry-instrumentation-mysqlclient==0.47b0.dev", + "opentelemetry-instrumentation-pika==0.47b0.dev", + "opentelemetry-instrumentation-psycopg==0.47b0.dev", + "opentelemetry-instrumentation-psycopg2==0.47b0.dev", + "opentelemetry-instrumentation-pymemcache==0.47b0.dev", + "opentelemetry-instrumentation-pymongo==0.47b0.dev", + "opentelemetry-instrumentation-pymysql==0.47b0.dev", + "opentelemetry-instrumentation-pyramid==0.47b0.dev", + "opentelemetry-instrumentation-redis==0.47b0.dev", + "opentelemetry-instrumentation-remoulade==0.47b0.dev", + "opentelemetry-instrumentation-requests==0.47b0.dev", + "opentelemetry-instrumentation-sklearn==0.47b0.dev", + "opentelemetry-instrumentation-sqlalchemy==0.47b0.dev", + "opentelemetry-instrumentation-sqlite3==0.47b0.dev", + "opentelemetry-instrumentation-starlette==0.47b0.dev", + "opentelemetry-instrumentation-system-metrics==0.47b0.dev", + "opentelemetry-instrumentation-threading==0.47b0.dev", + "opentelemetry-instrumentation-tornado==0.47b0.dev", + "opentelemetry-instrumentation-tortoiseorm==0.47b0.dev", + "opentelemetry-instrumentation-urllib==0.47b0.dev", + "opentelemetry-instrumentation-urllib3==0.47b0.dev", + "opentelemetry-instrumentation-wsgi==0.47b0.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 ff4933b20b..b6955b0eca 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.46b0.dev" +__version__ = "0.47b0.dev" diff --git a/opentelemetry-distro/pyproject.toml b/opentelemetry-distro/pyproject.toml index 0cec60a63f..cf6b3a671b 100644 --- a/opentelemetry-distro/pyproject.toml +++ b/opentelemetry-distro/pyproject.toml @@ -23,13 +23,13 @@ classifiers = [ ] dependencies = [ "opentelemetry-api ~= 1.12", - "opentelemetry-instrumentation == 0.46b0.dev", + "opentelemetry-instrumentation == 0.47b0.dev", "opentelemetry-sdk ~= 1.13", ] [project.optional-dependencies] otlp = [ - "opentelemetry-exporter-otlp == 1.25.0.dev", + "opentelemetry-exporter-otlp == 1.26.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 ff4933b20b..b6955b0eca 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.46b0.dev" +__version__ = "0.47b0.dev" diff --git a/opentelemetry-instrumentation/src/opentelemetry/instrumentation/bootstrap_gen.py b/opentelemetry-instrumentation/src/opentelemetry/instrumentation/bootstrap_gen.py index 9eebd5bb38..ea8fa48046 100644 --- a/opentelemetry-instrumentation/src/opentelemetry/instrumentation/bootstrap_gen.py +++ b/opentelemetry-instrumentation/src/opentelemetry/instrumentation/bootstrap_gen.py @@ -18,180 +18,180 @@ libraries = [ { "library": "aio_pika >= 7.2.0, < 10.0.0", - "instrumentation": "opentelemetry-instrumentation-aio-pika==0.46b0.dev", + "instrumentation": "opentelemetry-instrumentation-aio-pika==0.47b0.dev", }, { "library": "aiohttp ~= 3.0", - "instrumentation": "opentelemetry-instrumentation-aiohttp-client==0.46b0.dev", + "instrumentation": "opentelemetry-instrumentation-aiohttp-client==0.47b0.dev", }, { "library": "aiohttp ~= 3.0", - "instrumentation": "opentelemetry-instrumentation-aiohttp-server==0.46b0.dev", + "instrumentation": "opentelemetry-instrumentation-aiohttp-server==0.47b0.dev", }, { "library": "aiopg >= 0.13.0, < 2.0.0", - "instrumentation": "opentelemetry-instrumentation-aiopg==0.46b0.dev", + "instrumentation": "opentelemetry-instrumentation-aiopg==0.47b0.dev", }, { "library": "asgiref ~= 3.0", - "instrumentation": "opentelemetry-instrumentation-asgi==0.46b0.dev", + "instrumentation": "opentelemetry-instrumentation-asgi==0.47b0.dev", }, { "library": "asyncpg >= 0.12.0", - "instrumentation": "opentelemetry-instrumentation-asyncpg==0.46b0.dev", + "instrumentation": "opentelemetry-instrumentation-asyncpg==0.47b0.dev", }, { "library": "boto~=2.0", - "instrumentation": "opentelemetry-instrumentation-boto==0.46b0.dev", + "instrumentation": "opentelemetry-instrumentation-boto==0.47b0.dev", }, { "library": "boto3 ~= 1.0", - "instrumentation": "opentelemetry-instrumentation-boto3sqs==0.46b0.dev", + "instrumentation": "opentelemetry-instrumentation-boto3sqs==0.47b0.dev", }, { "library": "botocore ~= 1.0", - "instrumentation": "opentelemetry-instrumentation-botocore==0.46b0.dev", + "instrumentation": "opentelemetry-instrumentation-botocore==0.47b0.dev", }, { "library": "cassandra-driver ~= 3.25", - "instrumentation": "opentelemetry-instrumentation-cassandra==0.46b0.dev", + "instrumentation": "opentelemetry-instrumentation-cassandra==0.47b0.dev", }, { "library": "scylla-driver ~= 3.25", - "instrumentation": "opentelemetry-instrumentation-cassandra==0.46b0.dev", + "instrumentation": "opentelemetry-instrumentation-cassandra==0.47b0.dev", }, { "library": "celery >= 4.0, < 6.0", - "instrumentation": "opentelemetry-instrumentation-celery==0.46b0.dev", + "instrumentation": "opentelemetry-instrumentation-celery==0.47b0.dev", }, { "library": "confluent-kafka >= 1.8.2, <= 2.3.0", - "instrumentation": "opentelemetry-instrumentation-confluent-kafka==0.46b0.dev", + "instrumentation": "opentelemetry-instrumentation-confluent-kafka==0.47b0.dev", }, { "library": "django >= 1.10", - "instrumentation": "opentelemetry-instrumentation-django==0.46b0.dev", + "instrumentation": "opentelemetry-instrumentation-django==0.47b0.dev", }, { "library": "elasticsearch >= 6.0", - "instrumentation": "opentelemetry-instrumentation-elasticsearch==0.46b0.dev", + "instrumentation": "opentelemetry-instrumentation-elasticsearch==0.47b0.dev", }, { "library": "falcon >= 1.4.1, < 3.1.2", - "instrumentation": "opentelemetry-instrumentation-falcon==0.46b0.dev", + "instrumentation": "opentelemetry-instrumentation-falcon==0.47b0.dev", }, { "library": "fastapi ~= 0.58", - "instrumentation": "opentelemetry-instrumentation-fastapi==0.46b0.dev", + "instrumentation": "opentelemetry-instrumentation-fastapi==0.47b0.dev", }, { "library": "flask >= 1.0", - "instrumentation": "opentelemetry-instrumentation-flask==0.46b0.dev", + "instrumentation": "opentelemetry-instrumentation-flask==0.47b0.dev", }, { "library": "grpcio ~= 1.27", - "instrumentation": "opentelemetry-instrumentation-grpc==0.46b0.dev", + "instrumentation": "opentelemetry-instrumentation-grpc==0.47b0.dev", }, { "library": "httpx >= 0.18.0", - "instrumentation": "opentelemetry-instrumentation-httpx==0.46b0.dev", + "instrumentation": "opentelemetry-instrumentation-httpx==0.47b0.dev", }, { "library": "jinja2 >= 2.7, < 4.0", - "instrumentation": "opentelemetry-instrumentation-jinja2==0.46b0.dev", + "instrumentation": "opentelemetry-instrumentation-jinja2==0.47b0.dev", }, { "library": "kafka-python >= 2.0", - "instrumentation": "opentelemetry-instrumentation-kafka-python==0.46b0.dev", + "instrumentation": "opentelemetry-instrumentation-kafka-python==0.47b0.dev", }, { "library": "mysql-connector-python ~= 8.0", - "instrumentation": "opentelemetry-instrumentation-mysql==0.46b0.dev", + "instrumentation": "opentelemetry-instrumentation-mysql==0.47b0.dev", }, { "library": "mysqlclient < 3", - "instrumentation": "opentelemetry-instrumentation-mysqlclient==0.46b0.dev", + "instrumentation": "opentelemetry-instrumentation-mysqlclient==0.47b0.dev", }, { "library": "pika >= 0.12.0", - "instrumentation": "opentelemetry-instrumentation-pika==0.46b0.dev", + "instrumentation": "opentelemetry-instrumentation-pika==0.47b0.dev", }, { "library": "psycopg >= 3.1.0", - "instrumentation": "opentelemetry-instrumentation-psycopg==0.46b0.dev", + "instrumentation": "opentelemetry-instrumentation-psycopg==0.47b0.dev", }, { "library": "psycopg2 >= 2.7.3.1", - "instrumentation": "opentelemetry-instrumentation-psycopg2==0.46b0.dev", + "instrumentation": "opentelemetry-instrumentation-psycopg2==0.47b0.dev", }, { "library": "pymemcache >= 1.3.5, < 5", - "instrumentation": "opentelemetry-instrumentation-pymemcache==0.46b0.dev", + "instrumentation": "opentelemetry-instrumentation-pymemcache==0.47b0.dev", }, { "library": "pymongo >= 3.1, < 5.0", - "instrumentation": "opentelemetry-instrumentation-pymongo==0.46b0.dev", + "instrumentation": "opentelemetry-instrumentation-pymongo==0.47b0.dev", }, { "library": "PyMySQL < 2", - "instrumentation": "opentelemetry-instrumentation-pymysql==0.46b0.dev", + "instrumentation": "opentelemetry-instrumentation-pymysql==0.47b0.dev", }, { "library": "pyramid >= 1.7", - "instrumentation": "opentelemetry-instrumentation-pyramid==0.46b0.dev", + "instrumentation": "opentelemetry-instrumentation-pyramid==0.47b0.dev", }, { "library": "redis >= 2.6", - "instrumentation": "opentelemetry-instrumentation-redis==0.46b0.dev", + "instrumentation": "opentelemetry-instrumentation-redis==0.47b0.dev", }, { "library": "remoulade >= 0.50", - "instrumentation": "opentelemetry-instrumentation-remoulade==0.46b0.dev", + "instrumentation": "opentelemetry-instrumentation-remoulade==0.47b0.dev", }, { "library": "requests ~= 2.0", - "instrumentation": "opentelemetry-instrumentation-requests==0.46b0.dev", + "instrumentation": "opentelemetry-instrumentation-requests==0.47b0.dev", }, { "library": "scikit-learn ~= 0.24.0", - "instrumentation": "opentelemetry-instrumentation-sklearn==0.46b0.dev", + "instrumentation": "opentelemetry-instrumentation-sklearn==0.47b0.dev", }, { "library": "sqlalchemy", - "instrumentation": "opentelemetry-instrumentation-sqlalchemy==0.46b0.dev", + "instrumentation": "opentelemetry-instrumentation-sqlalchemy==0.47b0.dev", }, { "library": "starlette ~= 0.13.0", - "instrumentation": "opentelemetry-instrumentation-starlette==0.46b0.dev", + "instrumentation": "opentelemetry-instrumentation-starlette==0.47b0.dev", }, { "library": "psutil >= 5", - "instrumentation": "opentelemetry-instrumentation-system-metrics==0.46b0.dev", + "instrumentation": "opentelemetry-instrumentation-system-metrics==0.47b0.dev", }, { "library": "tornado >= 5.1.1", - "instrumentation": "opentelemetry-instrumentation-tornado==0.46b0.dev", + "instrumentation": "opentelemetry-instrumentation-tornado==0.47b0.dev", }, { "library": "tortoise-orm >= 0.17.0", - "instrumentation": "opentelemetry-instrumentation-tortoiseorm==0.46b0.dev", + "instrumentation": "opentelemetry-instrumentation-tortoiseorm==0.47b0.dev", }, { "library": "pydantic >= 1.10.2", - "instrumentation": "opentelemetry-instrumentation-tortoiseorm==0.46b0.dev", + "instrumentation": "opentelemetry-instrumentation-tortoiseorm==0.47b0.dev", }, { "library": "urllib3 >= 1.0.0, < 3.0.0", - "instrumentation": "opentelemetry-instrumentation-urllib3==0.46b0.dev", + "instrumentation": "opentelemetry-instrumentation-urllib3==0.47b0.dev", }, ] default_instrumentations = [ - "opentelemetry-instrumentation-asyncio==0.46b0.dev", - "opentelemetry-instrumentation-aws-lambda==0.46b0.dev", - "opentelemetry-instrumentation-dbapi==0.46b0.dev", - "opentelemetry-instrumentation-logging==0.46b0.dev", - "opentelemetry-instrumentation-sqlite3==0.46b0.dev", - "opentelemetry-instrumentation-threading==0.46b0.dev", - "opentelemetry-instrumentation-urllib==0.46b0.dev", - "opentelemetry-instrumentation-wsgi==0.46b0.dev", + "opentelemetry-instrumentation-asyncio==0.47b0.dev", + "opentelemetry-instrumentation-aws-lambda==0.47b0.dev", + "opentelemetry-instrumentation-dbapi==0.47b0.dev", + "opentelemetry-instrumentation-logging==0.47b0.dev", + "opentelemetry-instrumentation-sqlite3==0.47b0.dev", + "opentelemetry-instrumentation-threading==0.47b0.dev", + "opentelemetry-instrumentation-urllib==0.47b0.dev", + "opentelemetry-instrumentation-wsgi==0.47b0.dev", ] diff --git a/opentelemetry-instrumentation/src/opentelemetry/instrumentation/version.py b/opentelemetry-instrumentation/src/opentelemetry/instrumentation/version.py index ff4933b20b..b6955b0eca 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.46b0.dev" +__version__ = "0.47b0.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 ff4933b20b..b6955b0eca 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.46b0.dev" +__version__ = "0.47b0.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 ff4933b20b..b6955b0eca 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.46b0.dev" +__version__ = "0.47b0.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 ff4933b20b..b6955b0eca 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.46b0.dev" +__version__ = "0.47b0.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 ff4933b20b..b6955b0eca 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.46b0.dev" +__version__ = "0.47b0.dev" From 55c829b6c4b86b0b62405369f75270e8c00b907e Mon Sep 17 00:00:00 2001 From: Leighton Chen Date: Fri, 31 May 2024 09:04:58 -0700 Subject: [PATCH 30/56] Update release.yml --- .github/workflows/release.yml | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index b60ebc7599..ec544b43c8 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -81,12 +81,14 @@ jobs: # rejected by pypi (e.g "3 - Beta"). This would cause a failure during the # middle of the package upload causing the action to fail, and certain packages # might have already been updated, this would be bad. - - name: Publish to TestPyPI - env: - TWINE_USERNAME: '__token__' - TWINE_PASSWORD: ${{ secrets.test_pypi_token }} - run: | - twine upload --repository testpypi --skip-existing --verbose dist/* + # EDIT: 5/31/2024 - TestPypi now requires a verified email. Commenting out as a temporary measure + # until we found TestPypi credentials. + # - name: Publish to TestPyPI + # env: + # TWINE_USERNAME: '__token__' + # TWINE_PASSWORD: ${{ secrets.test_pypi_token }} + # run: | + # twine upload --repository testpypi --skip-existing --verbose dist/* - name: Publish to PyPI env: From 73d0fa46a98edebf50acfee3897346913ec8129c Mon Sep 17 00:00:00 2001 From: OpenTelemetry Bot <107717825+opentelemetrybot@users.noreply.github.com> Date: Fri, 31 May 2024 19:00:14 +0200 Subject: [PATCH 31/56] Copy change log updates from release/v1.25.x-0.46bx (#2571) --- CHANGELOG.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 778f16c54b..eca19d3fa8 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -9,12 +9,10 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ### Fixed -- `opentelemetry-instrumentation-dbapi` Fix compatibility with Psycopg3 to extract libpq build version - ([#2500](https://github.com/open-telemetry/opentelemetry-python-contrib/pull/2500)) - `opentelemetry-instrumentation-httpx` Ensure httpx.get or httpx.request like methods are instrumented ([#2538](https://github.com/open-telemetry/opentelemetry-python-contrib/pull/2538)) -## Version 1.25.0/0.46b0 (2024-05-30) +## Version 1.25.0/0.46b0 (2024-05-31) ### Breaking changes @@ -51,6 +49,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ### Fixed +- `opentelemetry-instrumentation-dbapi` Fix compatibility with Psycopg3 to extract libpq build version + ([#2500](https://github.com/open-telemetry/opentelemetry-python-contrib/pull/2500)) - `opentelemetry-instrumentation-grpc` AioClientInterceptor should propagate with a Metadata object ([#2363](https://github.com/open-telemetry/opentelemetry-python-contrib/pull/2363)) - `opentelemetry-instrumentation-boto3sqs` Instrument Session and resource From ed51ebb312fa571ee5a07af871443d97915b89fe Mon Sep 17 00:00:00 2001 From: Pavel Perestoronin Date: Mon, 3 Jun 2024 19:18:47 +0200 Subject: [PATCH 32/56] feat(asgi,fastapi,starlette)!: provide both send and receive hooks with `scope` and `message` (#2546) --- CHANGELOG.md | 1 + .../instrumentation/asgi/__init__.py | 37 +++++++------- .../instrumentation/asgi/types.py | 49 +++++++++++++++++++ .../tests/test_asgi_middleware.py | 6 +-- .../instrumentation/fastapi/__init__.py | 33 ++++++------- .../tests/test_fastapi_instrumentation.py | 12 ++--- .../instrumentation/starlette/__init__.py | 35 ++++++------- .../tests/test_starlette_instrumentation.py | 12 ++--- 8 files changed, 118 insertions(+), 67 deletions(-) create mode 100644 instrumentation/opentelemetry-instrumentation-asgi/src/opentelemetry/instrumentation/asgi/types.py diff --git a/CHANGELOG.md b/CHANGELOG.md index eca19d3fa8..b92f0c62c7 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -27,6 +27,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ([#2425](https://github.com/open-telemetry/opentelemetry-python-contrib/pull/2425)) - `opentelemetry-instrumentation-flask` Add `http.method` to `span.name` ([#2454](https://github.com/open-telemetry/opentelemetry-python-contrib/pull/2454)) +- ASGI, FastAPI, Starlette: provide both send and receive hooks with `scope` and `message` for internal spans ([#2546](https://github.com/open-telemetry/opentelemetry-python-contrib/pull/2546)) ### Added 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 405c470ceb..8edb3420b1 100644 --- a/instrumentation/opentelemetry-instrumentation-asgi/src/opentelemetry/instrumentation/asgi/__init__.py +++ b/instrumentation/opentelemetry-instrumentation-asgi/src/opentelemetry/instrumentation/asgi/__init__.py @@ -81,15 +81,15 @@ async def hello(): .. code-block:: python - def server_request_hook(span: Span, scope: dict): + def server_request_hook(span: Span, scope: dict[str, Any]): if span and span.is_recording(): span.set_attribute("custom_user_attribute_from_request_hook", "some-value") - def client_request_hook(span: Span, scope: dict): + def client_request_hook(span: Span, scope: dict[str, Any], message: dict[str, Any]): if span and span.is_recording(): span.set_attribute("custom_user_attribute_from_client_request_hook", "some-value") - def client_response_hook(span: Span, message: dict): + def client_response_hook(span: Span, scope: dict[str, Any], message: dict[str, Any]): if span and span.is_recording(): span.set_attribute("custom_user_attribute_from_response_hook", "some-value") @@ -200,6 +200,11 @@ def client_response_hook(span: Span, message: dict): from asgiref.compatibility import guarantee_single_callable from opentelemetry import context, trace +from opentelemetry.instrumentation.asgi.types import ( + ClientRequestHook, + ClientResponseHook, + ServerRequestHook, +) from opentelemetry.instrumentation.asgi.version import __version__ # noqa from opentelemetry.instrumentation.propagators import ( get_global_response_propagator, @@ -212,7 +217,7 @@ def client_response_hook(span: Span, message: dict): from opentelemetry.propagators.textmap import Getter, Setter from opentelemetry.semconv.metrics import MetricInstruments from opentelemetry.semconv.trace import SpanAttributes -from opentelemetry.trace import Span, set_span_in_context +from opentelemetry.trace import set_span_in_context from opentelemetry.trace.status import Status, StatusCode from opentelemetry.util.http import ( OTEL_INSTRUMENTATION_HTTP_CAPTURE_HEADERS_SANITIZE_FIELDS, @@ -227,10 +232,6 @@ def client_response_hook(span: Span, message: dict): remove_url_credentials, ) -_ServerRequestHookT = typing.Optional[typing.Callable[[Span, dict], None]] -_ClientRequestHookT = typing.Optional[typing.Callable[[Span, dict], None]] -_ClientResponseHookT = typing.Optional[typing.Callable[[Span, dict], None]] - class ASGIGetter(Getter[dict]): def get( @@ -454,10 +455,10 @@ class OpenTelemetryMiddleware: Optional: Defaults to get_default_span_details. 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 an ASGI - scope which is sent as a dictionary for when the method receive is called. - client_response_hook: Optional callback which is called with the internal span and an ASGI - event which is sent as a dictionary for when the method send is called. + 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. """ @@ -468,9 +469,9 @@ def __init__( app, excluded_urls=None, default_span_details=None, - server_request_hook: _ServerRequestHookT = None, - client_request_hook: _ClientRequestHookT = None, - client_response_hook: _ClientResponseHookT = None, + server_request_hook: ServerRequestHook = None, + client_request_hook: ClientRequestHook = None, + client_response_hook: ClientResponseHook = None, tracer_provider=None, meter_provider=None, meter=None, @@ -666,9 +667,9 @@ async def otel_receive(): with self.tracer.start_as_current_span( " ".join((server_span_name, scope["type"], "receive")) ) as receive_span: - if callable(self.client_request_hook): - self.client_request_hook(receive_span, scope) message = await receive() + if callable(self.client_request_hook): + self.client_request_hook(receive_span, scope, message) if receive_span.is_recording(): if message["type"] == "websocket.receive": set_status_code(receive_span, 200) @@ -691,7 +692,7 @@ async def otel_send(message: dict[str, Any]): " ".join((server_span_name, scope["type"], "send")) ) as send_span: if callable(self.client_response_hook): - self.client_response_hook(send_span, message) + self.client_response_hook(send_span, scope, message) if send_span.is_recording(): if message["type"] == "http.response.start": status_code = message["status"] diff --git a/instrumentation/opentelemetry-instrumentation-asgi/src/opentelemetry/instrumentation/asgi/types.py b/instrumentation/opentelemetry-instrumentation-asgi/src/opentelemetry/instrumentation/asgi/types.py new file mode 100644 index 0000000000..bc0c11afc9 --- /dev/null +++ b/instrumentation/opentelemetry-instrumentation-asgi/src/opentelemetry/instrumentation/asgi/types.py @@ -0,0 +1,49 @@ +# 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 typing import Any, Callable, Dict, Optional + +from opentelemetry.trace import Span + +_Scope = Dict[str, Any] +_Message = Dict[str, Any] + +ServerRequestHook = Optional[Callable[[Span, _Scope], None]] +""" +Incoming request callback type. + +Args: + - Server span + - ASGI scope as a mapping +""" + +ClientRequestHook = Optional[Callable[[Span, _Scope, _Message], None]] +""" +Receive callback type. + +Args: + - Internal span + - ASGI scope as a mapping + - ASGI event as a mapping +""" + +ClientResponseHook = Optional[Callable[[Span, _Scope, _Message], None]] +""" +Send callback type. + +Args: + - Internal span + - ASGI scope as a mapping + - ASGI event as a mapping +""" diff --git a/instrumentation/opentelemetry-instrumentation-asgi/tests/test_asgi_middleware.py b/instrumentation/opentelemetry-instrumentation-asgi/tests/test_asgi_middleware.py index 2a8fd1c1f0..902cd4ec7e 100644 --- a/instrumentation/opentelemetry-instrumentation-asgi/tests/test_asgi_middleware.py +++ b/instrumentation/opentelemetry-instrumentation-asgi/tests/test_asgi_middleware.py @@ -683,10 +683,10 @@ def test_hooks(self): def server_request_hook(span, scope): span.update_name("name from server hook") - def client_request_hook(recieve_span, request): - recieve_span.update_name("name from client request hook") + def client_request_hook(receive_span, scope, message): + receive_span.update_name("name from client request hook") - def client_response_hook(send_span, response): + def client_response_hook(send_span, scope, message): send_span.set_attribute("attr-from-hook", "value") def update_expected_hook_results(expected): 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 10b73c7a5b..6f52c6ef3b 100644 --- a/instrumentation/opentelemetry-instrumentation-fastapi/src/opentelemetry/instrumentation/fastapi/__init__.py +++ b/instrumentation/opentelemetry-instrumentation-fastapi/src/opentelemetry/instrumentation/fastapi/__init__.py @@ -59,20 +59,20 @@ async def foobar(): right after a span is created for a request and right before the span is finished for the response. - The server request hook is passed a server span and ASGI scope object for every incoming request. -- The client request hook is called with the internal span and an ASGI scope when the method ``receive`` is called. -- The client response hook is called with the internal span and an ASGI event when the method ``send`` is called. +- The client request hook is called with the internal span, and ASGI scope and event when the method ``receive`` is called. +- The client response hook is called with the internal span, and ASGI scope and event when the method ``send`` is called. .. code-block:: python - def server_request_hook(span: Span, scope: dict): + def server_request_hook(span: Span, scope: dict[str, Any]): if span and span.is_recording(): span.set_attribute("custom_user_attribute_from_request_hook", "some-value") - def client_request_hook(span: Span, scope: dict): + def client_request_hook(span: Span, scope: dict[str, Any], message: dict[str, Any]): if span and span.is_recording(): span.set_attribute("custom_user_attribute_from_client_request_hook", "some-value") - def client_response_hook(span: Span, message: dict): + def client_response_hook(span: Span, scope: dict[str, Any], message: dict[str, Any]): if span and span.is_recording(): span.set_attribute("custom_user_attribute_from_response_hook", "some-value") @@ -172,28 +172,27 @@ def client_response_hook(span: Span, message: dict): --- """ import logging -import typing from typing import Collection import fastapi from starlette.routing import Match from opentelemetry.instrumentation.asgi import OpenTelemetryMiddleware +from opentelemetry.instrumentation.asgi.types import ( + ClientRequestHook, + ClientResponseHook, + ServerRequestHook, +) from opentelemetry.instrumentation.fastapi.package import _instruments from opentelemetry.instrumentation.fastapi.version import __version__ from opentelemetry.instrumentation.instrumentor import BaseInstrumentor from opentelemetry.metrics import get_meter from opentelemetry.semconv.trace import SpanAttributes -from opentelemetry.trace import Span from opentelemetry.util.http import get_excluded_urls, parse_excluded_urls _excluded_urls_from_env = get_excluded_urls("FASTAPI") _logger = logging.getLogger(__name__) -_ServerRequestHookT = typing.Optional[typing.Callable[[Span, dict], None]] -_ClientRequestHookT = typing.Optional[typing.Callable[[Span, dict], None]] -_ClientResponseHookT = typing.Optional[typing.Callable[[Span, dict], None]] - class FastAPIInstrumentor(BaseInstrumentor): """An instrumentor for FastAPI @@ -206,9 +205,9 @@ class FastAPIInstrumentor(BaseInstrumentor): @staticmethod def instrument_app( app: fastapi.FastAPI, - server_request_hook: _ServerRequestHookT = None, - client_request_hook: _ClientRequestHookT = None, - client_response_hook: _ClientResponseHookT = None, + server_request_hook: ServerRequestHook = None, + client_request_hook: ClientRequestHook = None, + client_response_hook: ClientResponseHook = None, tracer_provider=None, meter_provider=None, excluded_urls=None, @@ -292,9 +291,9 @@ class _InstrumentedFastAPI(fastapi.FastAPI): _tracer_provider = None _meter_provider = None _excluded_urls = None - _server_request_hook: _ServerRequestHookT = None - _client_request_hook: _ClientRequestHookT = None - _client_response_hook: _ClientResponseHookT = None + _server_request_hook: ServerRequestHook = None + _client_request_hook: ClientRequestHook = None + _client_response_hook: ClientResponseHook = None _instrumented_fastapi_apps = set() def __init__(self, *args, **kwargs): diff --git a/instrumentation/opentelemetry-instrumentation-fastapi/tests/test_fastapi_instrumentation.py b/instrumentation/opentelemetry-instrumentation-fastapi/tests/test_fastapi_instrumentation.py index f9261ad5db..5cf9a0d590 100644 --- a/instrumentation/opentelemetry-instrumentation-fastapi/tests/test_fastapi_instrumentation.py +++ b/instrumentation/opentelemetry-instrumentation-fastapi/tests/test_fastapi_instrumentation.py @@ -342,23 +342,23 @@ def server_request_hook(self, span, scope): if self._server_request_hook is not None: self._server_request_hook(span, scope) - def client_request_hook(self, receive_span, request): + def client_request_hook(self, receive_span, scope, message): if self._client_request_hook is not None: - self._client_request_hook(receive_span, request) + self._client_request_hook(receive_span, scope, message) - def client_response_hook(self, send_span, response): + def client_response_hook(self, send_span, scope, message): if self._client_response_hook is not None: - self._client_response_hook(send_span, response) + self._client_response_hook(send_span, scope, message) def test_hooks(self): def server_request_hook(span, scope): span.update_name("name from server hook") - def client_request_hook(receive_span, request): + def client_request_hook(receive_span, scope, message): receive_span.update_name("name from client hook") receive_span.set_attribute("attr-from-request-hook", "set") - def client_response_hook(send_span, response): + def client_response_hook(send_span, scope, message): send_span.update_name("name from response hook") send_span.set_attribute("attr-from-response-hook", "value") diff --git a/instrumentation/opentelemetry-instrumentation-starlette/src/opentelemetry/instrumentation/starlette/__init__.py b/instrumentation/opentelemetry-instrumentation-starlette/src/opentelemetry/instrumentation/starlette/__init__.py index 1ebc3348d4..83f5b5c52b 100644 --- a/instrumentation/opentelemetry-instrumentation-starlette/src/opentelemetry/instrumentation/starlette/__init__.py +++ b/instrumentation/opentelemetry-instrumentation-starlette/src/opentelemetry/instrumentation/starlette/__init__.py @@ -55,20 +55,22 @@ def home(request): right after a span is created for a request and right before the span is finished for the response. - The server request hook is passed a server span and ASGI scope object for every incoming request. -- The client request hook is called with the internal span and an ASGI scope when the method ``receive`` is called. -- The client response hook is called with the internal span and an ASGI event when the method ``send`` is called. +- The client request hook is called with the internal span, and ASGI scope and event when the method ``receive`` is called. +- The client response hook is called with the internal span, and ASGI scope and event when the method ``send`` is called. For example, .. code-block:: python - def server_request_hook(span: Span, scope: dict): + def server_request_hook(span: Span, scope: dict[str, Any]): if span and span.is_recording(): span.set_attribute("custom_user_attribute_from_request_hook", "some-value") - def client_request_hook(span: Span, scope: dict): + + def client_request_hook(span: Span, scope: dict[str, Any], message: dict[str, Any]): if span and span.is_recording(): span.set_attribute("custom_user_attribute_from_client_request_hook", "some-value") - def client_response_hook(span: Span, message: dict): + + def client_response_hook(span: Span, scope: dict[str, Any], message: dict[str, Any]): if span and span.is_recording(): span.set_attribute("custom_user_attribute_from_response_hook", "some-value") @@ -167,27 +169,26 @@ def client_response_hook(span: Span, message: dict): API --- """ -import typing from typing import Collection from starlette import applications from starlette.routing import Match from opentelemetry.instrumentation.asgi import OpenTelemetryMiddleware +from opentelemetry.instrumentation.asgi.types import ( + ClientRequestHook, + ClientResponseHook, + ServerRequestHook, +) from opentelemetry.instrumentation.instrumentor import BaseInstrumentor from opentelemetry.instrumentation.starlette.package import _instruments from opentelemetry.instrumentation.starlette.version import __version__ from opentelemetry.metrics import get_meter from opentelemetry.semconv.trace import SpanAttributes -from opentelemetry.trace import Span from opentelemetry.util.http import get_excluded_urls _excluded_urls = get_excluded_urls("STARLETTE") -_ServerRequestHookT = typing.Optional[typing.Callable[[Span, dict], None]] -_ClientRequestHookT = typing.Optional[typing.Callable[[Span, dict], None]] -_ClientResponseHookT = typing.Optional[typing.Callable[[Span, dict], None]] - class StarletteInstrumentor(BaseInstrumentor): """An instrumentor for starlette @@ -200,9 +201,9 @@ class StarletteInstrumentor(BaseInstrumentor): @staticmethod def instrument_app( app: applications.Starlette, - server_request_hook: _ServerRequestHookT = None, - client_request_hook: _ClientRequestHookT = None, - client_response_hook: _ClientResponseHookT = None, + server_request_hook: ServerRequestHook = None, + client_request_hook: ClientRequestHook = None, + client_response_hook: ClientResponseHook = None, meter_provider=None, tracer_provider=None, ): @@ -270,9 +271,9 @@ def _uninstrument(self, **kwargs): class _InstrumentedStarlette(applications.Starlette): _tracer_provider = None _meter_provider = None - _server_request_hook: _ServerRequestHookT = None - _client_request_hook: _ClientRequestHookT = None - _client_response_hook: _ClientResponseHookT = None + _server_request_hook: ServerRequestHook = None + _client_request_hook: ClientRequestHook = None + _client_response_hook: ClientResponseHook = None _instrumented_starlette_apps = set() def __init__(self, *args, **kwargs): diff --git a/instrumentation/opentelemetry-instrumentation-starlette/tests/test_starlette_instrumentation.py b/instrumentation/opentelemetry-instrumentation-starlette/tests/test_starlette_instrumentation.py index 3784672fb5..0accda18fd 100644 --- a/instrumentation/opentelemetry-instrumentation-starlette/tests/test_starlette_instrumentation.py +++ b/instrumentation/opentelemetry-instrumentation-starlette/tests/test_starlette_instrumentation.py @@ -263,23 +263,23 @@ def server_request_hook(self, span, scope): if self._server_request_hook is not None: self._server_request_hook(span, scope) - def client_request_hook(self, receive_span, request): + def client_request_hook(self, receive_span, scope, message): if self._client_request_hook is not None: - self._client_request_hook(receive_span, request) + self._client_request_hook(receive_span, scope, message) - def client_response_hook(self, send_span, response): + def client_response_hook(self, send_span, scope, message): if self._client_response_hook is not None: - self._client_response_hook(send_span, response) + self._client_response_hook(send_span, scope, message) def test_hooks(self): def server_request_hook(span, scope): span.update_name("name from server hook") - def client_request_hook(receive_span, request): + def client_request_hook(receive_span, scope, message): receive_span.update_name("name from client hook") receive_span.set_attribute("attr-from-request-hook", "set") - def client_response_hook(send_span, response): + def client_response_hook(send_span, scope, message): send_span.update_name("name from response hook") send_span.set_attribute("attr-from-response-hook", "value") From 768694cf7578e6a211c42049c85ef7227eea6b48 Mon Sep 17 00:00:00 2001 From: Alex Boten <223565+codeboten@users.noreply.github.com> Date: Mon, 3 Jun 2024 14:20:09 -0700 Subject: [PATCH 33/56] add processor directory to build.sh (#2574) --- scripts/build.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/build.sh b/scripts/build.sh index 247bb24b4e..93dc0edce1 100755 --- a/scripts/build.sh +++ b/scripts/build.sh @@ -16,7 +16,7 @@ DISTDIR=dist mkdir -p $DISTDIR rm -rf ${DISTDIR:?}/* - for d in exporter/*/ opentelemetry-instrumentation/ opentelemetry-contrib-instrumentations/ opentelemetry-distro/ instrumentation/*/ propagator/*/ resource/*/ sdk-extension/*/ util/*/ ; do + for d in exporter/*/ opentelemetry-instrumentation/ opentelemetry-contrib-instrumentations/ opentelemetry-distro/ instrumentation/*/ processor/*/ propagator/*/ resource/*/ sdk-extension/*/ util/*/ ; do ( echo "building $d" cd "$d" From c06fd1dd534513ae26c16ed5eb5916a5f8eb4cf0 Mon Sep 17 00:00:00 2001 From: Leighton Chen Date: Tue, 4 Jun 2024 09:19:48 -0700 Subject: [PATCH 34/56] Update README.rst (#2575) --- .../opentelemetry-processor-baggage/README.rst | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/processor/opentelemetry-processor-baggage/README.rst b/processor/opentelemetry-processor-baggage/README.rst index a111166cef..83c4e91edf 100644 --- a/processor/opentelemetry-processor-baggage/README.rst +++ b/processor/opentelemetry-processor-baggage/README.rst @@ -1,10 +1,22 @@ OpenTelemetry Baggage Span Processor ==================================== +|pypi| + +.. |pypi| image:: https://badge.fury.io/py/opentelemetry-processor-baggage.svg + :target: https://pypi.org/project/opentelemetry-processor-baggage/ + The BaggageSpanProcessor reads entries stored in Baggage from the parent context and adds the baggage entries' keys and values to the span as attributes on span start. +Installation +------------ + +:: + + pip install opentelemetry-processor-baggage + Add this span processor to a tracer provider. Keys and values added to Baggage will appear on subsequent child @@ -48,4 +60,4 @@ For example, to only copy baggage entries that match the regex `^key.+`: ```python regex_predicate = lambda baggage_key: baggage_key.startswith("^key.+") tracer_provider.add_span_processor(BaggageSpanProcessor(regex_predicate)) -``` \ No newline at end of file +``` From 95fea2bfa7eb885912752ca954db0711f96c8ab5 Mon Sep 17 00:00:00 2001 From: Riccardo Magliocchetti Date: Wed, 5 Jun 2024 20:14:44 +0200 Subject: [PATCH 35/56] Fix running async psycopg tests (#2540) --- .../test-requirements.txt | 1 - .../tests/test_aio_client_interceptor.py | 18 +- .../test_aio_client_interceptor_filter.py | 20 +- .../test_aio_client_interceptor_hooks.py | 18 +- .../tests/test_aio_server_interceptor.py | 19 +- .../test_aio_server_interceptor_filter.py | 18 +- .../tests/test_psycopg_integration.py | 219 +++++++++--------- tox.ini | 1 - 8 files changed, 120 insertions(+), 194 deletions(-) diff --git a/instrumentation/opentelemetry-instrumentation-grpc/test-requirements.txt b/instrumentation/opentelemetry-instrumentation-grpc/test-requirements.txt index 56d47af0df..9303dc27c0 100644 --- a/instrumentation/opentelemetry-instrumentation-grpc/test-requirements.txt +++ b/instrumentation/opentelemetry-instrumentation-grpc/test-requirements.txt @@ -10,7 +10,6 @@ protobuf==3.20.3 py==1.11.0 py-cpuinfo==9.0.0 pytest==7.1.3 -pytest-asyncio==0.23.5 pytest-benchmark==4.0.0 tomli==2.0.1 typing_extensions==4.9.0 diff --git a/instrumentation/opentelemetry-instrumentation-grpc/tests/test_aio_client_interceptor.py b/instrumentation/opentelemetry-instrumentation-grpc/tests/test_aio_client_interceptor.py index 21dbc44066..7ae1649149 100644 --- a/instrumentation/opentelemetry-instrumentation-grpc/tests/test_aio_client_interceptor.py +++ b/instrumentation/opentelemetry-instrumentation-grpc/tests/test_aio_client_interceptor.py @@ -11,24 +11,9 @@ # 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. -try: - from unittest import IsolatedAsyncioTestCase -except ImportError: - # unittest.IsolatedAsyncioTestCase was introduced in Python 3.8. It's use - # simplifies the following tests. Without it, the amount of test code - # increases significantly, with most of the additional code handling - # the asyncio set up. - from unittest import TestCase - - class IsolatedAsyncioTestCase(TestCase): - def run(self, result=None): - self.skipTest( - "This test requires Python 3.8 for unittest.IsolatedAsyncioTestCase" - ) - +from unittest import IsolatedAsyncioTestCase import grpc -import pytest import opentelemetry.instrumentation.grpc from opentelemetry import trace @@ -65,7 +50,6 @@ async def intercept_unary_unary( return await continuation(client_call_details, request) -@pytest.mark.asyncio class TestAioClientInterceptor(TestBase, IsolatedAsyncioTestCase): def setUp(self): super().setUp() diff --git a/instrumentation/opentelemetry-instrumentation-grpc/tests/test_aio_client_interceptor_filter.py b/instrumentation/opentelemetry-instrumentation-grpc/tests/test_aio_client_interceptor_filter.py index b8c408c6cf..2bd68fd492 100644 --- a/instrumentation/opentelemetry-instrumentation-grpc/tests/test_aio_client_interceptor_filter.py +++ b/instrumentation/opentelemetry-instrumentation-grpc/tests/test_aio_client_interceptor_filter.py @@ -11,27 +11,10 @@ # 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. -try: - from unittest import IsolatedAsyncioTestCase -except ImportError: - # unittest.IsolatedAsyncioTestCase was introduced in Python 3.8. It's use - # simplifies the following tests. Without it, the amount of test code - # increases significantly, with most of the additional code handling - # the asyncio set up. - from unittest import TestCase - - class IsolatedAsyncioTestCase(TestCase): - def run(self, result=None): - self.skipTest( - "This test requires Python 3.8 for unittest.IsolatedAsyncioTestCase" - ) - - import os -from unittest import mock +from unittest import IsolatedAsyncioTestCase, mock import grpc -import pytest from opentelemetry.instrumentation.grpc import ( GrpcAioInstrumentorClient, @@ -50,7 +33,6 @@ def run(self, result=None): from .protobuf import test_server_pb2_grpc # pylint: disable=no-name-in-module -@pytest.mark.asyncio class TestAioClientInterceptorFiltered(TestBase, IsolatedAsyncioTestCase): def setUp(self): super().setUp() diff --git a/instrumentation/opentelemetry-instrumentation-grpc/tests/test_aio_client_interceptor_hooks.py b/instrumentation/opentelemetry-instrumentation-grpc/tests/test_aio_client_interceptor_hooks.py index 9086d8b0f7..40c2334ae7 100644 --- a/instrumentation/opentelemetry-instrumentation-grpc/tests/test_aio_client_interceptor_hooks.py +++ b/instrumentation/opentelemetry-instrumentation-grpc/tests/test_aio_client_interceptor_hooks.py @@ -11,24 +11,9 @@ # 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. -try: - from unittest import IsolatedAsyncioTestCase -except ImportError: - # unittest.IsolatedAsyncioTestCase was introduced in Python 3.8. It's use - # simplifies the following tests. Without it, the amount of test code - # increases significantly, with most of the additional code handling - # the asyncio set up. - from unittest import TestCase - - class IsolatedAsyncioTestCase(TestCase): - def run(self, result=None): - self.skipTest( - "This test requires Python 3.8 for unittest.IsolatedAsyncioTestCase" - ) - +from unittest import IsolatedAsyncioTestCase import grpc -import pytest from opentelemetry.instrumentation.grpc import GrpcAioInstrumentorClient from opentelemetry.test.test_base import TestBase @@ -54,7 +39,6 @@ def response_hook_with_exception(_span, _response): raise Exception() # pylint: disable=broad-exception-raised -@pytest.mark.asyncio class TestAioClientInterceptorWithHooks(TestBase, IsolatedAsyncioTestCase): def setUp(self): super().setUp() diff --git a/instrumentation/opentelemetry-instrumentation-grpc/tests/test_aio_server_interceptor.py b/instrumentation/opentelemetry-instrumentation-grpc/tests/test_aio_server_interceptor.py index 7b31b085de..050f6f8d13 100644 --- a/instrumentation/opentelemetry-instrumentation-grpc/tests/test_aio_server_interceptor.py +++ b/instrumentation/opentelemetry-instrumentation-grpc/tests/test_aio_server_interceptor.py @@ -12,26 +12,10 @@ # See the License for the specific language governing permissions and # limitations under the License. import asyncio - -try: - from unittest import IsolatedAsyncioTestCase -except ImportError: - # unittest.IsolatedAsyncioTestCase was introduced in Python 3.8. It's use - # simplifies the following tests. Without it, the amount of test code - # increases significantly, with most of the additional code handling - # the asyncio set up. - from unittest import TestCase - - class IsolatedAsyncioTestCase(TestCase): - def run(self, result=None): - self.skipTest( - "This test requires Python 3.8 for unittest.IsolatedAsyncioTestCase" - ) - +from unittest import IsolatedAsyncioTestCase import grpc import grpc.aio -import pytest import opentelemetry.instrumentation.grpc from opentelemetry import trace @@ -97,7 +81,6 @@ async def run_with_test_server( return resp -@pytest.mark.asyncio class TestOpenTelemetryAioServerInterceptor(TestBase, IsolatedAsyncioTestCase): async def test_instrumentor(self): """Check that automatic instrumentation configures the interceptor""" diff --git a/instrumentation/opentelemetry-instrumentation-grpc/tests/test_aio_server_interceptor_filter.py b/instrumentation/opentelemetry-instrumentation-grpc/tests/test_aio_server_interceptor_filter.py index 837d9c7618..34b755ced8 100644 --- a/instrumentation/opentelemetry-instrumentation-grpc/tests/test_aio_server_interceptor_filter.py +++ b/instrumentation/opentelemetry-instrumentation-grpc/tests/test_aio_server_interceptor_filter.py @@ -11,25 +11,10 @@ # 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. -try: - from unittest import IsolatedAsyncioTestCase -except ImportError: - # unittest.IsolatedAsyncioTestCase was introduced in Python 3.8. It's use - # simplifies the following tests. Without it, the amount of test code - # increases significantly, with most of the additional code handling - # the asyncio set up. - from unittest import TestCase - - class IsolatedAsyncioTestCase(TestCase): - def run(self, result=None): - self.skipTest( - "This test requires Python 3.8 for unittest.IsolatedAsyncioTestCase" - ) - +from unittest import IsolatedAsyncioTestCase import grpc import grpc.aio -import pytest from opentelemetry import trace from opentelemetry.instrumentation.grpc import ( @@ -68,7 +53,6 @@ async def run_with_test_server( return resp -@pytest.mark.asyncio class TestOpenTelemetryAioServerInterceptor(TestBase, IsolatedAsyncioTestCase): async def test_instrumentor(self): """Check that automatic instrumentation configures the interceptor""" diff --git a/instrumentation/opentelemetry-instrumentation-psycopg/tests/test_psycopg_integration.py b/instrumentation/opentelemetry-instrumentation-psycopg/tests/test_psycopg_integration.py index e2b3ed917a..5a5b39d80b 100644 --- a/instrumentation/opentelemetry-instrumentation-psycopg/tests/test_psycopg_integration.py +++ b/instrumentation/opentelemetry-instrumentation-psycopg/tests/test_psycopg_integration.py @@ -12,9 +12,8 @@ # See the License for the specific language governing permissions and # limitations under the License. -import asyncio import types -from unittest import mock +from unittest import IsolatedAsyncioTestCase, mock import psycopg @@ -114,6 +113,10 @@ def cursor(self): return cur return MockAsyncCursor() + def execute(self, query, params=None, *, prepare=None, binary=False): + cur = self.cursor() + return cur.execute(query, params, prepare=prepare) + def get_dsn_parameters(self): # pylint: disable=no-self-use return {"dbname": "test"} @@ -124,7 +127,8 @@ async def __aexit__(self, *args): return mock.MagicMock(spec=types.MethodType) -class TestPostgresqlIntegration(TestBase): +class PostgresqlIntegrationTestMixin: + # pylint: disable=invalid-name def setUp(self): super().setUp() self.cursor_mock = mock.patch( @@ -148,6 +152,7 @@ def setUp(self): self.connection_sync_mock.start() self.connection_async_mock.start() + # pylint: disable=invalid-name def tearDown(self): super().tearDown() self.memory_exporter.clear() @@ -159,6 +164,8 @@ def tearDown(self): with self.disable_logging(): PsycopgInstrumentor().uninstrument() + +class TestPostgresqlIntegration(PostgresqlIntegrationTestMixin, TestBase): # pylint: disable=unused-argument def test_instrumentor(self): PsycopgInstrumentor().instrument() @@ -221,60 +228,6 @@ def test_instrumentor_with_connection_class(self): spans_list = self.memory_exporter.get_finished_spans() self.assertEqual(len(spans_list), 1) - async def test_wrap_async_connection_class_with_cursor(self): - PsycopgInstrumentor().instrument() - - async def test_async_connection(): - acnx = await psycopg.AsyncConnection.connect(database="test") - async with acnx as cnx: - async with cnx.cursor() as cursor: - await cursor.execute("SELECT * FROM test") - - asyncio.run(test_async_connection()) - spans_list = self.memory_exporter.get_finished_spans() - self.assertEqual(len(spans_list), 1) - span = spans_list[0] - - # Check version and name in span's instrumentation info - self.assertEqualSpanInstrumentationInfo( - span, opentelemetry.instrumentation.psycopg - ) - - # check that no spans are generated after uninstrument - PsycopgInstrumentor().uninstrument() - - asyncio.run(test_async_connection()) - - spans_list = self.memory_exporter.get_finished_spans() - self.assertEqual(len(spans_list), 1) - - # pylint: disable=unused-argument - async def test_instrumentor_with_async_connection_class(self): - PsycopgInstrumentor().instrument() - - async def test_async_connection(): - acnx = await psycopg.AsyncConnection.connect(database="test") - async with acnx as cnx: - await cnx.execute("SELECT * FROM test") - - asyncio.run(test_async_connection()) - - spans_list = self.memory_exporter.get_finished_spans() - self.assertEqual(len(spans_list), 1) - span = spans_list[0] - - # Check version and name in span's instrumentation info - self.assertEqualSpanInstrumentationInfo( - span, opentelemetry.instrumentation.psycopg - ) - - # check that no spans are generated after uninstrument - PsycopgInstrumentor().uninstrument() - asyncio.run(test_async_connection()) - - spans_list = self.memory_exporter.get_finished_spans() - self.assertEqual(len(spans_list), 1) - def test_span_name(self): PsycopgInstrumentor().instrument() @@ -301,33 +254,6 @@ def test_span_name(self): self.assertEqual(spans_list[4].name, "query") self.assertEqual(spans_list[5].name, "query") - async def test_span_name_async(self): - PsycopgInstrumentor().instrument() - - cnx = psycopg.AsyncConnection.connect(database="test") - async with cnx.cursor() as cursor: - await cursor.execute("Test query", ("param1Value", False)) - await cursor.execute( - """multi - line - query""" - ) - await cursor.execute("tab\tseparated query") - await cursor.execute("/* leading comment */ query") - await cursor.execute( - "/* leading comment */ query /* trailing comment */" - ) - await cursor.execute("query /* trailing comment */") - - spans_list = self.memory_exporter.get_finished_spans() - self.assertEqual(len(spans_list), 6) - self.assertEqual(spans_list[0].name, "Test") - self.assertEqual(spans_list[1].name, "multi") - self.assertEqual(spans_list[2].name, "tab") - self.assertEqual(spans_list[3].name, "query") - self.assertEqual(spans_list[4].name, "query") - self.assertEqual(spans_list[5].name, "query") - # pylint: disable=unused-argument def test_not_recording(self): mock_tracer = mock.Mock() @@ -348,26 +274,6 @@ def test_not_recording(self): PsycopgInstrumentor().uninstrument() - # pylint: disable=unused-argument - async def test_not_recording_async(self): - mock_tracer = mock.Mock() - mock_span = mock.Mock() - mock_span.is_recording.return_value = False - mock_tracer.start_span.return_value = mock_span - PsycopgInstrumentor().instrument() - with mock.patch("opentelemetry.trace.get_tracer") as tracer: - tracer.return_value = mock_tracer - cnx = psycopg.AsyncConnection.connect(database="test") - async with cnx.cursor() as cursor: - query = "SELECT * FROM test" - cursor.execute(query) - 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) - - PsycopgInstrumentor().uninstrument() - # pylint: disable=unused-argument def test_custom_tracer_provider(self): resource = resources.Resource.create({}) @@ -477,3 +383,108 @@ def test_sqlcommenter_disabled(self, event_mocked): cursor.execute(query) kwargs = event_mocked.call_args[1] self.assertEqual(kwargs["enable_commenter"], False) + + +class TestPostgresqlIntegrationAsync( + PostgresqlIntegrationTestMixin, TestBase, IsolatedAsyncioTestCase +): + async def test_wrap_async_connection_class_with_cursor(self): + PsycopgInstrumentor().instrument() + + async def test_async_connection(): + acnx = await psycopg.AsyncConnection.connect("test") + async with acnx as cnx: + async with cnx.cursor() as cursor: + await cursor.execute("SELECT * FROM test") + + await test_async_connection() + spans_list = self.memory_exporter.get_finished_spans() + self.assertEqual(len(spans_list), 1) + span = spans_list[0] + + # Check version and name in span's instrumentation info + self.assertEqualSpanInstrumentationInfo( + span, opentelemetry.instrumentation.psycopg + ) + + # check that no spans are generated after uninstrument + PsycopgInstrumentor().uninstrument() + + await test_async_connection() + + spans_list = self.memory_exporter.get_finished_spans() + self.assertEqual(len(spans_list), 1) + + # pylint: disable=unused-argument + async def test_instrumentor_with_async_connection_class(self): + PsycopgInstrumentor().instrument() + + async def test_async_connection(): + acnx = await psycopg.AsyncConnection.connect("test") + async with acnx as cnx: + await cnx.execute("SELECT * FROM test") + + await test_async_connection() + + spans_list = self.memory_exporter.get_finished_spans() + self.assertEqual(len(spans_list), 1) + span = spans_list[0] + + # Check version and name in span's instrumentation info + self.assertEqualSpanInstrumentationInfo( + span, opentelemetry.instrumentation.psycopg + ) + + # check that no spans are generated after uninstrument + PsycopgInstrumentor().uninstrument() + await test_async_connection() + + spans_list = self.memory_exporter.get_finished_spans() + self.assertEqual(len(spans_list), 1) + + async def test_span_name_async(self): + PsycopgInstrumentor().instrument() + + cnx = await psycopg.AsyncConnection.connect("test") + async with cnx.cursor() as cursor: + await cursor.execute("Test query", ("param1Value", False)) + await cursor.execute( + """multi + line + query""" + ) + await cursor.execute("tab\tseparated query") + await cursor.execute("/* leading comment */ query") + await cursor.execute( + "/* leading comment */ query /* trailing comment */" + ) + await cursor.execute("query /* trailing comment */") + + spans_list = self.memory_exporter.get_finished_spans() + self.assertEqual(len(spans_list), 6) + self.assertEqual(spans_list[0].name, "Test") + self.assertEqual(spans_list[1].name, "multi") + self.assertEqual(spans_list[2].name, "tab") + self.assertEqual(spans_list[3].name, "query") + self.assertEqual(spans_list[4].name, "query") + self.assertEqual(spans_list[5].name, "query") + + # pylint: disable=unused-argument + async def test_not_recording_async(self): + mock_tracer = mock.Mock() + mock_span = mock.Mock() + mock_span.is_recording.return_value = False + mock_tracer.start_span.return_value = mock_span + PsycopgInstrumentor().instrument() + with mock.patch("opentelemetry.trace.get_tracer") as tracer: + tracer.return_value = mock_tracer + cnx = await psycopg.AsyncConnection.connect("test") + async with cnx.cursor() as cursor: + query = "SELECT * FROM test" + await cursor.execute(query) + 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) + + PsycopgInstrumentor().uninstrument() diff --git a/tox.ini b/tox.ini index e97476a850..63c80083d4 100644 --- a/tox.ini +++ b/tox.ini @@ -373,7 +373,6 @@ deps = test: pytest-benchmark coverage: pytest coverage: pytest-cov - grpc: pytest-asyncio ; FIXME: add coverage testing ; FIXME: add mypy testing From e306aba7ecf6aac9c1ae4130514886205e696045 Mon Sep 17 00:00:00 2001 From: soumyadeepm04 <84105194+soumyadeepm04@users.noreply.github.com> Date: Wed, 5 Jun 2024 14:35:48 -0400 Subject: [PATCH 36/56] removed references to [test] extras from eachdist script (#2578) --- scripts/eachdist.py | 14 ++------------ 1 file changed, 2 insertions(+), 12 deletions(-) diff --git a/scripts/eachdist.py b/scripts/eachdist.py index 570a0cd0e5..2eaabee2c7 100755 --- a/scripts/eachdist.py +++ b/scripts/eachdist.py @@ -198,7 +198,6 @@ def setup_instparser(instparser): setup_instparser(instparser) instparser.add_argument("--editable", "-e", action="store_true") - instparser.add_argument("--with-test-deps", action="store_true") instparser.add_argument("--with-dev-deps", action="store_true") instparser.add_argument("--eager-upgrades", action="store_true") @@ -211,7 +210,6 @@ def setup_instparser(instparser): editable=True, with_dev_deps=True, eager_upgrades=True, - with_test_deps=True, ) lintparser = subparsers.add_parser( @@ -467,16 +465,7 @@ def install_args(args): check=True, ) - allfmt = "-e 'file://{}" if args.editable else "'file://{}" - # packages should provide an extra_requires that is named - # 'test', to denote test dependencies. - extras = [] - if args.with_test_deps: - extras.append("test") - if extras: - allfmt += f"[{','.join(extras)}]" - # note the trailing single quote, to close the quote opened above. - allfmt += "'" + allfmt = "-e 'file://{}'" if args.editable else "'file://{}'" execute_args( parse_subargs( @@ -489,6 +478,7 @@ def install_args(args): ), ) ) + if args.with_dev_deps: rootpath = find_projectroot() runsubprocess( From bb9eebb73e1b225c8d958eb5bf6c3a90fa434311 Mon Sep 17 00:00:00 2001 From: Leighton Chen Date: Wed, 5 Jun 2024 15:27:12 -0700 Subject: [PATCH 37/56] Fix readme formatting and markdown (#2576) --- .../README.rst | 35 +++++++++++-------- 1 file changed, 21 insertions(+), 14 deletions(-) diff --git a/processor/opentelemetry-processor-baggage/README.rst b/processor/opentelemetry-processor-baggage/README.rst index 83c4e91edf..6d3a439d8a 100644 --- a/processor/opentelemetry-processor-baggage/README.rst +++ b/processor/opentelemetry-processor-baggage/README.rst @@ -26,7 +26,7 @@ configured. If the external services also have a Baggage span processor, the keys and values will appear in those child spans as well. -⚠ Warning ⚠️ +[!WARNING] Do not put sensitive information in Baggage. @@ -39,25 +39,32 @@ Add the span processor when configuring the tracer provider. To configure the span processor to copy all baggage entries during configuration: -```python -from opentelemetry.processor.baggage import BaggageSpanProcessor, ALLOW_ALL_BAGGAGE_KEYS +:: + + from opentelemetry.processor.baggage import BaggageSpanProcessor, ALLOW_ALL_BAGGAGE_KEYS + + tracer_provider = TracerProvider() + tracer_provider.add_span_processor(BaggageSpanProcessor(ALLOW_ALL_BAGGAGE_KEYS)) -tracer_provider = TracerProvider() -tracer_provider.add_span_processor(BaggageSpanProcessor(ALLOW_ALL_BAGGAGE_KEYS)) -``` Alternatively, you can provide a custom baggage key predicate to select which baggage keys you want to copy. For example, to only copy baggage entries that start with `my-key`: -```python -starts_with_predicate = lambda baggage_key: baggage_key.startswith("my-key") -tracer_provider.add_span_processor(BaggageSpanProcessor(starts_with_predicate)) -``` +:: + + starts_with_predicate = lambda baggage_key: baggage_key.startswith("my-key") + tracer_provider.add_span_processor(BaggageSpanProcessor(starts_with_predicate)) + For example, to only copy baggage entries that match the regex `^key.+`: -```python -regex_predicate = lambda baggage_key: baggage_key.startswith("^key.+") -tracer_provider.add_span_processor(BaggageSpanProcessor(regex_predicate)) -``` +:: + + regex_predicate = lambda baggage_key: baggage_key.startswith("^key.+") + tracer_provider.add_span_processor(BaggageSpanProcessor(regex_predicate)) + + +References +---------- +* `OpenTelemetry Project `_ From 5b841282ab9ac5303fd165a746ac3724b6ac5984 Mon Sep 17 00:00:00 2001 From: Leighton Chen Date: Thu, 6 Jun 2024 12:52:32 -0700 Subject: [PATCH 38/56] Do not use `asgi` name and version for tracer/meter for instrumentations using Asgi Middleware (#2580) --- CHANGELOG.md | 5 +++++ .../instrumentation/asgi/__init__.py | 17 ++++++++++++----- .../tests/test_asgi_middleware.py | 8 ++++++++ .../instrumentation/fastapi/__init__.py | 19 +++++++++++++++++-- .../tests/test_fastapi_instrumentation.py | 8 ++++++++ .../instrumentation/starlette/__init__.py | 19 +++++++++++++++++-- .../tests/test_starlette_instrumentation.py | 8 ++++++++ .../instrumentation/wsgi/__init__.py | 2 ++ 8 files changed, 77 insertions(+), 9 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index b92f0c62c7..7100623987 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -7,6 +7,11 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ## Unreleased +### Breaking changes + +- `opentelemetry-instrumentation-asgi`, `opentelemetry-instrumentation-fastapi`, `opentelemetry-instrumentation-starlette` Use `tracer` and `meter` of originating components instead of one from `asgi` middleware + ([#2580](https://github.com/open-telemetry/opentelemetry-python-contrib/pull/2580)) + ### Fixed - `opentelemetry-instrumentation-httpx` Ensure httpx.get or httpx.request like methods are instrumented 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 8edb3420b1..e416e8dec2 100644 --- a/instrumentation/opentelemetry-instrumentation-asgi/src/opentelemetry/instrumentation/asgi/__init__.py +++ b/instrumentation/opentelemetry-instrumentation-asgi/src/opentelemetry/instrumentation/asgi/__init__.py @@ -461,6 +461,8 @@ class OpenTelemetryMiddleware: 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. """ # pylint: disable=too-many-branches @@ -474,17 +476,22 @@ def __init__( client_response_hook: ClientResponseHook = None, tracer_provider=None, meter_provider=None, + tracer=None, meter=None, 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, ): self.app = guarantee_single_callable(app) - self.tracer = trace.get_tracer( - __name__, - __version__, - tracer_provider, - schema_url="https://opentelemetry.io/schemas/1.11.0", + self.tracer = ( + trace.get_tracer( + __name__, + __version__, + tracer_provider, + schema_url="https://opentelemetry.io/schemas/1.11.0", + ) + if tracer is None + else tracer ) self.meter = ( get_meter( diff --git a/instrumentation/opentelemetry-instrumentation-asgi/tests/test_asgi_middleware.py b/instrumentation/opentelemetry-instrumentation-asgi/tests/test_asgi_middleware.py index 902cd4ec7e..d2fe6bc52b 100644 --- a/instrumentation/opentelemetry-instrumentation-asgi/tests/test_asgi_middleware.py +++ b/instrumentation/opentelemetry-instrumentation-asgi/tests/test_asgi_middleware.py @@ -309,6 +309,10 @@ def validate_outputs(self, outputs, error=None, modifiers=None): self.assertEqual(span.name, expected["name"]) self.assertEqual(span.kind, expected["kind"]) self.assertDictEqual(dict(span.attributes), expected["attributes"]) + self.assertEqual( + span.instrumentation_scope.name, + "opentelemetry.instrumentation.asgi", + ) def test_basic_asgi_call(self): """Test that spans are emitted as expected.""" @@ -728,6 +732,10 @@ def test_asgi_metrics(self): self.assertTrue(len(resource_metric.scope_metrics) != 0) for scope_metric in resource_metric.scope_metrics: self.assertTrue(len(scope_metric.metrics) != 0) + self.assertEqual( + scope_metric.scope.name, + "opentelemetry.instrumentation.asgi", + ) for metric in scope_metric.metrics: self.assertIn(metric.name, _expected_metric_names) data_points = list(metric.data.data_points) 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 6f52c6ef3b..263cc0fb78 100644 --- a/instrumentation/opentelemetry-instrumentation-fastapi/src/opentelemetry/instrumentation/fastapi/__init__.py +++ b/instrumentation/opentelemetry-instrumentation-fastapi/src/opentelemetry/instrumentation/fastapi/__init__.py @@ -188,6 +188,7 @@ def client_response_hook(span: Span, scope: dict[str, Any], message: dict[str, A from opentelemetry.instrumentation.instrumentor import BaseInstrumentor from opentelemetry.metrics import get_meter from opentelemetry.semconv.trace import SpanAttributes +from opentelemetry.trace import get_tracer from opentelemetry.util.http import get_excluded_urls, parse_excluded_urls _excluded_urls_from_env = get_excluded_urls("FASTAPI") @@ -221,6 +222,12 @@ def instrument_app( excluded_urls = _excluded_urls_from_env else: excluded_urls = parse_excluded_urls(excluded_urls) + tracer = get_tracer( + __name__, + __version__, + tracer_provider, + schema_url="https://opentelemetry.io/schemas/1.11.0", + ) meter = get_meter( __name__, __version__, @@ -235,7 +242,8 @@ def instrument_app( server_request_hook=server_request_hook, client_request_hook=client_request_hook, client_response_hook=client_response_hook, - tracer_provider=tracer_provider, + # Pass in tracer/meter to get __name__and __version__ of fastapi instrumentation + tracer=tracer, meter=meter, ) app._is_instrumented_by_opentelemetry = True @@ -298,6 +306,12 @@ class _InstrumentedFastAPI(fastapi.FastAPI): def __init__(self, *args, **kwargs): super().__init__(*args, **kwargs) + tracer = get_tracer( + __name__, + __version__, + _InstrumentedFastAPI._tracer_provider, + schema_url="https://opentelemetry.io/schemas/1.11.0", + ) meter = get_meter( __name__, __version__, @@ -311,7 +325,8 @@ def __init__(self, *args, **kwargs): server_request_hook=_InstrumentedFastAPI._server_request_hook, client_request_hook=_InstrumentedFastAPI._client_request_hook, client_response_hook=_InstrumentedFastAPI._client_response_hook, - tracer_provider=_InstrumentedFastAPI._tracer_provider, + # Pass in tracer/meter to get __name__and __version__ of fastapi instrumentation + tracer=tracer, meter=meter, ) self._is_instrumented_by_opentelemetry = True diff --git a/instrumentation/opentelemetry-instrumentation-fastapi/tests/test_fastapi_instrumentation.py b/instrumentation/opentelemetry-instrumentation-fastapi/tests/test_fastapi_instrumentation.py index 5cf9a0d590..948bd343db 100644 --- a/instrumentation/opentelemetry-instrumentation-fastapi/tests/test_fastapi_instrumentation.py +++ b/instrumentation/opentelemetry-instrumentation-fastapi/tests/test_fastapi_instrumentation.py @@ -117,6 +117,10 @@ def test_instrument_app_with_instrument(self): self.assertEqual(len(spans), 3) for span in spans: self.assertIn("GET /foobar", span.name) + self.assertEqual( + span.instrumentation_scope.name, + "opentelemetry.instrumentation.fastapi", + ) def test_uninstrument_app(self): self._client.get("/foobar") @@ -197,6 +201,10 @@ def test_fastapi_metrics(self): for resource_metric in metrics_list.resource_metrics: self.assertTrue(len(resource_metric.scope_metrics) == 1) for scope_metric in resource_metric.scope_metrics: + self.assertEqual( + scope_metric.scope.name, + "opentelemetry.instrumentation.fastapi", + ) self.assertTrue(len(scope_metric.metrics) == 3) for metric in scope_metric.metrics: self.assertIn(metric.name, _expected_metric_names) diff --git a/instrumentation/opentelemetry-instrumentation-starlette/src/opentelemetry/instrumentation/starlette/__init__.py b/instrumentation/opentelemetry-instrumentation-starlette/src/opentelemetry/instrumentation/starlette/__init__.py index 83f5b5c52b..4bb3608935 100644 --- a/instrumentation/opentelemetry-instrumentation-starlette/src/opentelemetry/instrumentation/starlette/__init__.py +++ b/instrumentation/opentelemetry-instrumentation-starlette/src/opentelemetry/instrumentation/starlette/__init__.py @@ -185,6 +185,7 @@ def client_response_hook(span: Span, scope: dict[str, Any], message: dict[str, A from opentelemetry.instrumentation.starlette.version import __version__ from opentelemetry.metrics import get_meter from opentelemetry.semconv.trace import SpanAttributes +from opentelemetry.trace import get_tracer from opentelemetry.util.http import get_excluded_urls _excluded_urls = get_excluded_urls("STARLETTE") @@ -208,6 +209,12 @@ def instrument_app( tracer_provider=None, ): """Instrument an uninstrumented Starlette application.""" + tracer = get_tracer( + __name__, + __version__, + tracer_provider, + schema_url="https://opentelemetry.io/schemas/1.11.0", + ) meter = get_meter( __name__, __version__, @@ -222,7 +229,8 @@ def instrument_app( server_request_hook=server_request_hook, client_request_hook=client_request_hook, client_response_hook=client_response_hook, - tracer_provider=tracer_provider, + # Pass in tracer/meter to get __name__and __version__ of starlette instrumentation + tracer=tracer, meter=meter, ) app.is_instrumented_by_opentelemetry = True @@ -278,6 +286,12 @@ class _InstrumentedStarlette(applications.Starlette): def __init__(self, *args, **kwargs): super().__init__(*args, **kwargs) + tracer = get_tracer( + __name__, + __version__, + _InstrumentedStarlette._tracer_provider, + schema_url="https://opentelemetry.io/schemas/1.11.0", + ) meter = get_meter( __name__, __version__, @@ -291,7 +305,8 @@ def __init__(self, *args, **kwargs): server_request_hook=_InstrumentedStarlette._server_request_hook, client_request_hook=_InstrumentedStarlette._client_request_hook, client_response_hook=_InstrumentedStarlette._client_response_hook, - tracer_provider=_InstrumentedStarlette._tracer_provider, + # Pass in tracer/meter to get __name__and __version__ of starlette instrumentation + tracer=tracer, meter=meter, ) self._is_instrumented_by_opentelemetry = True diff --git a/instrumentation/opentelemetry-instrumentation-starlette/tests/test_starlette_instrumentation.py b/instrumentation/opentelemetry-instrumentation-starlette/tests/test_starlette_instrumentation.py index 0accda18fd..1e768982b5 100644 --- a/instrumentation/opentelemetry-instrumentation-starlette/tests/test_starlette_instrumentation.py +++ b/instrumentation/opentelemetry-instrumentation-starlette/tests/test_starlette_instrumentation.py @@ -98,6 +98,10 @@ def test_basic_starlette_call(self): self.assertEqual(len(spans), 3) for span in spans: self.assertIn("GET /foobar", span.name) + self.assertEqual( + span.instrumentation_scope.name, + "opentelemetry.instrumentation.starlette", + ) def test_starlette_route_attribute_added(self): """Ensure that starlette routes are used as the span name.""" @@ -132,6 +136,10 @@ def test_starlette_metrics(self): for resource_metric in metrics_list.resource_metrics: self.assertTrue(len(resource_metric.scope_metrics) == 1) for scope_metric in resource_metric.scope_metrics: + self.assertEqual( + scope_metric.scope.name, + "opentelemetry.instrumentation.starlette", + ) self.assertTrue(len(scope_metric.metrics) == 3) for metric in scope_metric.metrics: self.assertIn(metric.name, _expected_metric_names) 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 0a873d0fc3..810a07e315 100644 --- a/instrumentation/opentelemetry-instrumentation-wsgi/src/opentelemetry/instrumentation/wsgi/__init__.py +++ b/instrumentation/opentelemetry-instrumentation-wsgi/src/opentelemetry/instrumentation/wsgi/__init__.py @@ -533,6 +533,8 @@ class OpenTelemetryMiddleware: incoming request. tracer_provider: Optional tracer provider to use. If omitted the current globally configured one is used. + meter_provider: Optional meter provider to use. If omitted the current + globally configured one is used. """ def __init__( From bc4b0493b9d72c508ef172b61e14cc7f44c9d73b Mon Sep 17 00:00:00 2001 From: Riccardo Magliocchetti Date: Fri, 7 Jun 2024 17:53:22 +0200 Subject: [PATCH 39/56] requirements: bump pytest to 7.4.4 (#2587) --- .../test-requirements.txt | 8 +++----- .../test-requirements.txt | 8 +++----- .../test-requirements-0.txt | 8 +++----- .../test-requirements-1.txt | 8 +++----- .../test-requirements-2.txt | 8 +++----- .../test-requirements-3.txt | 8 +++----- .../test-requirements.txt | 8 +++----- .../test-requirements.txt | 8 +++----- .../test-requirements.txt | 8 +++----- .../test-requirements.txt | 8 +++----- .../test-requirements.txt | 8 +++----- .../test-requirements.txt | 8 +++----- .../test-requirements.txt | 8 +++----- .../test-requirements.txt | 8 +++----- .../test-requirements.txt | 8 +++----- .../test-requirements.txt | 8 +++----- .../test-requirements.txt | 8 +++----- .../test-requirements-0.txt | 8 +++----- .../test-requirements-1.txt | 8 +++----- .../test-requirements.txt | 8 +++----- .../test-requirements.txt | 8 +++----- .../test-requirements-0.txt | 8 +++----- .../test-requirements-1.txt | 8 +++----- .../test-requirements-2.txt | 8 +++----- .../test-requirements-3.txt | 8 +++----- .../test-requirements-0.txt | 8 +++----- .../test-requirements-1.txt | 8 +++----- .../test-requirements-2.txt | 8 +++----- .../test-requirements-0.txt | 8 +++----- .../test-requirements-1.txt | 8 +++----- .../test-requirements-2.txt | 8 +++----- .../test-requirements.txt | 8 +++----- .../test-requirements-0.txt | 8 +++----- .../test-requirements-1.txt | 8 +++----- .../test-requirements-2.txt | 8 +++----- .../test-requirements.txt | 8 +++----- .../test-requirements-0.txt | 8 +++----- .../test-requirements-1.txt | 8 +++----- .../test-requirements.txt | 8 +++----- .../test-requirements.txt | 8 +++----- .../test-requirements.txt | 8 +++----- .../test-requirements.txt | 8 +++----- .../test-requirements.txt | 8 +++----- .../test-requirements-0.txt | 8 +++----- .../test-requirements-1.txt | 8 +++----- .../test-requirements-0.txt | 8 +++----- .../test-requirements-1.txt | 8 +++----- .../test-requirements.txt | 8 +++----- .../test-requirements-0.txt | 8 +++----- .../test-requirements-1.txt | 8 +++----- .../test-requirements-2.txt | 8 +++----- .../test-requirements-3.txt | 8 +++----- .../test-requirements-4.txt | 8 +++----- .../test-requirements.txt | 8 +++----- .../test-requirements.txt | 8 +++----- .../test-requirements.txt | 8 +++----- .../test-requirements.txt | 8 +++----- .../test-requirements.txt | 8 +++----- .../test-requirements.txt | 8 +++----- .../test-requirements.txt | 8 +++----- .../test-requirements-0.txt | 8 +++----- .../test-requirements-1.txt | 8 +++----- .../test-requirements.txt | 8 +++----- .../test-requirements.txt | 8 +++----- .../test-requirements.txt | 8 +++----- .../test-requirements.txt | 8 +++----- .../test-requirements.txt | 8 +++----- .../test-requirements.txt | 8 +++----- .../test-requirements.txt | 8 +++----- .../test-requirements-0.txt | 8 +++----- .../test-requirements-1.txt | 8 +++----- .../test-requirements.txt | 8 +++----- opentelemetry-distro/test-requirements.txt | 8 +++----- opentelemetry-instrumentation/test-requirements.txt | 8 +++----- .../test-requirements.txt | 8 +++----- .../test-requirements.txt | 8 +++----- .../test-requirements.txt | 8 +++----- .../opentelemetry-sdk-extension-aws/test-requirements.txt | 8 +++----- 78 files changed, 234 insertions(+), 390 deletions(-) diff --git a/exporter/opentelemetry-exporter-prometheus-remote-write/test-requirements.txt b/exporter/opentelemetry-exporter-prometheus-remote-write/test-requirements.txt index 40c4886fd7..7676ce644d 100644 --- a/exporter/opentelemetry-exporter-prometheus-remote-write/test-requirements.txt +++ b/exporter/opentelemetry-exporter-prometheus-remote-write/test-requirements.txt @@ -1,5 +1,4 @@ asgiref==3.7.2 -attrs==23.2.0 certifi==2024.2.2 charset-normalizer==3.3.2 cramjam==2.8.1 @@ -7,12 +6,11 @@ Deprecated==1.2.14 idna==3.6 importlib-metadata==6.11.0 iniconfig==2.0.0 -packaging==23.2 -pluggy==1.4.0 +packaging==24.0 +pluggy==1.5.0 protobuf==4.25.3 -py==1.11.0 py-cpuinfo==9.0.0 -pytest==7.1.3 +pytest==7.4.4 pytest-benchmark==4.0.0 python-snappy==0.7.1 requests==2.31.0 diff --git a/exporter/opentelemetry-exporter-richconsole/test-requirements.txt b/exporter/opentelemetry-exporter-richconsole/test-requirements.txt index 42d2ec7b4c..af50fa87e8 100644 --- a/exporter/opentelemetry-exporter-richconsole/test-requirements.txt +++ b/exporter/opentelemetry-exporter-richconsole/test-requirements.txt @@ -1,17 +1,15 @@ asgiref==3.7.2 -attrs==23.2.0 Deprecated==1.2.14 flaky==3.7.0 importlib-metadata==6.11.0 iniconfig==2.0.0 markdown-it-py==3.0.0 mdurl==0.1.2 -packaging==23.2 -pluggy==1.4.0 -py==1.11.0 +packaging==24.0 +pluggy==1.5.0 py-cpuinfo==9.0.0 Pygments==2.17.2 -pytest==7.1.3 +pytest==7.4.4 pytest-benchmark==4.0.0 rich==13.7.1 tomli==2.0.1 diff --git a/instrumentation/opentelemetry-instrumentation-aio-pika/test-requirements-0.txt b/instrumentation/opentelemetry-instrumentation-aio-pika/test-requirements-0.txt index c8ffea4e89..2935a1c7e0 100644 --- a/instrumentation/opentelemetry-instrumentation-aio-pika/test-requirements-0.txt +++ b/instrumentation/opentelemetry-instrumentation-aio-pika/test-requirements-0.txt @@ -1,18 +1,16 @@ aio-pika==7.2.0 aiormq==6.2.3 asgiref==3.7.2 -attrs==23.2.0 Deprecated==1.2.14 idna==3.6 importlib-metadata==6.11.0 iniconfig==2.0.0 multidict==6.0.5 -packaging==23.2 +packaging==24.0 pamqp==3.1.0 -pluggy==1.4.0 -py==1.11.0 +pluggy==1.5.0 py-cpuinfo==9.0.0 -pytest==7.1.3 +pytest==7.4.4 pytest-benchmark==4.0.0 tomli==2.0.1 typing_extensions==4.9.0 diff --git a/instrumentation/opentelemetry-instrumentation-aio-pika/test-requirements-1.txt b/instrumentation/opentelemetry-instrumentation-aio-pika/test-requirements-1.txt index 1e2ea5a1e5..2db29de3ea 100644 --- a/instrumentation/opentelemetry-instrumentation-aio-pika/test-requirements-1.txt +++ b/instrumentation/opentelemetry-instrumentation-aio-pika/test-requirements-1.txt @@ -1,18 +1,16 @@ aio-pika==8.3.0 aiormq==6.6.4 asgiref==3.7.2 -attrs==23.2.0 Deprecated==1.2.14 idna==3.6 importlib-metadata==6.11.0 iniconfig==2.0.0 multidict==6.0.5 -packaging==23.2 +packaging==24.0 pamqp==3.2.1 -pluggy==1.4.0 -py==1.11.0 +pluggy==1.5.0 py-cpuinfo==9.0.0 -pytest==7.1.3 +pytest==7.4.4 pytest-benchmark==4.0.0 tomli==2.0.1 typing_extensions==4.9.0 diff --git a/instrumentation/opentelemetry-instrumentation-aio-pika/test-requirements-2.txt b/instrumentation/opentelemetry-instrumentation-aio-pika/test-requirements-2.txt index 7e1aa15fa0..536646e287 100644 --- a/instrumentation/opentelemetry-instrumentation-aio-pika/test-requirements-2.txt +++ b/instrumentation/opentelemetry-instrumentation-aio-pika/test-requirements-2.txt @@ -1,18 +1,16 @@ aio-pika==9.0.5 aiormq==6.7.1 asgiref==3.7.2 -attrs==23.2.0 Deprecated==1.2.14 idna==3.6 importlib-metadata==6.11.0 iniconfig==2.0.0 multidict==6.0.5 -packaging==23.2 +packaging==24.0 pamqp==3.2.1 -pluggy==1.4.0 -py==1.11.0 +pluggy==1.5.0 py-cpuinfo==9.0.0 -pytest==7.1.3 +pytest==7.4.4 pytest-benchmark==4.0.0 tomli==2.0.1 typing_extensions==4.9.0 diff --git a/instrumentation/opentelemetry-instrumentation-aio-pika/test-requirements-3.txt b/instrumentation/opentelemetry-instrumentation-aio-pika/test-requirements-3.txt index 65c2ff8f0c..12168d97b1 100644 --- a/instrumentation/opentelemetry-instrumentation-aio-pika/test-requirements-3.txt +++ b/instrumentation/opentelemetry-instrumentation-aio-pika/test-requirements-3.txt @@ -1,18 +1,16 @@ aio-pika==9.4.1 aiormq==6.8.0 asgiref==3.7.2 -attrs==23.2.0 Deprecated==1.2.14 idna==3.6 importlib-metadata==6.11.0 iniconfig==2.0.0 multidict==6.0.5 -packaging==23.2 +packaging==24.0 pamqp==3.3.0 -pluggy==1.4.0 -py==1.11.0 +pluggy==1.5.0 py-cpuinfo==9.0.0 -pytest==7.1.3 +pytest==7.4.4 pytest-benchmark==4.0.0 tomli==2.0.1 typing_extensions==4.9.0 diff --git a/instrumentation/opentelemetry-instrumentation-aiohttp-client/test-requirements.txt b/instrumentation/opentelemetry-instrumentation-aiohttp-client/test-requirements.txt index b8ccfd2a50..0209ca3dd6 100644 --- a/instrumentation/opentelemetry-instrumentation-aiohttp-client/test-requirements.txt +++ b/instrumentation/opentelemetry-instrumentation-aiohttp-client/test-requirements.txt @@ -2,7 +2,6 @@ aiohttp==3.9.3 aiosignal==1.3.1 asgiref==3.7.2 async-timeout==4.0.3 -attrs==23.2.0 blinker==1.7.0 certifi==2024.2.2 charset-normalizer==3.3.2 @@ -18,11 +17,10 @@ itsdangerous==2.1.2 Jinja2==3.1.3 MarkupSafe==2.1.5 multidict==6.0.5 -packaging==23.2 -pluggy==1.4.0 -py==1.11.0 +packaging==24.0 +pluggy==1.5.0 py-cpuinfo==9.0.0 -pytest==7.1.3 +pytest==7.4.4 pytest-benchmark==4.0.0 requests==2.31.0 tomli==2.0.1 diff --git a/instrumentation/opentelemetry-instrumentation-aiohttp-server/test-requirements.txt b/instrumentation/opentelemetry-instrumentation-aiohttp-server/test-requirements.txt index 9f6d7accce..16529b6db1 100644 --- a/instrumentation/opentelemetry-instrumentation-aiohttp-server/test-requirements.txt +++ b/instrumentation/opentelemetry-instrumentation-aiohttp-server/test-requirements.txt @@ -2,18 +2,16 @@ aiohttp==3.9.3 aiosignal==1.3.1 asgiref==3.7.2 async-timeout==4.0.3 -attrs==23.2.0 Deprecated==1.2.14 frozenlist==1.4.1 idna==3.6 importlib-metadata==6.11.0 iniconfig==2.0.0 multidict==6.0.5 -packaging==23.2 -pluggy==1.4.0 -py==1.11.0 +packaging==24.0 +pluggy==1.5.0 py-cpuinfo==9.0.0 -pytest==7.1.3 +pytest==7.4.4 pytest-aiohttp==1.0.5 pytest-asyncio==0.23.5 pytest-benchmark==4.0.0 diff --git a/instrumentation/opentelemetry-instrumentation-aiopg/test-requirements.txt b/instrumentation/opentelemetry-instrumentation-aiopg/test-requirements.txt index 2b03677f42..033cee4492 100644 --- a/instrumentation/opentelemetry-instrumentation-aiopg/test-requirements.txt +++ b/instrumentation/opentelemetry-instrumentation-aiopg/test-requirements.txt @@ -1,17 +1,15 @@ aiopg==1.4.0 asgiref==3.7.2 async-timeout==4.0.3 -attrs==23.2.0 Deprecated==1.2.14 importlib-metadata==6.11.0 iniconfig==2.0.0 install==1.3.5 -packaging==23.2 -pluggy==1.4.0 +packaging==24.0 +pluggy==1.5.0 psycopg2-binary==2.9.9 -py==1.11.0 py-cpuinfo==9.0.0 -pytest==7.1.3 +pytest==7.4.4 pytest-benchmark==4.0.0 tomli==2.0.1 typing_extensions==4.10.0 diff --git a/instrumentation/opentelemetry-instrumentation-asgi/test-requirements.txt b/instrumentation/opentelemetry-instrumentation-asgi/test-requirements.txt index f3ee9764cf..9411be3b90 100644 --- a/instrumentation/opentelemetry-instrumentation-asgi/test-requirements.txt +++ b/instrumentation/opentelemetry-instrumentation-asgi/test-requirements.txt @@ -1,13 +1,11 @@ asgiref==3.7.2 -attrs==23.2.0 Deprecated==1.2.14 importlib-metadata==6.11.0 iniconfig==2.0.0 -packaging==23.2 -pluggy==1.4.0 -py==1.11.0 +packaging==24.0 +pluggy==1.5.0 py-cpuinfo==9.0.0 -pytest==7.1.3 +pytest==7.4.4 pytest-benchmark==4.0.0 tomli==2.0.1 typing_extensions==4.9.0 diff --git a/instrumentation/opentelemetry-instrumentation-asyncio/test-requirements.txt b/instrumentation/opentelemetry-instrumentation-asyncio/test-requirements.txt index 14f724888b..4943fcc851 100644 --- a/instrumentation/opentelemetry-instrumentation-asyncio/test-requirements.txt +++ b/instrumentation/opentelemetry-instrumentation-asyncio/test-requirements.txt @@ -1,13 +1,11 @@ asgiref==3.7.2 -attrs==23.2.0 Deprecated==1.2.14 importlib-metadata==6.11.0 iniconfig==2.0.0 -packaging==23.2 -pluggy==1.4.0 -py==1.11.0 +packaging==24.0 +pluggy==1.5.0 py-cpuinfo==9.0.0 -pytest==7.1.3 +pytest==7.4.4 pytest-asyncio==0.23.5 pytest-benchmark==4.0.0 tomli==2.0.1 diff --git a/instrumentation/opentelemetry-instrumentation-asyncpg/test-requirements.txt b/instrumentation/opentelemetry-instrumentation-asyncpg/test-requirements.txt index 02d8fb2041..2ef86b3d94 100644 --- a/instrumentation/opentelemetry-instrumentation-asyncpg/test-requirements.txt +++ b/instrumentation/opentelemetry-instrumentation-asyncpg/test-requirements.txt @@ -1,15 +1,13 @@ asgiref==3.7.2 async-timeout==4.0.3 asyncpg==0.29.0 -attrs==23.2.0 Deprecated==1.2.14 importlib-metadata==6.11.0 iniconfig==2.0.0 -packaging==23.2 -pluggy==1.4.0 -py==1.11.0 +packaging==24.0 +pluggy==1.5.0 py-cpuinfo==9.0.0 -pytest==7.1.3 +pytest==7.4.4 pytest-benchmark==4.0.0 tomli==2.0.1 typing_extensions==4.9.0 diff --git a/instrumentation/opentelemetry-instrumentation-aws-lambda/test-requirements.txt b/instrumentation/opentelemetry-instrumentation-aws-lambda/test-requirements.txt index 53e5b9ce6f..b5168dc7fe 100644 --- a/instrumentation/opentelemetry-instrumentation-aws-lambda/test-requirements.txt +++ b/instrumentation/opentelemetry-instrumentation-aws-lambda/test-requirements.txt @@ -1,13 +1,11 @@ asgiref==3.7.2 -attrs==23.2.0 Deprecated==1.2.14 importlib-metadata==6.11.0 iniconfig==2.0.0 -packaging==23.2 -pluggy==1.4.0 -py==1.11.0 +packaging==24.0 +pluggy==1.5.0 py-cpuinfo==9.0.0 -pytest==7.1.3 +pytest==7.4.4 pytest-benchmark==4.0.0 tomli==2.0.1 typing_extensions==4.9.0 diff --git a/instrumentation/opentelemetry-instrumentation-boto/test-requirements.txt b/instrumentation/opentelemetry-instrumentation-boto/test-requirements.txt index 4f8c5d2b67..8d6d6692ce 100644 --- a/instrumentation/opentelemetry-instrumentation-boto/test-requirements.txt +++ b/instrumentation/opentelemetry-instrumentation-boto/test-requirements.txt @@ -1,5 +1,4 @@ asgiref==3.7.2 -attrs==23.2.0 boto==2.49.0 boto3==1.34.44 botocore==1.34.44 @@ -16,12 +15,11 @@ Jinja2==3.1.4 jmespath==1.0.1 MarkupSafe==2.1.5 moto==2.3.2 -packaging==23.2 -pluggy==1.4.0 -py==1.11.0 +packaging==24.0 +pluggy==1.5.0 py-cpuinfo==9.0.0 pycparser==2.21 -pytest==7.1.3 +pytest==7.4.4 pytest-benchmark==4.0.0 python-dateutil==2.8.2 pytz==2024.1 diff --git a/instrumentation/opentelemetry-instrumentation-boto3sqs/test-requirements.txt b/instrumentation/opentelemetry-instrumentation-boto3sqs/test-requirements.txt index 2af3346e6d..8ddfd9983f 100644 --- a/instrumentation/opentelemetry-instrumentation-boto3sqs/test-requirements.txt +++ b/instrumentation/opentelemetry-instrumentation-boto3sqs/test-requirements.txt @@ -1,16 +1,14 @@ asgiref==3.7.2 -attrs==23.2.0 boto3==1.34.44 botocore==1.34.44 Deprecated==1.2.14 importlib-metadata==6.11.0 iniconfig==2.0.0 jmespath==1.0.1 -packaging==23.2 -pluggy==1.4.0 -py==1.11.0 +packaging==24.0 +pluggy==1.5.0 py-cpuinfo==9.0.0 -pytest==7.1.3 +pytest==7.4.4 pytest-benchmark==4.0.0 python-dateutil==2.8.2 s3transfer==0.10.0 diff --git a/instrumentation/opentelemetry-instrumentation-botocore/test-requirements.txt b/instrumentation/opentelemetry-instrumentation-botocore/test-requirements.txt index 7229f0f721..b3fa765d5c 100644 --- a/instrumentation/opentelemetry-instrumentation-botocore/test-requirements.txt +++ b/instrumentation/opentelemetry-instrumentation-botocore/test-requirements.txt @@ -1,5 +1,4 @@ asgiref==3.7.2 -attrs==23.2.0 aws-xray-sdk==2.12.1 boto3==1.28.80 botocore==1.31.80 @@ -16,12 +15,11 @@ Jinja2==3.1.4 jmespath==1.0.1 MarkupSafe==2.0.1 moto==3.1.19 -packaging==23.2 -pluggy==1.4.0 -py==1.11.0 +packaging==24.0 +pluggy==1.5.0 py-cpuinfo==9.0.0 pycparser==2.21 -pytest==7.1.3 +pytest==7.4.4 pytest-benchmark==4.0.0 python-dateutil==2.8.2 pytz==2024.1 diff --git a/instrumentation/opentelemetry-instrumentation-cassandra/test-requirements.txt b/instrumentation/opentelemetry-instrumentation-cassandra/test-requirements.txt index f55190171d..f0d811982b 100644 --- a/instrumentation/opentelemetry-instrumentation-cassandra/test-requirements.txt +++ b/instrumentation/opentelemetry-instrumentation-cassandra/test-requirements.txt @@ -1,16 +1,14 @@ asgiref==3.7.2 -attrs==23.2.0 cassandra-driver==3.29.0 click==8.1.7 Deprecated==1.2.14 geomet==0.2.1.post1 importlib-metadata==6.11.0 iniconfig==2.0.0 -packaging==23.2 -pluggy==1.4.0 -py==1.11.0 +packaging==24.0 +pluggy==1.5.0 py-cpuinfo==9.0.0 -pytest==7.1.3 +pytest==7.4.4 pytest-benchmark==4.0.0 PyYAML==6.0.1 scylla-driver==3.26.6 diff --git a/instrumentation/opentelemetry-instrumentation-celery/test-requirements-0.txt b/instrumentation/opentelemetry-instrumentation-celery/test-requirements-0.txt index 98c661ca67..3159fefaf8 100644 --- a/instrumentation/opentelemetry-instrumentation-celery/test-requirements-0.txt +++ b/instrumentation/opentelemetry-instrumentation-celery/test-requirements-0.txt @@ -1,6 +1,5 @@ amqp==5.2.0 asgiref==3.7.2 -attrs==23.2.0 backports.zoneinfo==0.2.1 billiard==4.2.0 celery==5.3.6 @@ -12,12 +11,11 @@ Deprecated==1.2.14 importlib-metadata==6.11.0 iniconfig==2.0.0 kombu==5.3.5 -packaging==23.2 -pluggy==1.4.0 +packaging==24.0 +pluggy==1.5.0 prompt-toolkit==3.0.43 -py==1.11.0 py-cpuinfo==9.0.0 -pytest==7.1.3 +pytest==7.4.4 pytest-benchmark==4.0.0 python-dateutil==2.8.2 six==1.16.0 diff --git a/instrumentation/opentelemetry-instrumentation-celery/test-requirements-1.txt b/instrumentation/opentelemetry-instrumentation-celery/test-requirements-1.txt index 516e1a78b9..6012f89379 100644 --- a/instrumentation/opentelemetry-instrumentation-celery/test-requirements-1.txt +++ b/instrumentation/opentelemetry-instrumentation-celery/test-requirements-1.txt @@ -1,6 +1,5 @@ amqp==5.2.0 asgiref==3.7.2 -attrs==23.2.0 billiard==4.2.0 celery==5.3.6 click==8.1.7 @@ -11,12 +10,11 @@ Deprecated==1.2.14 importlib-metadata==6.11.0 iniconfig==2.0.0 kombu==5.3.5 -packaging==23.2 -pluggy==1.4.0 +packaging==24.0 +pluggy==1.5.0 prompt-toolkit==3.0.43 -py==1.11.0 py-cpuinfo==9.0.0 -pytest==7.1.3 +pytest==7.4.4 pytest-benchmark==4.0.0 python-dateutil==2.8.2 six==1.16.0 diff --git a/instrumentation/opentelemetry-instrumentation-confluent-kafka/test-requirements.txt b/instrumentation/opentelemetry-instrumentation-confluent-kafka/test-requirements.txt index be859a2ce1..1297185d4b 100644 --- a/instrumentation/opentelemetry-instrumentation-confluent-kafka/test-requirements.txt +++ b/instrumentation/opentelemetry-instrumentation-confluent-kafka/test-requirements.txt @@ -1,14 +1,12 @@ asgiref==3.7.2 -attrs==23.2.0 confluent-kafka==2.3.0 Deprecated==1.2.14 importlib-metadata==6.11.0 iniconfig==2.0.0 -packaging==23.2 -pluggy==1.4.0 -py==1.11.0 +packaging==24.0 +pluggy==1.5.0 py-cpuinfo==9.0.0 -pytest==7.1.3 +pytest==7.4.4 pytest-benchmark==4.0.0 tomli==2.0.1 typing_extensions==4.9.0 diff --git a/instrumentation/opentelemetry-instrumentation-dbapi/test-requirements.txt b/instrumentation/opentelemetry-instrumentation-dbapi/test-requirements.txt index 46c02707c1..d35a55f831 100644 --- a/instrumentation/opentelemetry-instrumentation-dbapi/test-requirements.txt +++ b/instrumentation/opentelemetry-instrumentation-dbapi/test-requirements.txt @@ -1,13 +1,11 @@ asgiref==3.7.2 -attrs==23.2.0 Deprecated==1.2.14 importlib-metadata==6.11.0 iniconfig==2.0.0 -packaging==23.2 -pluggy==1.4.0 -py==1.11.0 +packaging==24.0 +pluggy==1.5.0 py-cpuinfo==9.0.0 -pytest==7.1.3 +pytest==7.4.4 pytest-benchmark==4.0.0 tomli==2.0.1 typing_extensions==4.9.0 diff --git a/instrumentation/opentelemetry-instrumentation-django/test-requirements-0.txt b/instrumentation/opentelemetry-instrumentation-django/test-requirements-0.txt index 6dce957000..2203da3e33 100644 --- a/instrumentation/opentelemetry-instrumentation-django/test-requirements-0.txt +++ b/instrumentation/opentelemetry-instrumentation-django/test-requirements-0.txt @@ -1,14 +1,12 @@ asgiref==3.7.2 -attrs==23.2.0 Deprecated==1.2.14 Django==2.2.28 importlib-metadata==6.11.0 iniconfig==2.0.0 -packaging==23.2 -pluggy==1.4.0 -py==1.11.0 +packaging==24.0 +pluggy==1.5.0 py-cpuinfo==9.0.0 -pytest==7.1.3 +pytest==7.4.4 pytest-benchmark==4.0.0 pytz==2024.1 sqlparse==0.4.4 diff --git a/instrumentation/opentelemetry-instrumentation-django/test-requirements-1.txt b/instrumentation/opentelemetry-instrumentation-django/test-requirements-1.txt index 548db1b8e3..bf7239cce6 100644 --- a/instrumentation/opentelemetry-instrumentation-django/test-requirements-1.txt +++ b/instrumentation/opentelemetry-instrumentation-django/test-requirements-1.txt @@ -1,14 +1,12 @@ asgiref==3.7.2 -attrs==23.2.0 Deprecated==1.2.14 Django==3.2.25 importlib-metadata==6.11.0 iniconfig==2.0.0 -packaging==23.2 -pluggy==1.4.0 -py==1.11.0 +packaging==24.0 +pluggy==1.5.0 py-cpuinfo==9.0.0 -pytest==7.1.3 +pytest==7.4.4 pytest-benchmark==4.0.0 pytz==2024.1 sqlparse==0.4.4 diff --git a/instrumentation/opentelemetry-instrumentation-django/test-requirements-2.txt b/instrumentation/opentelemetry-instrumentation-django/test-requirements-2.txt index 0970d2f253..03d4570977 100644 --- a/instrumentation/opentelemetry-instrumentation-django/test-requirements-2.txt +++ b/instrumentation/opentelemetry-instrumentation-django/test-requirements-2.txt @@ -1,15 +1,13 @@ asgiref==3.7.2 -attrs==23.2.0 backports.zoneinfo==0.2.1 Deprecated==1.2.14 Django==4.2.11 importlib-metadata==6.11.0 iniconfig==2.0.0 -packaging==23.2 -pluggy==1.4.0 -py==1.11.0 +packaging==24.0 +pluggy==1.5.0 py-cpuinfo==9.0.0 -pytest==7.1.3 +pytest==7.4.4 pytest-benchmark==4.0.0 sqlparse==0.4.4 tomli==2.0.1 diff --git a/instrumentation/opentelemetry-instrumentation-django/test-requirements-3.txt b/instrumentation/opentelemetry-instrumentation-django/test-requirements-3.txt index d853c05877..ec200f92ef 100644 --- a/instrumentation/opentelemetry-instrumentation-django/test-requirements-3.txt +++ b/instrumentation/opentelemetry-instrumentation-django/test-requirements-3.txt @@ -1,14 +1,12 @@ asgiref==3.7.2 -attrs==23.2.0 Deprecated==1.2.14 Django==4.2.11 importlib-metadata==6.11.0 iniconfig==2.0.0 -packaging==23.2 -pluggy==1.4.0 -py==1.11.0 +packaging==24.0 +pluggy==1.5.0 py-cpuinfo==9.0.0 -pytest==7.1.3 +pytest==7.4.4 pytest-benchmark==4.0.0 sqlparse==0.4.4 tomli==2.0.1 diff --git a/instrumentation/opentelemetry-instrumentation-elasticsearch/test-requirements-0.txt b/instrumentation/opentelemetry-instrumentation-elasticsearch/test-requirements-0.txt index 054c8a8047..dac65a0f01 100644 --- a/instrumentation/opentelemetry-instrumentation-elasticsearch/test-requirements-0.txt +++ b/instrumentation/opentelemetry-instrumentation-elasticsearch/test-requirements-0.txt @@ -1,15 +1,13 @@ asgiref==3.7.2 -attrs==23.2.0 Deprecated==1.2.14 elasticsearch==6.8.2 elasticsearch-dsl==6.4.0 importlib-metadata==6.11.0 iniconfig==2.0.0 -packaging==23.2 -pluggy==1.4.0 -py==1.11.0 +packaging==24.0 +pluggy==1.5.0 py-cpuinfo==9.0.0 -pytest==7.1.3 +pytest==7.4.4 pytest-benchmark==4.0.0 python-dateutil==2.8.2 six==1.16.0 diff --git a/instrumentation/opentelemetry-instrumentation-elasticsearch/test-requirements-1.txt b/instrumentation/opentelemetry-instrumentation-elasticsearch/test-requirements-1.txt index efa05fd7ff..c9baa38ad6 100644 --- a/instrumentation/opentelemetry-instrumentation-elasticsearch/test-requirements-1.txt +++ b/instrumentation/opentelemetry-instrumentation-elasticsearch/test-requirements-1.txt @@ -1,15 +1,13 @@ asgiref==3.7.2 -attrs==23.2.0 Deprecated==1.2.14 elasticsearch==7.17.9 elasticsearch-dsl==7.4.1 importlib-metadata==6.11.0 iniconfig==2.0.0 -packaging==23.2 -pluggy==1.4.0 -py==1.11.0 +packaging==24.0 +pluggy==1.5.0 py-cpuinfo==9.0.0 -pytest==7.1.3 +pytest==7.4.4 pytest-benchmark==4.0.0 python-dateutil==2.8.2 six==1.16.0 diff --git a/instrumentation/opentelemetry-instrumentation-elasticsearch/test-requirements-2.txt b/instrumentation/opentelemetry-instrumentation-elasticsearch/test-requirements-2.txt index 6b0d677ec7..b852eff7cb 100644 --- a/instrumentation/opentelemetry-instrumentation-elasticsearch/test-requirements-2.txt +++ b/instrumentation/opentelemetry-instrumentation-elasticsearch/test-requirements-2.txt @@ -1,16 +1,14 @@ asgiref==3.7.2 -attrs==23.2.0 Deprecated==1.2.14 elasticsearch==8.13.1 elasticsearch-dsl==8.13.1 elastic-transport==8.13.0 importlib-metadata==6.11.0 iniconfig==2.0.0 -packaging==23.2 -pluggy==1.4.0 -py==1.11.0 +packaging==24.0 +pluggy==1.5.0 py-cpuinfo==9.0.0 -pytest==7.1.3 +pytest==7.4.4 pytest-benchmark==4.0.0 python-dateutil==2.8.2 six==1.16.0 diff --git a/instrumentation/opentelemetry-instrumentation-falcon/test-requirements-0.txt b/instrumentation/opentelemetry-instrumentation-falcon/test-requirements-0.txt index 31c7f1d7c8..f17ada63f4 100644 --- a/instrumentation/opentelemetry-instrumentation-falcon/test-requirements-0.txt +++ b/instrumentation/opentelemetry-instrumentation-falcon/test-requirements-0.txt @@ -1,14 +1,12 @@ asgiref==3.7.2 -attrs==23.2.0 Deprecated==1.2.14 falcon==1.4.1 importlib-metadata==6.11.0 iniconfig==2.0.0 -packaging==23.2 -pluggy==1.4.0 -py==1.11.0 +packaging==24.0 +pluggy==1.5.0 py-cpuinfo==9.0.0 -pytest==7.1.3 +pytest==7.4.4 pytest-benchmark==4.0.0 python-mimeparse==1.6.0 six==1.16.0 diff --git a/instrumentation/opentelemetry-instrumentation-falcon/test-requirements-1.txt b/instrumentation/opentelemetry-instrumentation-falcon/test-requirements-1.txt index ad476d7c22..68b1aba13d 100644 --- a/instrumentation/opentelemetry-instrumentation-falcon/test-requirements-1.txt +++ b/instrumentation/opentelemetry-instrumentation-falcon/test-requirements-1.txt @@ -1,14 +1,12 @@ asgiref==3.7.2 -attrs==23.2.0 Deprecated==1.2.14 falcon==2.0.0 importlib-metadata==6.11.0 iniconfig==2.0.0 -packaging==23.2 -pluggy==1.4.0 -py==1.11.0 +packaging==24.0 +pluggy==1.5.0 py-cpuinfo==9.0.0 -pytest==7.1.3 +pytest==7.4.4 pytest-benchmark==4.0.0 tomli==2.0.1 typing_extensions==4.10.0 diff --git a/instrumentation/opentelemetry-instrumentation-falcon/test-requirements-2.txt b/instrumentation/opentelemetry-instrumentation-falcon/test-requirements-2.txt index 6c5c3e8ac9..4b4f8e7c0d 100644 --- a/instrumentation/opentelemetry-instrumentation-falcon/test-requirements-2.txt +++ b/instrumentation/opentelemetry-instrumentation-falcon/test-requirements-2.txt @@ -1,14 +1,12 @@ asgiref==3.7.2 -attrs==23.2.0 Deprecated==1.2.14 falcon==3.1.1 importlib-metadata==6.11.0 iniconfig==2.0.0 -packaging==23.2 -pluggy==1.4.0 -py==1.11.0 +packaging==24.0 +pluggy==1.5.0 py-cpuinfo==9.0.0 -pytest==7.1.3 +pytest==7.4.4 pytest-benchmark==4.0.0 tomli==2.0.1 typing_extensions==4.10.0 diff --git a/instrumentation/opentelemetry-instrumentation-fastapi/test-requirements.txt b/instrumentation/opentelemetry-instrumentation-fastapi/test-requirements.txt index 8d7bf3ad78..44547cb0ea 100644 --- a/instrumentation/opentelemetry-instrumentation-fastapi/test-requirements.txt +++ b/instrumentation/opentelemetry-instrumentation-fastapi/test-requirements.txt @@ -1,7 +1,6 @@ annotated-types==0.6.0 anyio==4.3.0 asgiref==3.7.2 -attrs==23.2.0 certifi==2024.2.2 charset-normalizer==3.3.2 Deprecated==1.2.14 @@ -13,13 +12,12 @@ httpx==0.27.0 idna==3.6 importlib-metadata==6.11.0 iniconfig==2.0.0 -packaging==23.2 -pluggy==1.4.0 -py==1.11.0 +packaging==24.0 +pluggy==1.5.0 py-cpuinfo==9.0.0 pydantic==2.6.2 pydantic_core==2.16.3 -pytest==7.1.3 +pytest==7.4.4 pytest-benchmark==4.0.0 requests==2.31.0 sniffio==1.3.0 diff --git a/instrumentation/opentelemetry-instrumentation-flask/test-requirements-0.txt b/instrumentation/opentelemetry-instrumentation-flask/test-requirements-0.txt index fbefeebdb4..fcedc7c695 100644 --- a/instrumentation/opentelemetry-instrumentation-flask/test-requirements-0.txt +++ b/instrumentation/opentelemetry-instrumentation-flask/test-requirements-0.txt @@ -1,5 +1,4 @@ asgiref==3.7.2 -attrs==23.2.0 click==8.1.7 Deprecated==1.2.14 Flask==2.1.3 @@ -8,11 +7,10 @@ iniconfig==2.0.0 itsdangerous==2.1.2 Jinja2==3.1.3 MarkupSafe==2.1.2 -packaging==23.2 -pluggy==1.4.0 -py==1.11.0 +packaging==24.0 +pluggy==1.5.0 py-cpuinfo==9.0.0 -pytest==7.1.3 +pytest==7.4.4 pytest-benchmark==4.0.0 tomli==2.0.1 typing_extensions==4.9.0 diff --git a/instrumentation/opentelemetry-instrumentation-flask/test-requirements-1.txt b/instrumentation/opentelemetry-instrumentation-flask/test-requirements-1.txt index 41583ad7f9..c6773ad2e9 100644 --- a/instrumentation/opentelemetry-instrumentation-flask/test-requirements-1.txt +++ b/instrumentation/opentelemetry-instrumentation-flask/test-requirements-1.txt @@ -1,5 +1,4 @@ asgiref==3.7.2 -attrs==23.2.0 click==8.1.7 Deprecated==1.2.14 Flask==2.2.0 @@ -8,11 +7,10 @@ iniconfig==2.0.0 itsdangerous==2.1.2 Jinja2==3.1.3 MarkupSafe==2.1.2 -packaging==23.2 -pluggy==1.4.0 -py==1.11.0 +packaging==24.0 +pluggy==1.5.0 py-cpuinfo==9.0.0 -pytest==7.1.3 +pytest==7.4.4 pytest-benchmark==4.0.0 tomli==2.0.1 typing_extensions==4.9.0 diff --git a/instrumentation/opentelemetry-instrumentation-flask/test-requirements-2.txt b/instrumentation/opentelemetry-instrumentation-flask/test-requirements-2.txt index 3a89328861..3c7be28971 100644 --- a/instrumentation/opentelemetry-instrumentation-flask/test-requirements-2.txt +++ b/instrumentation/opentelemetry-instrumentation-flask/test-requirements-2.txt @@ -1,5 +1,4 @@ asgiref==3.7.2 -attrs==23.2.0 blinker==1.7.0 click==8.1.7 Deprecated==1.2.14 @@ -9,11 +8,10 @@ iniconfig==2.0.0 itsdangerous==2.1.2 Jinja2==3.1.3 MarkupSafe==2.1.2 -packaging==23.2 -pluggy==1.4.0 -py==1.11.0 +packaging==24.0 +pluggy==1.5.0 py-cpuinfo==9.0.0 -pytest==7.1.3 +pytest==7.4.4 pytest-benchmark==4.0.0 tomli==2.0.1 typing_extensions==4.9.0 diff --git a/instrumentation/opentelemetry-instrumentation-grpc/test-requirements.txt b/instrumentation/opentelemetry-instrumentation-grpc/test-requirements.txt index 9303dc27c0..d30aa5c5e9 100644 --- a/instrumentation/opentelemetry-instrumentation-grpc/test-requirements.txt +++ b/instrumentation/opentelemetry-instrumentation-grpc/test-requirements.txt @@ -1,15 +1,13 @@ asgiref==3.7.2 -attrs==23.2.0 Deprecated==1.2.14 grpcio==1.62.0 importlib-metadata==6.11.0 iniconfig==2.0.0 -packaging==23.2 -pluggy==1.4.0 +packaging==24.0 +pluggy==1.5.0 protobuf==3.20.3 -py==1.11.0 py-cpuinfo==9.0.0 -pytest==7.1.3 +pytest==7.4.4 pytest-benchmark==4.0.0 tomli==2.0.1 typing_extensions==4.9.0 diff --git a/instrumentation/opentelemetry-instrumentation-httpx/test-requirements-0.txt b/instrumentation/opentelemetry-instrumentation-httpx/test-requirements-0.txt index 2d3a8399d8..ad9e297219 100644 --- a/instrumentation/opentelemetry-instrumentation-httpx/test-requirements-0.txt +++ b/instrumentation/opentelemetry-instrumentation-httpx/test-requirements-0.txt @@ -1,6 +1,5 @@ anyio==3.7.1 asgiref==3.7.2 -attrs==23.2.0 certifi==2024.2.2 Deprecated==1.2.14 exceptiongroup==1.2.0 @@ -10,11 +9,10 @@ httpx==0.18.2 idna==3.6 importlib-metadata==6.11.0 iniconfig==2.0.0 -packaging==23.2 -pluggy==1.4.0 -py==1.11.0 +packaging==24.0 +pluggy==1.5.0 py-cpuinfo==9.0.0 -pytest==7.1.3 +pytest==7.4.4 pytest-benchmark==4.0.0 respx==0.17.1 rfc3986==1.5.0 diff --git a/instrumentation/opentelemetry-instrumentation-httpx/test-requirements-1.txt b/instrumentation/opentelemetry-instrumentation-httpx/test-requirements-1.txt index 4a36398fc1..d1526ef5c1 100644 --- a/instrumentation/opentelemetry-instrumentation-httpx/test-requirements-1.txt +++ b/instrumentation/opentelemetry-instrumentation-httpx/test-requirements-1.txt @@ -1,6 +1,5 @@ anyio==4.3.0 asgiref==3.7.2 -attrs==23.2.0 certifi==2024.2.2 Deprecated==1.2.14 exceptiongroup==1.2.0 @@ -10,11 +9,10 @@ httpx==0.27.0 idna==3.6 importlib-metadata==6.11.0 iniconfig==2.0.0 -packaging==23.2 -pluggy==1.4.0 -py==1.11.0 +packaging==24.0 +pluggy==1.5.0 py-cpuinfo==9.0.0 -pytest==7.1.3 +pytest==7.4.4 pytest-benchmark==4.0.0 respx==0.20.2 sniffio==1.3.1 diff --git a/instrumentation/opentelemetry-instrumentation-jinja2/test-requirements.txt b/instrumentation/opentelemetry-instrumentation-jinja2/test-requirements.txt index d8ab59ac2d..6461129bee 100644 --- a/instrumentation/opentelemetry-instrumentation-jinja2/test-requirements.txt +++ b/instrumentation/opentelemetry-instrumentation-jinja2/test-requirements.txt @@ -1,15 +1,13 @@ asgiref==3.7.2 -attrs==23.2.0 Deprecated==1.2.14 importlib-metadata==6.11.0 iniconfig==2.0.0 Jinja2==3.1.3 MarkupSafe==2.0.1 -packaging==23.2 -pluggy==1.4.0 -py==1.11.0 +packaging==24.0 +pluggy==1.5.0 py-cpuinfo==9.0.0 -pytest==7.1.3 +pytest==7.4.4 pytest-benchmark==4.0.0 tomli==2.0.1 typing_extensions==4.9.0 diff --git a/instrumentation/opentelemetry-instrumentation-kafka-python/test-requirements.txt b/instrumentation/opentelemetry-instrumentation-kafka-python/test-requirements.txt index 96bef86dbe..2f7007f872 100644 --- a/instrumentation/opentelemetry-instrumentation-kafka-python/test-requirements.txt +++ b/instrumentation/opentelemetry-instrumentation-kafka-python/test-requirements.txt @@ -1,14 +1,12 @@ asgiref==3.7.2 -attrs==23.2.0 Deprecated==1.2.14 importlib-metadata==6.11.0 iniconfig==2.0.0 kafka-python==2.0.2 -packaging==23.2 -pluggy==1.4.0 -py==1.11.0 +packaging==24.0 +pluggy==1.5.0 py-cpuinfo==9.0.0 -pytest==7.1.3 +pytest==7.4.4 pytest-benchmark==4.0.0 tomli==2.0.1 typing_extensions==4.9.0 diff --git a/instrumentation/opentelemetry-instrumentation-logging/test-requirements.txt b/instrumentation/opentelemetry-instrumentation-logging/test-requirements.txt index f376796169..b7fcdc3dee 100644 --- a/instrumentation/opentelemetry-instrumentation-logging/test-requirements.txt +++ b/instrumentation/opentelemetry-instrumentation-logging/test-requirements.txt @@ -1,13 +1,11 @@ asgiref==3.7.2 -attrs==23.2.0 Deprecated==1.2.14 importlib-metadata==6.11.0 iniconfig==2.0.0 -packaging==23.2 -pluggy==1.4.0 -py==1.11.0 +packaging==24.0 +pluggy==1.5.0 py-cpuinfo==9.0.0 -pytest==7.1.3 +pytest==7.4.4 pytest-benchmark==4.0.0 tomli==2.0.1 typing_extensions==4.9.0 diff --git a/instrumentation/opentelemetry-instrumentation-mysql/test-requirements.txt b/instrumentation/opentelemetry-instrumentation-mysql/test-requirements.txt index f113b768b1..95cd6ab35f 100644 --- a/instrumentation/opentelemetry-instrumentation-mysql/test-requirements.txt +++ b/instrumentation/opentelemetry-instrumentation-mysql/test-requirements.txt @@ -1,14 +1,12 @@ asgiref==3.7.2 -attrs==23.2.0 Deprecated==1.2.14 importlib-metadata==6.11.0 iniconfig==2.0.0 mysql-connector-python==8.3.0 -packaging==23.2 -pluggy==1.4.0 -py==1.11.0 +packaging==24.0 +pluggy==1.5.0 py-cpuinfo==9.0.0 -pytest==7.1.3 +pytest==7.4.4 pytest-benchmark==4.0.0 tomli==2.0.1 typing_extensions==4.9.0 diff --git a/instrumentation/opentelemetry-instrumentation-mysqlclient/test-requirements.txt b/instrumentation/opentelemetry-instrumentation-mysqlclient/test-requirements.txt index afa2ccae6c..78060fbccc 100644 --- a/instrumentation/opentelemetry-instrumentation-mysqlclient/test-requirements.txt +++ b/instrumentation/opentelemetry-instrumentation-mysqlclient/test-requirements.txt @@ -1,14 +1,12 @@ asgiref==3.7.2 -attrs==23.2.0 Deprecated==1.2.14 importlib-metadata==6.11.0 iniconfig==2.0.0 mysqlclient==2.2.4 -packaging==23.2 -pluggy==1.4.0 -py==1.11.0 +packaging==24.0 +pluggy==1.5.0 py-cpuinfo==9.0.0 -pytest==7.1.3 +pytest==7.4.4 pytest-benchmark==4.0.0 tomli==2.0.1 typing_extensions==4.9.0 diff --git a/instrumentation/opentelemetry-instrumentation-pika/test-requirements-0.txt b/instrumentation/opentelemetry-instrumentation-pika/test-requirements-0.txt index fb3c6def5a..b6aa239e0f 100644 --- a/instrumentation/opentelemetry-instrumentation-pika/test-requirements-0.txt +++ b/instrumentation/opentelemetry-instrumentation-pika/test-requirements-0.txt @@ -1,14 +1,12 @@ asgiref==3.7.2 -attrs==23.2.0 Deprecated==1.2.14 importlib-metadata==6.11.0 iniconfig==2.0.0 -packaging==23.2 +packaging==24.0 pika==0.13.1 -pluggy==1.4.0 -py==1.11.0 +pluggy==1.5.0 py-cpuinfo==9.0.0 -pytest==7.1.3 +pytest==7.4.4 pytest-benchmark==4.0.0 tomli==2.0.1 typing_extensions==4.10.0 diff --git a/instrumentation/opentelemetry-instrumentation-pika/test-requirements-1.txt b/instrumentation/opentelemetry-instrumentation-pika/test-requirements-1.txt index d3ce673dab..334d08f537 100644 --- a/instrumentation/opentelemetry-instrumentation-pika/test-requirements-1.txt +++ b/instrumentation/opentelemetry-instrumentation-pika/test-requirements-1.txt @@ -1,14 +1,12 @@ asgiref==3.7.2 -attrs==23.2.0 Deprecated==1.2.14 importlib-metadata==6.11.0 iniconfig==2.0.0 -packaging==23.2 +packaging==24.0 pika==1.3.2 -pluggy==1.4.0 -py==1.11.0 +pluggy==1.5.0 py-cpuinfo==9.0.0 -pytest==7.1.3 +pytest==7.4.4 pytest-benchmark==4.0.0 tomli==2.0.1 typing_extensions==4.10.0 diff --git a/instrumentation/opentelemetry-instrumentation-psycopg/test-requirements-0.txt b/instrumentation/opentelemetry-instrumentation-psycopg/test-requirements-0.txt index 4b57cb1ca5..d9e9b4de0b 100644 --- a/instrumentation/opentelemetry-instrumentation-psycopg/test-requirements-0.txt +++ b/instrumentation/opentelemetry-instrumentation-psycopg/test-requirements-0.txt @@ -1,15 +1,13 @@ asgiref==3.7.2 -attrs==23.2.0 backports.zoneinfo==0.2.1 Deprecated==1.2.14 importlib-metadata==6.11.0 iniconfig==2.0.0 -packaging==23.2 -pluggy==1.4.0 +packaging==24.0 +pluggy==1.5.0 psycopg==3.1.18 -py==1.11.0 py-cpuinfo==9.0.0 -pytest==7.1.3 +pytest==7.4.4 pytest-benchmark==4.0.0 tomli==2.0.1 typing_extensions==4.10.0 diff --git a/instrumentation/opentelemetry-instrumentation-psycopg/test-requirements-1.txt b/instrumentation/opentelemetry-instrumentation-psycopg/test-requirements-1.txt index d449374047..9269a3c378 100644 --- a/instrumentation/opentelemetry-instrumentation-psycopg/test-requirements-1.txt +++ b/instrumentation/opentelemetry-instrumentation-psycopg/test-requirements-1.txt @@ -1,14 +1,12 @@ asgiref==3.7.2 -attrs==23.2.0 Deprecated==1.2.14 importlib-metadata==6.11.0 iniconfig==2.0.0 -packaging==23.2 -pluggy==1.4.0 +packaging==24.0 +pluggy==1.5.0 psycopg==3.1.18 -py==1.11.0 py-cpuinfo==9.0.0 -pytest==7.1.3 +pytest==7.4.4 pytest-benchmark==4.0.0 tomli==2.0.1 typing_extensions==4.10.0 diff --git a/instrumentation/opentelemetry-instrumentation-psycopg2/test-requirements.txt b/instrumentation/opentelemetry-instrumentation-psycopg2/test-requirements.txt index ade3b5fd26..28ad25715d 100644 --- a/instrumentation/opentelemetry-instrumentation-psycopg2/test-requirements.txt +++ b/instrumentation/opentelemetry-instrumentation-psycopg2/test-requirements.txt @@ -1,14 +1,12 @@ asgiref==3.7.2 -attrs==23.2.0 Deprecated==1.2.14 importlib-metadata==6.11.0 iniconfig==2.0.0 -packaging==23.2 -pluggy==1.4.0 +packaging==24.0 +pluggy==1.5.0 psycopg2==2.9.9 -py==1.11.0 py-cpuinfo==9.0.0 -pytest==7.1.3 +pytest==7.4.4 pytest-benchmark==4.0.0 tomli==2.0.1 typing_extensions==4.10.0 diff --git a/instrumentation/opentelemetry-instrumentation-pymemcache/test-requirements-0.txt b/instrumentation/opentelemetry-instrumentation-pymemcache/test-requirements-0.txt index 2e7313ab6e..ddb06914f7 100644 --- a/instrumentation/opentelemetry-instrumentation-pymemcache/test-requirements-0.txt +++ b/instrumentation/opentelemetry-instrumentation-pymemcache/test-requirements-0.txt @@ -1,14 +1,12 @@ asgiref==3.7.2 -attrs==23.2.0 Deprecated==1.2.14 importlib-metadata==6.11.0 iniconfig==2.0.0 -packaging==23.2 -pluggy==1.4.0 -py==1.11.0 +packaging==24.0 +pluggy==1.5.0 py-cpuinfo==9.0.0 pymemcache==1.3.5 -pytest==7.1.3 +pytest==7.4.4 pytest-benchmark==4.0.0 six==1.16.0 tomli==2.0.1 diff --git a/instrumentation/opentelemetry-instrumentation-pymemcache/test-requirements-1.txt b/instrumentation/opentelemetry-instrumentation-pymemcache/test-requirements-1.txt index a1a3cc4fb1..a6ad4d0248 100644 --- a/instrumentation/opentelemetry-instrumentation-pymemcache/test-requirements-1.txt +++ b/instrumentation/opentelemetry-instrumentation-pymemcache/test-requirements-1.txt @@ -1,14 +1,12 @@ asgiref==3.7.2 -attrs==23.2.0 Deprecated==1.2.14 importlib-metadata==6.11.0 iniconfig==2.0.0 -packaging==23.2 -pluggy==1.4.0 -py==1.11.0 +packaging==24.0 +pluggy==1.5.0 py-cpuinfo==9.0.0 pymemcache==2.2.2 -pytest==7.1.3 +pytest==7.4.4 pytest-benchmark==4.0.0 six==1.16.0 tomli==2.0.1 diff --git a/instrumentation/opentelemetry-instrumentation-pymemcache/test-requirements-2.txt b/instrumentation/opentelemetry-instrumentation-pymemcache/test-requirements-2.txt index cb28ea22d7..7405224a8d 100644 --- a/instrumentation/opentelemetry-instrumentation-pymemcache/test-requirements-2.txt +++ b/instrumentation/opentelemetry-instrumentation-pymemcache/test-requirements-2.txt @@ -1,14 +1,12 @@ asgiref==3.7.2 -attrs==23.2.0 Deprecated==1.2.14 importlib-metadata==6.11.0 iniconfig==2.0.0 -packaging==23.2 -pluggy==1.4.0 -py==1.11.0 +packaging==24.0 +pluggy==1.5.0 py-cpuinfo==9.0.0 pymemcache==3.4.1 -pytest==7.1.3 +pytest==7.4.4 pytest-benchmark==4.0.0 six==1.16.0 tomli==2.0.1 diff --git a/instrumentation/opentelemetry-instrumentation-pymemcache/test-requirements-3.txt b/instrumentation/opentelemetry-instrumentation-pymemcache/test-requirements-3.txt index 40152664ac..d817e70c59 100644 --- a/instrumentation/opentelemetry-instrumentation-pymemcache/test-requirements-3.txt +++ b/instrumentation/opentelemetry-instrumentation-pymemcache/test-requirements-3.txt @@ -1,14 +1,12 @@ asgiref==3.7.2 -attrs==23.2.0 Deprecated==1.2.14 importlib-metadata==6.11.0 iniconfig==2.0.0 -packaging==23.2 -pluggy==1.4.0 -py==1.11.0 +packaging==24.0 +pluggy==1.5.0 py-cpuinfo==9.0.0 pymemcache==3.4.2 -pytest==7.1.3 +pytest==7.4.4 pytest-benchmark==4.0.0 six==1.16.0 tomli==2.0.1 diff --git a/instrumentation/opentelemetry-instrumentation-pymemcache/test-requirements-4.txt b/instrumentation/opentelemetry-instrumentation-pymemcache/test-requirements-4.txt index 9031276ce4..606d79143c 100644 --- a/instrumentation/opentelemetry-instrumentation-pymemcache/test-requirements-4.txt +++ b/instrumentation/opentelemetry-instrumentation-pymemcache/test-requirements-4.txt @@ -1,14 +1,12 @@ asgiref==3.7.2 -attrs==23.2.0 Deprecated==1.2.14 importlib-metadata==6.11.0 iniconfig==2.0.0 -packaging==23.2 -pluggy==1.4.0 -py==1.11.0 +packaging==24.0 +pluggy==1.5.0 py-cpuinfo==9.0.0 pymemcache==4.0.0 -pytest==7.1.3 +pytest==7.4.4 pytest-benchmark==4.0.0 tomli==2.0.1 typing_extensions==4.10.0 diff --git a/instrumentation/opentelemetry-instrumentation-pymongo/test-requirements.txt b/instrumentation/opentelemetry-instrumentation-pymongo/test-requirements.txt index 0ad6375a14..2fd3f4ed0e 100644 --- a/instrumentation/opentelemetry-instrumentation-pymongo/test-requirements.txt +++ b/instrumentation/opentelemetry-instrumentation-pymongo/test-requirements.txt @@ -1,15 +1,13 @@ asgiref==3.7.2 -attrs==23.2.0 Deprecated==1.2.14 dnspython==2.6.1 importlib-metadata==6.11.0 iniconfig==2.0.0 -packaging==23.2 -pluggy==1.4.0 -py==1.11.0 +packaging==24.0 +pluggy==1.5.0 py-cpuinfo==9.0.0 pymongo==4.6.3 -pytest==7.1.3 +pytest==7.4.4 pytest-benchmark==4.0.0 tomli==2.0.1 typing_extensions==4.9.0 diff --git a/instrumentation/opentelemetry-instrumentation-pymysql/test-requirements.txt b/instrumentation/opentelemetry-instrumentation-pymysql/test-requirements.txt index cb6619c5de..9a1076a543 100644 --- a/instrumentation/opentelemetry-instrumentation-pymysql/test-requirements.txt +++ b/instrumentation/opentelemetry-instrumentation-pymysql/test-requirements.txt @@ -1,14 +1,12 @@ asgiref==3.7.2 -attrs==23.2.0 Deprecated==1.2.14 importlib-metadata==6.11.0 iniconfig==2.0.0 -packaging==23.2 -pluggy==1.4.0 -py==1.11.0 +packaging==24.0 +pluggy==1.5.0 py-cpuinfo==9.0.0 PyMySQL==1.1.0 -pytest==7.1.3 +pytest==7.4.4 pytest-benchmark==4.0.0 tomli==2.0.1 typing_extensions==4.9.0 diff --git a/instrumentation/opentelemetry-instrumentation-pyramid/test-requirements.txt b/instrumentation/opentelemetry-instrumentation-pyramid/test-requirements.txt index 1362e7166e..3edddf72c3 100644 --- a/instrumentation/opentelemetry-instrumentation-pyramid/test-requirements.txt +++ b/instrumentation/opentelemetry-instrumentation-pyramid/test-requirements.txt @@ -1,18 +1,16 @@ asgiref==3.7.2 -attrs==23.2.0 Deprecated==1.2.14 hupper==1.12.1 importlib-metadata==6.11.0 iniconfig==2.0.0 -packaging==23.2 +packaging==24.0 PasteDeploy==3.1.0 plaster==1.1.2 plaster-pastedeploy==1.0.1 -pluggy==1.4.0 -py==1.11.0 +pluggy==1.5.0 py-cpuinfo==9.0.0 pyramid==2.0.2 -pytest==7.1.3 +pytest==7.4.4 pytest-benchmark==4.0.0 tomli==2.0.1 translationstring==1.4 diff --git a/instrumentation/opentelemetry-instrumentation-redis/test-requirements.txt b/instrumentation/opentelemetry-instrumentation-redis/test-requirements.txt index 90617f72e6..00b0a04b3e 100644 --- a/instrumentation/opentelemetry-instrumentation-redis/test-requirements.txt +++ b/instrumentation/opentelemetry-instrumentation-redis/test-requirements.txt @@ -1,14 +1,12 @@ asgiref==3.7.2 async-timeout==4.0.3 -attrs==23.2.0 Deprecated==1.2.14 importlib-metadata==6.11.0 iniconfig==2.0.0 -packaging==23.2 -pluggy==1.4.0 -py==1.11.0 +packaging==24.0 +pluggy==1.5.0 py-cpuinfo==9.0.0 -pytest==7.1.3 +pytest==7.4.4 pytest-benchmark==4.0.0 redis==5.0.1 tomli==2.0.1 diff --git a/instrumentation/opentelemetry-instrumentation-remoulade/test-requirements.txt b/instrumentation/opentelemetry-instrumentation-remoulade/test-requirements.txt index c50dfde9b5..0f6374b7ef 100644 --- a/instrumentation/opentelemetry-instrumentation-remoulade/test-requirements.txt +++ b/instrumentation/opentelemetry-instrumentation-remoulade/test-requirements.txt @@ -1,14 +1,12 @@ asgiref==3.7.2 -attrs==23.2.0 Deprecated==1.2.14 importlib-metadata==6.11.0 iniconfig==2.0.0 -packaging==23.2 -pluggy==1.4.0 +packaging==24.0 +pluggy==1.5.0 prometheus_client==0.20.0 -py==1.11.0 py-cpuinfo==9.0.0 -pytest==7.1.3 +pytest==7.4.4 pytest-benchmark==4.0.0 python-dateutil==2.8.2 pytz==2024.1 diff --git a/instrumentation/opentelemetry-instrumentation-requests/test-requirements.txt b/instrumentation/opentelemetry-instrumentation-requests/test-requirements.txt index be34594506..7c56a9b3d1 100644 --- a/instrumentation/opentelemetry-instrumentation-requests/test-requirements.txt +++ b/instrumentation/opentelemetry-instrumentation-requests/test-requirements.txt @@ -1,5 +1,4 @@ asgiref==3.7.2 -attrs==23.2.0 certifi==2024.2.2 charset-normalizer==3.3.2 Deprecated==1.2.14 @@ -7,11 +6,10 @@ httpretty==1.1.4 idna==3.6 importlib-metadata==6.11.0 iniconfig==2.0.0 -packaging==23.2 -pluggy==1.4.0 -py==1.11.0 +packaging==24.0 +pluggy==1.5.0 py-cpuinfo==9.0.0 -pytest==7.1.3 +pytest==7.4.4 pytest-benchmark==4.0.0 requests==2.31.0 tomli==2.0.1 diff --git a/instrumentation/opentelemetry-instrumentation-sklearn/test-requirements.txt b/instrumentation/opentelemetry-instrumentation-sklearn/test-requirements.txt index fc966b4d6a..885caae033 100644 --- a/instrumentation/opentelemetry-instrumentation-sklearn/test-requirements.txt +++ b/instrumentation/opentelemetry-instrumentation-sklearn/test-requirements.txt @@ -1,15 +1,13 @@ asgiref==3.7.2 -attrs==23.2.0 Deprecated==1.2.14 importlib-metadata==6.11.0 iniconfig==2.0.0 joblib==1.3.2 numpy==1.24.4 -packaging==23.2 -pluggy==1.4.0 -py==1.11.0 +packaging==24.0 +pluggy==1.5.0 py-cpuinfo==9.0.0 -pytest==7.1.3 +pytest==7.4.4 pytest-benchmark==4.0.0 scikit-learn==0.24.2 scipy==1.10.1 diff --git a/instrumentation/opentelemetry-instrumentation-sqlalchemy/test-requirements-0.txt b/instrumentation/opentelemetry-instrumentation-sqlalchemy/test-requirements-0.txt index 26fd283824..04f4fe0c4b 100644 --- a/instrumentation/opentelemetry-instrumentation-sqlalchemy/test-requirements-0.txt +++ b/instrumentation/opentelemetry-instrumentation-sqlalchemy/test-requirements-0.txt @@ -1,16 +1,14 @@ asgiref==3.7.2 -attrs==23.2.0 cffi==1.15.1 Deprecated==1.2.14 greenlet==0.4.13 hpy==0.0.4.dev179+g9b5d200 importlib-metadata==6.11.0 iniconfig==2.0.0 -packaging==23.2 -pluggy==1.4.0 -py==1.11.0 +packaging==24.0 +pluggy==1.5.0 py-cpuinfo==9.0.0 -pytest==7.1.3 +pytest==7.4.4 pytest-benchmark==4.0.0 readline==6.2.4.1 SQLAlchemy==1.1.18 diff --git a/instrumentation/opentelemetry-instrumentation-sqlalchemy/test-requirements-1.txt b/instrumentation/opentelemetry-instrumentation-sqlalchemy/test-requirements-1.txt index bfb9dac972..4e1620b772 100644 --- a/instrumentation/opentelemetry-instrumentation-sqlalchemy/test-requirements-1.txt +++ b/instrumentation/opentelemetry-instrumentation-sqlalchemy/test-requirements-1.txt @@ -1,15 +1,13 @@ aiosqlite==0.20.0 asgiref==3.7.2 -attrs==23.2.0 Deprecated==1.2.14 greenlet==3.0.3 importlib-metadata==6.11.0 iniconfig==2.0.0 -packaging==23.2 -pluggy==1.4.0 -py==1.11.0 +packaging==24.0 +pluggy==1.5.0 py-cpuinfo==9.0.0 -pytest==7.1.3 +pytest==7.4.4 pytest-benchmark==4.0.0 SQLAlchemy==1.4.51 tomli==2.0.1 diff --git a/instrumentation/opentelemetry-instrumentation-sqlite3/test-requirements.txt b/instrumentation/opentelemetry-instrumentation-sqlite3/test-requirements.txt index 16cfb33801..848f207c8c 100644 --- a/instrumentation/opentelemetry-instrumentation-sqlite3/test-requirements.txt +++ b/instrumentation/opentelemetry-instrumentation-sqlite3/test-requirements.txt @@ -1,13 +1,11 @@ asgiref==3.7.2 -attrs==23.2.0 Deprecated==1.2.14 importlib-metadata==6.11.0 iniconfig==2.0.0 -packaging==23.2 -pluggy==1.4.0 -py==1.11.0 +packaging==24.0 +pluggy==1.5.0 py-cpuinfo==9.0.0 -pytest==7.1.3 +pytest==7.4.4 pytest-benchmark==4.0.0 tomli==2.0.1 typing_extensions==4.9.0 diff --git a/instrumentation/opentelemetry-instrumentation-starlette/test-requirements.txt b/instrumentation/opentelemetry-instrumentation-starlette/test-requirements.txt index 1cd21039a7..0cd1fb534a 100644 --- a/instrumentation/opentelemetry-instrumentation-starlette/test-requirements.txt +++ b/instrumentation/opentelemetry-instrumentation-starlette/test-requirements.txt @@ -1,6 +1,5 @@ anyio==4.3.0 asgiref==3.7.2 -attrs==23.2.0 certifi==2024.2.2 charset-normalizer==3.3.2 Deprecated==1.2.14 @@ -11,11 +10,10 @@ httpx==0.27.0 idna==3.6 importlib-metadata==6.11.0 iniconfig==2.0.0 -packaging==23.2 -pluggy==1.4.0 -py==1.11.0 +packaging==24.0 +pluggy==1.5.0 py-cpuinfo==9.0.0 -pytest==7.1.3 +pytest==7.4.4 pytest-benchmark==4.0.0 requests==2.31.0 sniffio==1.3.0 diff --git a/instrumentation/opentelemetry-instrumentation-system-metrics/test-requirements.txt b/instrumentation/opentelemetry-instrumentation-system-metrics/test-requirements.txt index ee56025d5f..ddb98399cf 100644 --- a/instrumentation/opentelemetry-instrumentation-system-metrics/test-requirements.txt +++ b/instrumentation/opentelemetry-instrumentation-system-metrics/test-requirements.txt @@ -1,14 +1,12 @@ asgiref==3.7.2 -attrs==23.2.0 Deprecated==1.2.14 importlib-metadata==6.11.0 iniconfig==2.0.0 -packaging==23.2 -pluggy==1.4.0 +packaging==24.0 +pluggy==1.5.0 psutil==5.9.8 -py==1.11.0 py-cpuinfo==9.0.0 -pytest==7.1.3 +pytest==7.4.4 pytest-benchmark==4.0.0 tomli==2.0.1 typing_extensions==4.9.0 diff --git a/instrumentation/opentelemetry-instrumentation-threading/test-requirements.txt b/instrumentation/opentelemetry-instrumentation-threading/test-requirements.txt index 4f9b027918..eb37259669 100644 --- a/instrumentation/opentelemetry-instrumentation-threading/test-requirements.txt +++ b/instrumentation/opentelemetry-instrumentation-threading/test-requirements.txt @@ -1,13 +1,11 @@ asgiref==3.7.2 -attrs==23.2.0 Deprecated==1.2.14 importlib-metadata==6.11.0 iniconfig==2.0.0 -packaging==23.2 -pluggy==1.4.0 -py==1.11.0 +packaging==24.0 +pluggy==1.5.0 py-cpuinfo==9.0.0 -pytest==7.1.3 +pytest==7.4.4 pytest-benchmark==4.0.0 tomli==2.0.1 typing_extensions==4.9.0 diff --git a/instrumentation/opentelemetry-instrumentation-tornado/test-requirements.txt b/instrumentation/opentelemetry-instrumentation-tornado/test-requirements.txt index 9f637278fd..0d22bceff5 100644 --- a/instrumentation/opentelemetry-instrumentation-tornado/test-requirements.txt +++ b/instrumentation/opentelemetry-instrumentation-tornado/test-requirements.txt @@ -1,5 +1,4 @@ asgiref==3.7.2 -attrs==23.2.0 blinker==1.7.0 certifi==2024.2.2 charset-normalizer==3.3.2 @@ -13,11 +12,10 @@ iniconfig==2.0.0 itsdangerous==2.1.2 Jinja2==3.1.3 MarkupSafe==2.1.5 -packaging==23.2 -pluggy==1.4.0 -py==1.11.0 +packaging==24.0 +pluggy==1.5.0 py-cpuinfo==9.0.0 -pytest==7.1.3 +pytest==7.4.4 pytest-benchmark==4.0.0 requests==2.31.0 tomli==2.0.1 diff --git a/instrumentation/opentelemetry-instrumentation-tortoiseorm/test-requirements.txt b/instrumentation/opentelemetry-instrumentation-tortoiseorm/test-requirements.txt index 0fafc56253..2d518c1192 100644 --- a/instrumentation/opentelemetry-instrumentation-tortoiseorm/test-requirements.txt +++ b/instrumentation/opentelemetry-instrumentation-tortoiseorm/test-requirements.txt @@ -1,19 +1,17 @@ aiosqlite==0.17.0 annotated-types==0.6.0 asgiref==3.7.2 -attrs==23.2.0 Deprecated==1.2.14 importlib-metadata==6.11.0 iniconfig==2.0.0 iso8601==1.1.0 -packaging==23.2 -pluggy==1.4.0 -py==1.11.0 +packaging==24.0 +pluggy==1.5.0 py-cpuinfo==9.0.0 pydantic==2.6.2 pydantic_core==2.16.3 pypika-tortoise==0.1.6 -pytest==7.1.3 +pytest==7.4.4 pytest-benchmark==4.0.0 pytz==2024.1 tomli==2.0.1 diff --git a/instrumentation/opentelemetry-instrumentation-urllib/test-requirements.txt b/instrumentation/opentelemetry-instrumentation-urllib/test-requirements.txt index cdb10df7e9..0ac7842086 100644 --- a/instrumentation/opentelemetry-instrumentation-urllib/test-requirements.txt +++ b/instrumentation/opentelemetry-instrumentation-urllib/test-requirements.txt @@ -1,14 +1,12 @@ asgiref==3.7.2 -attrs==23.2.0 Deprecated==1.2.14 httpretty==1.1.4 importlib-metadata==6.11.0 iniconfig==2.0.0 -packaging==23.2 -pluggy==1.4.0 -py==1.11.0 +packaging==24.0 +pluggy==1.5.0 py-cpuinfo==9.0.0 -pytest==7.1.3 +pytest==7.4.4 pytest-benchmark==4.0.0 tomli==2.0.1 typing_extensions==4.9.0 diff --git a/instrumentation/opentelemetry-instrumentation-urllib3/test-requirements-0.txt b/instrumentation/opentelemetry-instrumentation-urllib3/test-requirements-0.txt index 730ef16977..05a76b1bcb 100644 --- a/instrumentation/opentelemetry-instrumentation-urllib3/test-requirements-0.txt +++ b/instrumentation/opentelemetry-instrumentation-urllib3/test-requirements-0.txt @@ -1,14 +1,12 @@ asgiref==3.7.2 -attrs==23.2.0 Deprecated==1.2.14 httpretty==1.1.4 importlib-metadata==6.11.0 iniconfig==2.0.0 -packaging==23.2 -pluggy==1.4.0 -py==1.11.0 +packaging==24.0 +pluggy==1.5.0 py-cpuinfo==9.0.0 -pytest==7.1.3 +pytest==7.4.4 pytest-benchmark==4.0.0 tomli==2.0.1 typing_extensions==4.10.0 diff --git a/instrumentation/opentelemetry-instrumentation-urllib3/test-requirements-1.txt b/instrumentation/opentelemetry-instrumentation-urllib3/test-requirements-1.txt index 1f10502f57..9c6d596068 100644 --- a/instrumentation/opentelemetry-instrumentation-urllib3/test-requirements-1.txt +++ b/instrumentation/opentelemetry-instrumentation-urllib3/test-requirements-1.txt @@ -1,14 +1,12 @@ asgiref==3.7.2 -attrs==23.2.0 Deprecated==1.2.14 httpretty==1.1.4 importlib-metadata==6.11.0 iniconfig==2.0.0 -packaging==23.2 -pluggy==1.4.0 -py==1.11.0 +packaging==24.0 +pluggy==1.5.0 py-cpuinfo==9.0.0 -pytest==7.1.3 +pytest==7.4.4 pytest-benchmark==4.0.0 tomli==2.0.1 typing_extensions==4.10.0 diff --git a/instrumentation/opentelemetry-instrumentation-wsgi/test-requirements.txt b/instrumentation/opentelemetry-instrumentation-wsgi/test-requirements.txt index a4910352ed..a25f8882d1 100644 --- a/instrumentation/opentelemetry-instrumentation-wsgi/test-requirements.txt +++ b/instrumentation/opentelemetry-instrumentation-wsgi/test-requirements.txt @@ -1,13 +1,11 @@ asgiref==3.7.2 -attrs==23.2.0 Deprecated==1.2.14 importlib-metadata==6.11.0 iniconfig==2.0.0 -packaging==23.2 -pluggy==1.4.0 -py==1.11.0 +packaging==24.0 +pluggy==1.5.0 py-cpuinfo==9.0.0 -pytest==7.1.3 +pytest==7.4.4 pytest-benchmark==4.0.0 tomli==2.0.1 typing_extensions==4.9.0 diff --git a/opentelemetry-distro/test-requirements.txt b/opentelemetry-distro/test-requirements.txt index 978389dc9a..b93758ee31 100644 --- a/opentelemetry-distro/test-requirements.txt +++ b/opentelemetry-distro/test-requirements.txt @@ -1,13 +1,11 @@ asgiref==3.7.2 -attrs==23.2.0 Deprecated==1.2.14 importlib-metadata==6.11.0 iniconfig==2.0.0 -packaging==23.2 -pluggy==1.4.0 -py==1.11.0 +packaging==24.0 +pluggy==1.5.0 py-cpuinfo==9.0.0 -pytest==7.1.3 +pytest==7.4.4 pytest-benchmark==4.0.0 tomli==2.0.1 typing_extensions==4.10.0 diff --git a/opentelemetry-instrumentation/test-requirements.txt b/opentelemetry-instrumentation/test-requirements.txt index 473a423bda..2ef62218b1 100644 --- a/opentelemetry-instrumentation/test-requirements.txt +++ b/opentelemetry-instrumentation/test-requirements.txt @@ -1,13 +1,11 @@ asgiref==3.7.2 -attrs==23.2.0 Deprecated==1.2.14 importlib-metadata==6.11.0 iniconfig==2.0.0 -packaging==23.2 -pluggy==1.4.0 -py==1.11.0 +packaging==24.0 +pluggy==1.5.0 py-cpuinfo==9.0.0 -pytest==7.1.3 +pytest==7.4.4 pytest-benchmark==4.0.0 tomli==2.0.1 typing_extensions==4.10.0 diff --git a/propagator/opentelemetry-propagator-aws-xray/test-requirements.txt b/propagator/opentelemetry-propagator-aws-xray/test-requirements.txt index b6b197bdcc..a6249b4a87 100644 --- a/propagator/opentelemetry-propagator-aws-xray/test-requirements.txt +++ b/propagator/opentelemetry-propagator-aws-xray/test-requirements.txt @@ -1,16 +1,14 @@ asgiref==3.7.2 -attrs==23.2.0 certifi==2024.2.2 charset-normalizer==3.3.2 Deprecated==1.2.14 idna==3.6 importlib-metadata==6.11.0 iniconfig==2.0.0 -packaging==23.2 -pluggy==1.4.0 -py==1.11.0 +packaging==24.0 +pluggy==1.5.0 py-cpuinfo==9.0.0 -pytest==7.1.3 +pytest==7.4.4 pytest-benchmark==4.0.0 requests==2.31.0 tomli==2.0.1 diff --git a/propagator/opentelemetry-propagator-ot-trace/test-requirements.txt b/propagator/opentelemetry-propagator-ot-trace/test-requirements.txt index 69c1829a5c..59c30eabf4 100644 --- a/propagator/opentelemetry-propagator-ot-trace/test-requirements.txt +++ b/propagator/opentelemetry-propagator-ot-trace/test-requirements.txt @@ -1,13 +1,11 @@ asgiref==3.7.2 -attrs==23.2.0 Deprecated==1.2.14 importlib-metadata==6.11.0 iniconfig==2.0.0 -packaging==23.2 -pluggy==1.4.0 -py==1.11.0 +packaging==24.0 +pluggy==1.5.0 py-cpuinfo==9.0.0 -pytest==7.1.3 +pytest==7.4.4 pytest-benchmark==4.0.0 tomli==2.0.1 typing_extensions==4.10.0 diff --git a/resource/opentelemetry-resource-detector-container/test-requirements.txt b/resource/opentelemetry-resource-detector-container/test-requirements.txt index eee7aaa46d..ecacb62b12 100644 --- a/resource/opentelemetry-resource-detector-container/test-requirements.txt +++ b/resource/opentelemetry-resource-detector-container/test-requirements.txt @@ -1,13 +1,11 @@ asgiref==3.7.2 -attrs==23.2.0 Deprecated==1.2.14 importlib-metadata==6.11.0 iniconfig==2.0.0 -packaging==23.2 -pluggy==1.4.0 -py==1.11.0 +packaging==24.0 +pluggy==1.5.0 py-cpuinfo==9.0.0 -pytest==7.1.3 +pytest==7.4.4 pytest-benchmark==4.0.0 tomli==2.0.1 typing_extensions==4.10.0 diff --git a/sdk-extension/opentelemetry-sdk-extension-aws/test-requirements.txt b/sdk-extension/opentelemetry-sdk-extension-aws/test-requirements.txt index e569ade322..4ed081e748 100644 --- a/sdk-extension/opentelemetry-sdk-extension-aws/test-requirements.txt +++ b/sdk-extension/opentelemetry-sdk-extension-aws/test-requirements.txt @@ -1,13 +1,11 @@ asgiref==3.7.2 -attrs==23.2.0 Deprecated==1.2.14 importlib-metadata==6.11.0 iniconfig==2.0.0 -packaging==23.2 -pluggy==1.4.0 -py==1.11.0 +packaging==24.0 +pluggy==1.5.0 py-cpuinfo==9.0.0 -pytest==7.1.3 +pytest==7.4.4 pytest-benchmark==4.0.0 tomli==2.0.1 typing_extensions==4.10.0 From 0216a9644af00efe99311ff2380a6adf4f244a84 Mon Sep 17 00:00:00 2001 From: Riccardo Magliocchetti Date: Fri, 7 Jun 2024 18:14:21 +0200 Subject: [PATCH 40/56] CONTRIBUTING: Make it more explicit you need to sign the CLA (#2582) --- CONTRIBUTING.md | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 743449c2a7..b3ae4cbfed 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -13,6 +13,10 @@ on how to become a [**Member**](https://github.com/open-telemetry/community/blob [**Approver**](https://github.com/open-telemetry/community/blob/main/community-membership.md#approver) and [**Maintainer**](https://github.com/open-telemetry/community/blob/main/community-membership.md#maintainer). +Before you can contribute, you will need to sign the [Contributor License Agreement](https://docs.linuxfoundation.org/lfx/easycla/contributors). + +Please also read the [OpenTelemetry Contributor Guide](https://github.com/open-telemetry/community/blob/main/CONTRIBUTING.md). + ## Index * [Find a Buddy and get Started Quickly](#find-a-buddy-and-get-started-quickly) From 3511ed180d568fa180420b9fc4968cd8c70a94c7 Mon Sep 17 00:00:00 2001 From: Riccardo Magliocchetti Date: Fri, 7 Jun 2024 21:54:38 +0200 Subject: [PATCH 41/56] requirements: Bump idna to 3.7 (#2583) --- .../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-boto/test-requirements.txt | 2 +- .../test-requirements.txt | 2 +- .../opentelemetry-instrumentation-fastapi/test-requirements.txt | 2 +- .../opentelemetry-instrumentation-httpx/test-requirements-0.txt | 2 +- .../opentelemetry-instrumentation-httpx/test-requirements-1.txt | 2 +- .../test-requirements.txt | 2 +- .../test-requirements.txt | 2 +- .../opentelemetry-instrumentation-tornado/test-requirements.txt | 2 +- 14 files changed, 14 insertions(+), 14 deletions(-) diff --git a/instrumentation/opentelemetry-instrumentation-aio-pika/test-requirements-0.txt b/instrumentation/opentelemetry-instrumentation-aio-pika/test-requirements-0.txt index 2935a1c7e0..3744af85b1 100644 --- a/instrumentation/opentelemetry-instrumentation-aio-pika/test-requirements-0.txt +++ b/instrumentation/opentelemetry-instrumentation-aio-pika/test-requirements-0.txt @@ -2,7 +2,7 @@ aio-pika==7.2.0 aiormq==6.2.3 asgiref==3.7.2 Deprecated==1.2.14 -idna==3.6 +idna==3.7 importlib-metadata==6.11.0 iniconfig==2.0.0 multidict==6.0.5 diff --git a/instrumentation/opentelemetry-instrumentation-aio-pika/test-requirements-1.txt b/instrumentation/opentelemetry-instrumentation-aio-pika/test-requirements-1.txt index 2db29de3ea..bb35e2e2ba 100644 --- a/instrumentation/opentelemetry-instrumentation-aio-pika/test-requirements-1.txt +++ b/instrumentation/opentelemetry-instrumentation-aio-pika/test-requirements-1.txt @@ -2,7 +2,7 @@ aio-pika==8.3.0 aiormq==6.6.4 asgiref==3.7.2 Deprecated==1.2.14 -idna==3.6 +idna==3.7 importlib-metadata==6.11.0 iniconfig==2.0.0 multidict==6.0.5 diff --git a/instrumentation/opentelemetry-instrumentation-aio-pika/test-requirements-2.txt b/instrumentation/opentelemetry-instrumentation-aio-pika/test-requirements-2.txt index 536646e287..3b17c80c25 100644 --- a/instrumentation/opentelemetry-instrumentation-aio-pika/test-requirements-2.txt +++ b/instrumentation/opentelemetry-instrumentation-aio-pika/test-requirements-2.txt @@ -2,7 +2,7 @@ aio-pika==9.0.5 aiormq==6.7.1 asgiref==3.7.2 Deprecated==1.2.14 -idna==3.6 +idna==3.7 importlib-metadata==6.11.0 iniconfig==2.0.0 multidict==6.0.5 diff --git a/instrumentation/opentelemetry-instrumentation-aio-pika/test-requirements-3.txt b/instrumentation/opentelemetry-instrumentation-aio-pika/test-requirements-3.txt index 12168d97b1..4ea66f8dd6 100644 --- a/instrumentation/opentelemetry-instrumentation-aio-pika/test-requirements-3.txt +++ b/instrumentation/opentelemetry-instrumentation-aio-pika/test-requirements-3.txt @@ -2,7 +2,7 @@ aio-pika==9.4.1 aiormq==6.8.0 asgiref==3.7.2 Deprecated==1.2.14 -idna==3.6 +idna==3.7 importlib-metadata==6.11.0 iniconfig==2.0.0 multidict==6.0.5 diff --git a/instrumentation/opentelemetry-instrumentation-aiohttp-client/test-requirements.txt b/instrumentation/opentelemetry-instrumentation-aiohttp-client/test-requirements.txt index 0209ca3dd6..75128c7c42 100644 --- a/instrumentation/opentelemetry-instrumentation-aiohttp-client/test-requirements.txt +++ b/instrumentation/opentelemetry-instrumentation-aiohttp-client/test-requirements.txt @@ -10,7 +10,7 @@ Deprecated==1.2.14 Flask==3.0.2 frozenlist==1.4.1 http_server_mock==1.7 -idna==3.6 +idna==3.7 importlib-metadata==6.11.0 iniconfig==2.0.0 itsdangerous==2.1.2 diff --git a/instrumentation/opentelemetry-instrumentation-aiohttp-server/test-requirements.txt b/instrumentation/opentelemetry-instrumentation-aiohttp-server/test-requirements.txt index 16529b6db1..c62da59804 100644 --- a/instrumentation/opentelemetry-instrumentation-aiohttp-server/test-requirements.txt +++ b/instrumentation/opentelemetry-instrumentation-aiohttp-server/test-requirements.txt @@ -4,7 +4,7 @@ asgiref==3.7.2 async-timeout==4.0.3 Deprecated==1.2.14 frozenlist==1.4.1 -idna==3.6 +idna==3.7 importlib-metadata==6.11.0 iniconfig==2.0.0 multidict==6.0.5 diff --git a/instrumentation/opentelemetry-instrumentation-boto/test-requirements.txt b/instrumentation/opentelemetry-instrumentation-boto/test-requirements.txt index 8d6d6692ce..59d9c37010 100644 --- a/instrumentation/opentelemetry-instrumentation-boto/test-requirements.txt +++ b/instrumentation/opentelemetry-instrumentation-boto/test-requirements.txt @@ -8,7 +8,7 @@ charset-normalizer==3.3.2 cryptography==42.0.3 Deprecated==1.2.14 docker==7.0.0 -idna==3.6 +idna==3.7 importlib-metadata==6.11.0 iniconfig==2.0.0 Jinja2==3.1.4 diff --git a/instrumentation/opentelemetry-instrumentation-botocore/test-requirements.txt b/instrumentation/opentelemetry-instrumentation-botocore/test-requirements.txt index b3fa765d5c..29c6c90230 100644 --- a/instrumentation/opentelemetry-instrumentation-botocore/test-requirements.txt +++ b/instrumentation/opentelemetry-instrumentation-botocore/test-requirements.txt @@ -8,7 +8,7 @@ charset-normalizer==3.3.2 cryptography==42.0.5 Deprecated==1.2.14 docker==7.0.0 -idna==3.6 +idna==3.7 importlib-metadata==6.11.0 iniconfig==2.0.0 Jinja2==3.1.4 diff --git a/instrumentation/opentelemetry-instrumentation-fastapi/test-requirements.txt b/instrumentation/opentelemetry-instrumentation-fastapi/test-requirements.txt index 44547cb0ea..3806570105 100644 --- a/instrumentation/opentelemetry-instrumentation-fastapi/test-requirements.txt +++ b/instrumentation/opentelemetry-instrumentation-fastapi/test-requirements.txt @@ -9,7 +9,7 @@ fastapi==0.109.2 h11==0.14.0 httpcore==1.0.4 httpx==0.27.0 -idna==3.6 +idna==3.7 importlib-metadata==6.11.0 iniconfig==2.0.0 packaging==24.0 diff --git a/instrumentation/opentelemetry-instrumentation-httpx/test-requirements-0.txt b/instrumentation/opentelemetry-instrumentation-httpx/test-requirements-0.txt index ad9e297219..ca3a0908fa 100644 --- a/instrumentation/opentelemetry-instrumentation-httpx/test-requirements-0.txt +++ b/instrumentation/opentelemetry-instrumentation-httpx/test-requirements-0.txt @@ -6,7 +6,7 @@ exceptiongroup==1.2.0 h11==0.12.0 httpcore==0.13.7 httpx==0.18.2 -idna==3.6 +idna==3.7 importlib-metadata==6.11.0 iniconfig==2.0.0 packaging==24.0 diff --git a/instrumentation/opentelemetry-instrumentation-httpx/test-requirements-1.txt b/instrumentation/opentelemetry-instrumentation-httpx/test-requirements-1.txt index d1526ef5c1..d3476cea4b 100644 --- a/instrumentation/opentelemetry-instrumentation-httpx/test-requirements-1.txt +++ b/instrumentation/opentelemetry-instrumentation-httpx/test-requirements-1.txt @@ -6,7 +6,7 @@ exceptiongroup==1.2.0 h11==0.14.0 httpcore==1.0.4 httpx==0.27.0 -idna==3.6 +idna==3.7 importlib-metadata==6.11.0 iniconfig==2.0.0 packaging==24.0 diff --git a/instrumentation/opentelemetry-instrumentation-requests/test-requirements.txt b/instrumentation/opentelemetry-instrumentation-requests/test-requirements.txt index 7c56a9b3d1..16458d96d4 100644 --- a/instrumentation/opentelemetry-instrumentation-requests/test-requirements.txt +++ b/instrumentation/opentelemetry-instrumentation-requests/test-requirements.txt @@ -3,7 +3,7 @@ certifi==2024.2.2 charset-normalizer==3.3.2 Deprecated==1.2.14 httpretty==1.1.4 -idna==3.6 +idna==3.7 importlib-metadata==6.11.0 iniconfig==2.0.0 packaging==24.0 diff --git a/instrumentation/opentelemetry-instrumentation-starlette/test-requirements.txt b/instrumentation/opentelemetry-instrumentation-starlette/test-requirements.txt index 0cd1fb534a..53f85db350 100644 --- a/instrumentation/opentelemetry-instrumentation-starlette/test-requirements.txt +++ b/instrumentation/opentelemetry-instrumentation-starlette/test-requirements.txt @@ -7,7 +7,7 @@ exceptiongroup==1.2.0 h11==0.14.0 httpcore==1.0.4 httpx==0.27.0 -idna==3.6 +idna==3.7 importlib-metadata==6.11.0 iniconfig==2.0.0 packaging==24.0 diff --git a/instrumentation/opentelemetry-instrumentation-tornado/test-requirements.txt b/instrumentation/opentelemetry-instrumentation-tornado/test-requirements.txt index 0d22bceff5..db4e7ba7d1 100644 --- a/instrumentation/opentelemetry-instrumentation-tornado/test-requirements.txt +++ b/instrumentation/opentelemetry-instrumentation-tornado/test-requirements.txt @@ -6,7 +6,7 @@ click==8.1.7 Deprecated==1.2.14 Flask==3.0.2 http_server_mock==1.7 -idna==3.6 +idna==3.7 importlib-metadata==6.11.0 iniconfig==2.0.0 itsdangerous==2.1.2 From 4357c35dd253e9def9a113affab64b30777bcd6c Mon Sep 17 00:00:00 2001 From: Riccardo Magliocchetti Date: Mon, 10 Jun 2024 17:59:40 +0200 Subject: [PATCH 42/56] requirements: missed pytest and idna bumps (#2592) --- dev-requirements.txt | 2 +- .../test-requirements.txt | 2 +- .../opentelemetry-propagator-aws-xray/test-requirements.txt | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/dev-requirements.txt b/dev-requirements.txt index be65b731c7..60db203e2d 100644 --- a/dev-requirements.txt +++ b/dev-requirements.txt @@ -7,7 +7,7 @@ mypy==0.931 sphinx==7.1.2 sphinx-rtd-theme==2.0.0rc4 sphinx-autodoc-typehints==1.25.2 -pytest==7.1.3 +pytest==7.4.4 pytest-cov==4.1.0 readme-renderer==42.0 bleach==4.1.0 # transient dependency for readme-renderer diff --git a/exporter/opentelemetry-exporter-prometheus-remote-write/test-requirements.txt b/exporter/opentelemetry-exporter-prometheus-remote-write/test-requirements.txt index 7676ce644d..7c3ab4d83e 100644 --- a/exporter/opentelemetry-exporter-prometheus-remote-write/test-requirements.txt +++ b/exporter/opentelemetry-exporter-prometheus-remote-write/test-requirements.txt @@ -3,7 +3,7 @@ certifi==2024.2.2 charset-normalizer==3.3.2 cramjam==2.8.1 Deprecated==1.2.14 -idna==3.6 +idna==3.7 importlib-metadata==6.11.0 iniconfig==2.0.0 packaging==24.0 diff --git a/propagator/opentelemetry-propagator-aws-xray/test-requirements.txt b/propagator/opentelemetry-propagator-aws-xray/test-requirements.txt index a6249b4a87..bbe805e794 100644 --- a/propagator/opentelemetry-propagator-aws-xray/test-requirements.txt +++ b/propagator/opentelemetry-propagator-aws-xray/test-requirements.txt @@ -2,7 +2,7 @@ asgiref==3.7.2 certifi==2024.2.2 charset-normalizer==3.3.2 Deprecated==1.2.14 -idna==3.6 +idna==3.7 importlib-metadata==6.11.0 iniconfig==2.0.0 packaging==24.0 From 97621523b80ebebe5142d4c94f129e056c3b3e29 Mon Sep 17 00:00:00 2001 From: Riccardo Magliocchetti Date: Mon, 10 Jun 2024 18:08:14 +0200 Subject: [PATCH 43/56] requirements: bump Werkzeug (#2594) --- .../test-requirements.txt | 2 +- .../opentelemetry-instrumentation-boto/test-requirements.txt | 2 +- .../opentelemetry-instrumentation-flask/test-requirements-2.txt | 2 +- .../opentelemetry-instrumentation-tornado/test-requirements.txt | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/instrumentation/opentelemetry-instrumentation-aiohttp-client/test-requirements.txt b/instrumentation/opentelemetry-instrumentation-aiohttp-client/test-requirements.txt index 75128c7c42..f02ffb216f 100644 --- a/instrumentation/opentelemetry-instrumentation-aiohttp-client/test-requirements.txt +++ b/instrumentation/opentelemetry-instrumentation-aiohttp-client/test-requirements.txt @@ -26,7 +26,7 @@ requests==2.31.0 tomli==2.0.1 typing_extensions==4.10.0 urllib3==2.2.1 -Werkzeug==3.0.1 +Werkzeug==3.0.3 wrapt==1.16.0 yarl==1.9.4 zipp==3.17.0 diff --git a/instrumentation/opentelemetry-instrumentation-boto/test-requirements.txt b/instrumentation/opentelemetry-instrumentation-boto/test-requirements.txt index 59d9c37010..9f3bbd7508 100644 --- a/instrumentation/opentelemetry-instrumentation-boto/test-requirements.txt +++ b/instrumentation/opentelemetry-instrumentation-boto/test-requirements.txt @@ -31,7 +31,7 @@ six==1.16.0 tomli==2.0.1 typing_extensions==4.9.0 urllib3==1.26.18 -Werkzeug==2.1.2 +Werkzeug==2.3.8 wrapt==1.16.0 xmltodict==0.13.0 zipp==3.17.0 diff --git a/instrumentation/opentelemetry-instrumentation-flask/test-requirements-2.txt b/instrumentation/opentelemetry-instrumentation-flask/test-requirements-2.txt index 3c7be28971..98638a4ed6 100644 --- a/instrumentation/opentelemetry-instrumentation-flask/test-requirements-2.txt +++ b/instrumentation/opentelemetry-instrumentation-flask/test-requirements-2.txt @@ -15,7 +15,7 @@ pytest==7.4.4 pytest-benchmark==4.0.0 tomli==2.0.1 typing_extensions==4.9.0 -Werkzeug==3.0.1 +Werkzeug==3.0.3 wrapt==1.16.0 zipp==3.17.0 -e opentelemetry-instrumentation diff --git a/instrumentation/opentelemetry-instrumentation-tornado/test-requirements.txt b/instrumentation/opentelemetry-instrumentation-tornado/test-requirements.txt index db4e7ba7d1..121fdacf3c 100644 --- a/instrumentation/opentelemetry-instrumentation-tornado/test-requirements.txt +++ b/instrumentation/opentelemetry-instrumentation-tornado/test-requirements.txt @@ -22,7 +22,7 @@ tomli==2.0.1 tornado==6.4 typing_extensions==4.9.0 urllib3==2.2.1 -Werkzeug==3.0.1 +Werkzeug==3.0.3 wrapt==1.16.0 zipp==3.17.0 -e opentelemetry-instrumentation From ab0ea0e0f9b96d9ef0d921a527c5affb0b434420 Mon Sep 17 00:00:00 2001 From: Riccardo Magliocchetti Date: Mon, 10 Jun 2024 21:49:10 +0200 Subject: [PATCH 44/56] Add support for python 3.12 (#2572) --- .github/workflows/instrumentations_0.yml | 9 +- .github/workflows/instrumentations_1.yml | 5 +- .github/workflows/lint.yml | 6 +- .pre-commit-config.yaml | 2 +- CHANGELOG.md | 5 +- CONTRIBUTING.md | 2 +- _template/pyproject.toml | 1 + .../pyproject.toml | 2 + .../pyproject.toml | 1 + .../pyproject.toml | 1 + .../pyproject.toml | 1 + .../pyproject.toml | 3 +- .../pyproject.toml | 1 + .../pyproject.toml | 1 + .../pyproject.toml | 1 + .../pyproject.toml | 1 + .../pyproject.toml | 4 + .../pyproject.toml | 1 + .../pyproject.toml | 1 + .../pyproject.toml | 1 + .../pyproject.toml | 1 + .../pyproject.toml | 4 + .../pyproject.toml | 1 + .../pyproject.toml | 1 + .../pyproject.toml | 1 + .../pyproject.toml | 1 + .../pyproject.toml | 1 + .../pyproject.toml | 1 + .../pyproject.toml | 1 + .../pyproject.toml | 1 + .../pyproject.toml | 1 + .../pyproject.toml | 1 + .../pyproject.toml | 1 + .../pyproject.toml | 1 + .../pyproject.toml | 1 + .../pyproject.toml | 1 + .../pyproject.toml | 1 + .../pyproject.toml | 1 + .../pyproject.toml | 1 + .../pyproject.toml | 1 + .../pyproject.toml | 1 + .../pyproject.toml | 1 + .../pyproject.toml | 1 + .../pyproject.toml | 1 + .../pyproject.toml | 3 - .../pyproject.toml | 1 + .../pyproject.toml | 1 + .../pyproject.toml | 1 + .../pyproject.toml | 1 + .../pyproject.toml | 1 + .../pyproject.toml | 1 + .../pyproject.toml | 1 + .../pyproject.toml | 1 + .../pyproject.toml | 1 + .../pyproject.toml | 1 + .../pyproject.toml | 1 + opentelemetry-distro/pyproject.toml | 4 + opentelemetry-instrumentation/pyproject.toml | 1 + .../pyproject.toml | 1 + .../pyproject.toml | 1 + .../pyproject.toml | 1 + .../pyproject.toml | 1 + .../pyproject.toml | 1 + .../pyproject.toml | 1 + tox.ini | 122 +++++++++--------- util/opentelemetry-util-http/pyproject.toml | 1 + 66 files changed, 149 insertions(+), 75 deletions(-) diff --git a/.github/workflows/instrumentations_0.yml b/.github/workflows/instrumentations_0.yml index 5fb21ad672..fb8df0dcbb 100644 --- a/.github/workflows/instrumentations_0.yml +++ b/.github/workflows/instrumentations_0.yml @@ -16,13 +16,14 @@ jobs: py39: 3.9 py310: "3.10" py311: "3.11" + py312: "3.12" pypy3: pypy-3.8 RUN_MATRIX_COMBINATION: ${{ matrix.python-version }}-${{ matrix.package }}-${{ matrix.os }} runs-on: ${{ matrix.os }} strategy: fail-fast: false # ensures the entire test matrix is run, even if one permutation fails matrix: - python-version: [py38, py39, py310, py311, pypy3] + python-version: [py38, py39, py310, py311, py312, pypy3] package: # Do not add more instrumentations here, add them in instrumentations_1.yml. # The reason for this separation of instrumentations into more than one YAML file is @@ -80,6 +81,12 @@ jobs: package: "sklearn" - python-version: py311 package: "sklearn" + - python-version: py312 + package: "sklearn" + - python-version: py312 + package: "boto" + - python-version: py312 + package: "kafka-python" - python-version: pypy3 package: "aiopg" - python-version: pypy3 diff --git a/.github/workflows/instrumentations_1.yml b/.github/workflows/instrumentations_1.yml index 2bab23d7d2..7783105cd1 100644 --- a/.github/workflows/instrumentations_1.yml +++ b/.github/workflows/instrumentations_1.yml @@ -16,13 +16,14 @@ jobs: py39: 3.9 py310: "3.10" py311: "3.11" + py312: "3.12" pypy3: pypy-3.8 RUN_MATRIX_COMBINATION: ${{ matrix.python-version }}-${{ matrix.package }}-${{ matrix.os }} runs-on: ${{ matrix.os }} strategy: fail-fast: false # ensures the entire test matrix is run, even if one permutation fails matrix: - python-version: [py38, py39, py310, py311, pypy3] + python-version: [py38, py39, py310, py311, py312, pypy3] package: - "urllib" - "urllib3" @@ -37,8 +38,6 @@ jobs: - "resource-detector-container" os: [ubuntu-20.04] exclude: - - python-version: py311 - package: "prometheus-remote-write" - python-version: pypy3 package: "prometheus-remote-write" steps: diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml index 859b567824..debecc6ff8 100644 --- a/.github/workflows/lint.yml +++ b/.github/workflows/lint.yml @@ -9,7 +9,7 @@ env: CORE_REPO_SHA: 141a6a2e473ef7f0ec4915dfb71e3c0fa595283e jobs: - lint-3_11: + lint-3_12: strategy: fail-fast: false # ensures the entire test matrix is run, even if one permutation fails matrix: @@ -75,10 +75,10 @@ jobs: steps: - name: Checkout Contrib Repo @ SHA - ${{ github.sha }} uses: actions/checkout@v4 - - name: Set up Python 3.11 + - name: Set up Python 3.12 uses: actions/setup-python@v5 with: - python-version: 3.11 + python-version: 3.12 - name: Install tox run: pip install tox - name: Cache tox environment diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index cbdffe129b..b01b7ce4d7 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -3,7 +3,7 @@ repos: rev: 24.3.0 hooks: - id: black - language_version: python3.11 + language_version: python3.12 - repo: https://github.com/pycqa/isort rev: 5.12.0 hooks: diff --git a/CHANGELOG.md b/CHANGELOG.md index 7100623987..e17542b104 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -16,6 +16,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 - `opentelemetry-instrumentation-httpx` Ensure httpx.get or httpx.request like methods are instrumented ([#2538](https://github.com/open-telemetry/opentelemetry-python-contrib/pull/2538)) +- Add Python 3.12 support + ([#2572](https://github.com/open-telemetry/opentelemetry-python-contrib/pull/2572)) ## Version 1.25.0/0.46b0 (2024-05-31) @@ -47,7 +49,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ([#2253](https://github.com/open-telemetry/opentelemetry-python-contrib/pull/2253)) - `opentelemetry-instrumentation-pika` Instrumentation for `channel.consume()` (supported only for global, non channel specific instrumentation) - ([#2397](https://github.com/open-telemetry/opentelemetry-python-contrib/pull/2397))) + ([#2397](https://github.com/open-telemetry/opentelemetry-python-contrib/pull/2397)) - `opentelemetry-processor-baggage` Initial release ([#2436](https://github.com/open-telemetry/opentelemetry-python-contrib/pull/2436)) - `opentelemetry-processor-baggage` Add baggage key predicate @@ -129,6 +131,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ## Version 1.22.0/0.43b0 (2023-12-14) ### Added + - `opentelemetry-instrumentation-asyncio` Add support for asyncio ([#1919](https://github.com/open-telemetry/opentelemetry-python-contrib/pull/1943)) - `opentelemetry-instrumentation` Added Otel semantic convention opt-in mechanism diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index b3ae4cbfed..2cd72f12d8 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -63,7 +63,7 @@ You can run `tox` with the following arguments: - `tox` to run all existing tox commands, including unit tests for all packages under multiple Python versions - `tox -e docs` to regenerate the API docs -- `tox -e py311-test-instrumentation-aiopg` to e.g. run the aiopg instrumentation unit tests under a specific +- `tox -e py312-test-instrumentation-aiopg` to e.g. run the aiopg instrumentation unit tests under a specific Python version - `tox -e spellcheck` to run a spellcheck on all the code - `tox -e lint-some-package` to run lint checks on `some-package` diff --git a/_template/pyproject.toml b/_template/pyproject.toml index ca3da89a30..514b537f42 100644 --- a/_template/pyproject.toml +++ b/_template/pyproject.toml @@ -26,6 +26,7 @@ classifiers = [ "Programming Language :: Python :: 3.9", "Programming Language :: Python :: 3.10", "Programming Language :: Python :: 3.11", + "Programming Language :: Python :: 3.12", ] dependencies = [ "opentelemetry-api ~= 1.12", diff --git a/exporter/opentelemetry-exporter-prometheus-remote-write/pyproject.toml b/exporter/opentelemetry-exporter-prometheus-remote-write/pyproject.toml index b0006a0682..4218e13472 100644 --- a/exporter/opentelemetry-exporter-prometheus-remote-write/pyproject.toml +++ b/exporter/opentelemetry-exporter-prometheus-remote-write/pyproject.toml @@ -22,6 +22,8 @@ classifiers = [ "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 = [ "protobuf ~= 4.21", diff --git a/exporter/opentelemetry-exporter-richconsole/pyproject.toml b/exporter/opentelemetry-exporter-richconsole/pyproject.toml index aa672ac84d..745a3bc25d 100644 --- a/exporter/opentelemetry-exporter-richconsole/pyproject.toml +++ b/exporter/opentelemetry-exporter-richconsole/pyproject.toml @@ -22,6 +22,7 @@ classifiers = [ "Programming Language :: Python :: 3.9", "Programming Language :: Python :: 3.10", "Programming Language :: Python :: 3.11", + "Programming Language :: Python :: 3.12", ] dependencies = [ "opentelemetry-api ~= 1.12", diff --git a/instrumentation/opentelemetry-instrumentation-aio-pika/pyproject.toml b/instrumentation/opentelemetry-instrumentation-aio-pika/pyproject.toml index 71956d28ce..3907320999 100644 --- a/instrumentation/opentelemetry-instrumentation-aio-pika/pyproject.toml +++ b/instrumentation/opentelemetry-instrumentation-aio-pika/pyproject.toml @@ -22,6 +22,7 @@ classifiers = [ "Programming Language :: Python :: 3.9", "Programming Language :: Python :: 3.10", "Programming Language :: Python :: 3.11", + "Programming Language :: Python :: 3.12", ] dependencies = [ "opentelemetry-api ~= 1.5", diff --git a/instrumentation/opentelemetry-instrumentation-aiohttp-client/pyproject.toml b/instrumentation/opentelemetry-instrumentation-aiohttp-client/pyproject.toml index 4eb0b25b17..f8b4750872 100644 --- a/instrumentation/opentelemetry-instrumentation-aiohttp-client/pyproject.toml +++ b/instrumentation/opentelemetry-instrumentation-aiohttp-client/pyproject.toml @@ -22,6 +22,7 @@ classifiers = [ "Programming Language :: Python :: 3.9", "Programming Language :: Python :: 3.10", "Programming Language :: Python :: 3.11", + "Programming Language :: Python :: 3.12", ] dependencies = [ "opentelemetry-api ~= 1.12", diff --git a/instrumentation/opentelemetry-instrumentation-aiohttp-server/pyproject.toml b/instrumentation/opentelemetry-instrumentation-aiohttp-server/pyproject.toml index a335800216..cd5516c8f6 100644 --- a/instrumentation/opentelemetry-instrumentation-aiohttp-server/pyproject.toml +++ b/instrumentation/opentelemetry-instrumentation-aiohttp-server/pyproject.toml @@ -21,7 +21,8 @@ classifiers = [ "Programming Language :: Python :: 3.8", "Programming Language :: Python :: 3.9", "Programming Language :: Python :: 3.10", - "Programming Language :: Python :: 3.11" + "Programming Language :: Python :: 3.11", + "Programming Language :: Python :: 3.12", ] dependencies = [ "opentelemetry-api ~= 1.12", diff --git a/instrumentation/opentelemetry-instrumentation-aiopg/pyproject.toml b/instrumentation/opentelemetry-instrumentation-aiopg/pyproject.toml index 17d4513dc9..e9e7f7f613 100644 --- a/instrumentation/opentelemetry-instrumentation-aiopg/pyproject.toml +++ b/instrumentation/opentelemetry-instrumentation-aiopg/pyproject.toml @@ -22,6 +22,7 @@ classifiers = [ "Programming Language :: Python :: 3.9", "Programming Language :: Python :: 3.10", "Programming Language :: Python :: 3.11", + "Programming Language :: Python :: 3.12", ] dependencies = [ "opentelemetry-api ~= 1.12", diff --git a/instrumentation/opentelemetry-instrumentation-asgi/pyproject.toml b/instrumentation/opentelemetry-instrumentation-asgi/pyproject.toml index 3e7fc8b9c9..d733700a15 100644 --- a/instrumentation/opentelemetry-instrumentation-asgi/pyproject.toml +++ b/instrumentation/opentelemetry-instrumentation-asgi/pyproject.toml @@ -22,6 +22,7 @@ classifiers = [ "Programming Language :: Python :: 3.9", "Programming Language :: Python :: 3.10", "Programming Language :: Python :: 3.11", + "Programming Language :: Python :: 3.12", ] dependencies = [ "asgiref ~= 3.0", diff --git a/instrumentation/opentelemetry-instrumentation-asyncio/pyproject.toml b/instrumentation/opentelemetry-instrumentation-asyncio/pyproject.toml index b6b272a57a..2a53899ecd 100644 --- a/instrumentation/opentelemetry-instrumentation-asyncio/pyproject.toml +++ b/instrumentation/opentelemetry-instrumentation-asyncio/pyproject.toml @@ -22,6 +22,7 @@ classifiers = [ "Programming Language :: Python :: 3.9", "Programming Language :: Python :: 3.10", "Programming Language :: Python :: 3.11", + "Programming Language :: Python :: 3.12", ] dependencies = [ "opentelemetry-api ~= 1.14", diff --git a/instrumentation/opentelemetry-instrumentation-asyncpg/pyproject.toml b/instrumentation/opentelemetry-instrumentation-asyncpg/pyproject.toml index 9f4f9edd8a..f5d4ffd1f6 100644 --- a/instrumentation/opentelemetry-instrumentation-asyncpg/pyproject.toml +++ b/instrumentation/opentelemetry-instrumentation-asyncpg/pyproject.toml @@ -22,6 +22,7 @@ classifiers = [ "Programming Language :: Python :: 3.9", "Programming Language :: Python :: 3.10", "Programming Language :: Python :: 3.11", + "Programming Language :: Python :: 3.12", ] dependencies = [ "opentelemetry-api ~= 1.12", diff --git a/instrumentation/opentelemetry-instrumentation-aws-lambda/pyproject.toml b/instrumentation/opentelemetry-instrumentation-aws-lambda/pyproject.toml index 8e559db99b..cbed1edb9e 100644 --- a/instrumentation/opentelemetry-instrumentation-aws-lambda/pyproject.toml +++ b/instrumentation/opentelemetry-instrumentation-aws-lambda/pyproject.toml @@ -19,6 +19,10 @@ classifiers = [ "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-instrumentation == 0.47b0.dev", diff --git a/instrumentation/opentelemetry-instrumentation-boto3sqs/pyproject.toml b/instrumentation/opentelemetry-instrumentation-boto3sqs/pyproject.toml index 295204abb8..e8a2196483 100644 --- a/instrumentation/opentelemetry-instrumentation-boto3sqs/pyproject.toml +++ b/instrumentation/opentelemetry-instrumentation-boto3sqs/pyproject.toml @@ -22,6 +22,7 @@ classifiers = [ "Programming Language :: Python :: 3.9", "Programming Language :: Python :: 3.10", "Programming Language :: Python :: 3.11", + "Programming Language :: Python :: 3.12", ] dependencies = [ "opentelemetry-api ~= 1.12", diff --git a/instrumentation/opentelemetry-instrumentation-botocore/pyproject.toml b/instrumentation/opentelemetry-instrumentation-botocore/pyproject.toml index 7749163b51..6c92273301 100644 --- a/instrumentation/opentelemetry-instrumentation-botocore/pyproject.toml +++ b/instrumentation/opentelemetry-instrumentation-botocore/pyproject.toml @@ -22,6 +22,7 @@ classifiers = [ "Programming Language :: Python :: 3.9", "Programming Language :: Python :: 3.10", "Programming Language :: Python :: 3.11", + "Programming Language :: Python :: 3.12", ] dependencies = [ "opentelemetry-api ~= 1.12", diff --git a/instrumentation/opentelemetry-instrumentation-cassandra/pyproject.toml b/instrumentation/opentelemetry-instrumentation-cassandra/pyproject.toml index 7c55c88b8f..17596cee98 100644 --- a/instrumentation/opentelemetry-instrumentation-cassandra/pyproject.toml +++ b/instrumentation/opentelemetry-instrumentation-cassandra/pyproject.toml @@ -22,6 +22,7 @@ classifiers = [ "Programming Language :: Python :: 3.9", "Programming Language :: Python :: 3.10", "Programming Language :: Python :: 3.11", + "Programming Language :: Python :: 3.12", ] dependencies = [ "opentelemetry-api ~= 1.12", diff --git a/instrumentation/opentelemetry-instrumentation-celery/pyproject.toml b/instrumentation/opentelemetry-instrumentation-celery/pyproject.toml index e4b734c0f7..72808bbda7 100644 --- a/instrumentation/opentelemetry-instrumentation-celery/pyproject.toml +++ b/instrumentation/opentelemetry-instrumentation-celery/pyproject.toml @@ -22,6 +22,7 @@ classifiers = [ "Programming Language :: Python :: 3.9", "Programming Language :: Python :: 3.10", "Programming Language :: Python :: 3.11", + "Programming Language :: Python :: 3.12", ] dependencies = [ "opentelemetry-api ~= 1.12", diff --git a/instrumentation/opentelemetry-instrumentation-confluent-kafka/pyproject.toml b/instrumentation/opentelemetry-instrumentation-confluent-kafka/pyproject.toml index 13e7ca94cd..cac767986e 100644 --- a/instrumentation/opentelemetry-instrumentation-confluent-kafka/pyproject.toml +++ b/instrumentation/opentelemetry-instrumentation-confluent-kafka/pyproject.toml @@ -19,6 +19,10 @@ classifiers = [ "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-instrumentation == 0.47b0.dev", diff --git a/instrumentation/opentelemetry-instrumentation-dbapi/pyproject.toml b/instrumentation/opentelemetry-instrumentation-dbapi/pyproject.toml index cf8b2d5dd2..6a81203f01 100644 --- a/instrumentation/opentelemetry-instrumentation-dbapi/pyproject.toml +++ b/instrumentation/opentelemetry-instrumentation-dbapi/pyproject.toml @@ -22,6 +22,7 @@ classifiers = [ "Programming Language :: Python :: 3.9", "Programming Language :: Python :: 3.10", "Programming Language :: Python :: 3.11", + "Programming Language :: Python :: 3.12", ] dependencies = [ "opentelemetry-api ~= 1.12", diff --git a/instrumentation/opentelemetry-instrumentation-django/pyproject.toml b/instrumentation/opentelemetry-instrumentation-django/pyproject.toml index 74a9b10a59..e1f67c283d 100644 --- a/instrumentation/opentelemetry-instrumentation-django/pyproject.toml +++ b/instrumentation/opentelemetry-instrumentation-django/pyproject.toml @@ -22,6 +22,7 @@ classifiers = [ "Programming Language :: Python :: 3.9", "Programming Language :: Python :: 3.10", "Programming Language :: Python :: 3.11", + "Programming Language :: Python :: 3.12", ] dependencies = [ "opentelemetry-api ~= 1.12", diff --git a/instrumentation/opentelemetry-instrumentation-elasticsearch/pyproject.toml b/instrumentation/opentelemetry-instrumentation-elasticsearch/pyproject.toml index b16f79f2ca..d6e8408738 100644 --- a/instrumentation/opentelemetry-instrumentation-elasticsearch/pyproject.toml +++ b/instrumentation/opentelemetry-instrumentation-elasticsearch/pyproject.toml @@ -22,6 +22,7 @@ classifiers = [ "Programming Language :: Python :: 3.9", "Programming Language :: Python :: 3.10", "Programming Language :: Python :: 3.11", + "Programming Language :: Python :: 3.12", ] dependencies = [ "opentelemetry-api ~= 1.12", diff --git a/instrumentation/opentelemetry-instrumentation-falcon/pyproject.toml b/instrumentation/opentelemetry-instrumentation-falcon/pyproject.toml index 14e92041fa..5e0bcdad19 100644 --- a/instrumentation/opentelemetry-instrumentation-falcon/pyproject.toml +++ b/instrumentation/opentelemetry-instrumentation-falcon/pyproject.toml @@ -22,6 +22,7 @@ classifiers = [ "Programming Language :: Python :: 3.9", "Programming Language :: Python :: 3.10", "Programming Language :: Python :: 3.11", + "Programming Language :: Python :: 3.12", ] dependencies = [ "opentelemetry-api ~= 1.12", diff --git a/instrumentation/opentelemetry-instrumentation-fastapi/pyproject.toml b/instrumentation/opentelemetry-instrumentation-fastapi/pyproject.toml index c8cff0d46d..7bae75494e 100644 --- a/instrumentation/opentelemetry-instrumentation-fastapi/pyproject.toml +++ b/instrumentation/opentelemetry-instrumentation-fastapi/pyproject.toml @@ -22,6 +22,7 @@ classifiers = [ "Programming Language :: Python :: 3.9", "Programming Language :: Python :: 3.10", "Programming Language :: Python :: 3.11", + "Programming Language :: Python :: 3.12", ] dependencies = [ "opentelemetry-api ~= 1.12", diff --git a/instrumentation/opentelemetry-instrumentation-flask/pyproject.toml b/instrumentation/opentelemetry-instrumentation-flask/pyproject.toml index f0abd0dc04..1b769d2957 100644 --- a/instrumentation/opentelemetry-instrumentation-flask/pyproject.toml +++ b/instrumentation/opentelemetry-instrumentation-flask/pyproject.toml @@ -22,6 +22,7 @@ classifiers = [ "Programming Language :: Python :: 3.9", "Programming Language :: Python :: 3.10", "Programming Language :: Python :: 3.11", + "Programming Language :: Python :: 3.12", ] dependencies = [ "opentelemetry-api ~= 1.12", diff --git a/instrumentation/opentelemetry-instrumentation-grpc/pyproject.toml b/instrumentation/opentelemetry-instrumentation-grpc/pyproject.toml index 6acda1ff8b..d43c5ed173 100644 --- a/instrumentation/opentelemetry-instrumentation-grpc/pyproject.toml +++ b/instrumentation/opentelemetry-instrumentation-grpc/pyproject.toml @@ -22,6 +22,7 @@ classifiers = [ "Programming Language :: Python :: 3.9", "Programming Language :: Python :: 3.10", "Programming Language :: Python :: 3.11", + "Programming Language :: Python :: 3.12", ] dependencies = [ "opentelemetry-api ~= 1.12", diff --git a/instrumentation/opentelemetry-instrumentation-httpx/pyproject.toml b/instrumentation/opentelemetry-instrumentation-httpx/pyproject.toml index 8e94e70de8..de890755dc 100644 --- a/instrumentation/opentelemetry-instrumentation-httpx/pyproject.toml +++ b/instrumentation/opentelemetry-instrumentation-httpx/pyproject.toml @@ -22,6 +22,7 @@ classifiers = [ "Programming Language :: Python :: 3.9", "Programming Language :: Python :: 3.10", "Programming Language :: Python :: 3.11", + "Programming Language :: Python :: 3.12", ] dependencies = [ "opentelemetry-api ~= 1.12", diff --git a/instrumentation/opentelemetry-instrumentation-jinja2/pyproject.toml b/instrumentation/opentelemetry-instrumentation-jinja2/pyproject.toml index a93fe78d7e..78417289df 100644 --- a/instrumentation/opentelemetry-instrumentation-jinja2/pyproject.toml +++ b/instrumentation/opentelemetry-instrumentation-jinja2/pyproject.toml @@ -22,6 +22,7 @@ classifiers = [ "Programming Language :: Python :: 3.9", "Programming Language :: Python :: 3.10", "Programming Language :: Python :: 3.11", + "Programming Language :: Python :: 3.12", ] dependencies = [ "opentelemetry-api ~= 1.12", diff --git a/instrumentation/opentelemetry-instrumentation-logging/pyproject.toml b/instrumentation/opentelemetry-instrumentation-logging/pyproject.toml index df254c9d60..658d4eac3c 100644 --- a/instrumentation/opentelemetry-instrumentation-logging/pyproject.toml +++ b/instrumentation/opentelemetry-instrumentation-logging/pyproject.toml @@ -22,6 +22,7 @@ classifiers = [ "Programming Language :: Python :: 3.9", "Programming Language :: Python :: 3.10", "Programming Language :: Python :: 3.11", + "Programming Language :: Python :: 3.12", ] dependencies = [ "opentelemetry-api ~= 1.12", diff --git a/instrumentation/opentelemetry-instrumentation-mysql/pyproject.toml b/instrumentation/opentelemetry-instrumentation-mysql/pyproject.toml index 1c66bb932c..58982a6781 100644 --- a/instrumentation/opentelemetry-instrumentation-mysql/pyproject.toml +++ b/instrumentation/opentelemetry-instrumentation-mysql/pyproject.toml @@ -22,6 +22,7 @@ classifiers = [ "Programming Language :: Python :: 3.9", "Programming Language :: Python :: 3.10", "Programming Language :: Python :: 3.11", + "Programming Language :: Python :: 3.12", ] dependencies = [ "opentelemetry-api ~= 1.12", diff --git a/instrumentation/opentelemetry-instrumentation-mysqlclient/pyproject.toml b/instrumentation/opentelemetry-instrumentation-mysqlclient/pyproject.toml index bb4f62975a..c36f0e1c55 100644 --- a/instrumentation/opentelemetry-instrumentation-mysqlclient/pyproject.toml +++ b/instrumentation/opentelemetry-instrumentation-mysqlclient/pyproject.toml @@ -22,6 +22,7 @@ classifiers = [ "Programming Language :: Python :: 3.9", "Programming Language :: Python :: 3.10", "Programming Language :: Python :: 3.11", + "Programming Language :: Python :: 3.12", ] dependencies = [ "opentelemetry-api ~= 1.12", diff --git a/instrumentation/opentelemetry-instrumentation-pika/pyproject.toml b/instrumentation/opentelemetry-instrumentation-pika/pyproject.toml index 011bee252c..8cff4d3d24 100644 --- a/instrumentation/opentelemetry-instrumentation-pika/pyproject.toml +++ b/instrumentation/opentelemetry-instrumentation-pika/pyproject.toml @@ -22,6 +22,7 @@ classifiers = [ "Programming Language :: Python :: 3.9", "Programming Language :: Python :: 3.10", "Programming Language :: Python :: 3.11", + "Programming Language :: Python :: 3.12", ] dependencies = [ "opentelemetry-instrumentation == 0.47b0.dev", diff --git a/instrumentation/opentelemetry-instrumentation-psycopg/pyproject.toml b/instrumentation/opentelemetry-instrumentation-psycopg/pyproject.toml index 8790a02026..81baee5267 100644 --- a/instrumentation/opentelemetry-instrumentation-psycopg/pyproject.toml +++ b/instrumentation/opentelemetry-instrumentation-psycopg/pyproject.toml @@ -23,6 +23,7 @@ classifiers = [ "Programming Language :: Python :: 3.9", "Programming Language :: Python :: 3.10", "Programming Language :: Python :: 3.11", + "Programming Language :: Python :: 3.12", ] dependencies = [ "opentelemetry-api ~= 1.12", diff --git a/instrumentation/opentelemetry-instrumentation-psycopg2/pyproject.toml b/instrumentation/opentelemetry-instrumentation-psycopg2/pyproject.toml index ebc3ed592a..581ff20229 100644 --- a/instrumentation/opentelemetry-instrumentation-psycopg2/pyproject.toml +++ b/instrumentation/opentelemetry-instrumentation-psycopg2/pyproject.toml @@ -22,6 +22,7 @@ classifiers = [ "Programming Language :: Python :: 3.9", "Programming Language :: Python :: 3.10", "Programming Language :: Python :: 3.11", + "Programming Language :: Python :: 3.12", ] dependencies = [ "opentelemetry-api ~= 1.12", diff --git a/instrumentation/opentelemetry-instrumentation-pymemcache/pyproject.toml b/instrumentation/opentelemetry-instrumentation-pymemcache/pyproject.toml index 46ce5870a7..eab52fa474 100644 --- a/instrumentation/opentelemetry-instrumentation-pymemcache/pyproject.toml +++ b/instrumentation/opentelemetry-instrumentation-pymemcache/pyproject.toml @@ -22,6 +22,7 @@ classifiers = [ "Programming Language :: Python :: 3.9", "Programming Language :: Python :: 3.10", "Programming Language :: Python :: 3.11", + "Programming Language :: Python :: 3.12", ] dependencies = [ "opentelemetry-api ~= 1.12", diff --git a/instrumentation/opentelemetry-instrumentation-pymongo/pyproject.toml b/instrumentation/opentelemetry-instrumentation-pymongo/pyproject.toml index bc921d0dd5..d77e95b90e 100644 --- a/instrumentation/opentelemetry-instrumentation-pymongo/pyproject.toml +++ b/instrumentation/opentelemetry-instrumentation-pymongo/pyproject.toml @@ -22,6 +22,7 @@ classifiers = [ "Programming Language :: Python :: 3.9", "Programming Language :: Python :: 3.10", "Programming Language :: Python :: 3.11", + "Programming Language :: Python :: 3.12", ] dependencies = [ "opentelemetry-api ~= 1.12", diff --git a/instrumentation/opentelemetry-instrumentation-pymysql/pyproject.toml b/instrumentation/opentelemetry-instrumentation-pymysql/pyproject.toml index 39eb241054..bc06e31b86 100644 --- a/instrumentation/opentelemetry-instrumentation-pymysql/pyproject.toml +++ b/instrumentation/opentelemetry-instrumentation-pymysql/pyproject.toml @@ -22,6 +22,7 @@ classifiers = [ "Programming Language :: Python :: 3.9", "Programming Language :: Python :: 3.10", "Programming Language :: Python :: 3.11", + "Programming Language :: Python :: 3.12", ] dependencies = [ "opentelemetry-api ~= 1.12", diff --git a/instrumentation/opentelemetry-instrumentation-pyramid/pyproject.toml b/instrumentation/opentelemetry-instrumentation-pyramid/pyproject.toml index 221e74a602..96edbff3b2 100644 --- a/instrumentation/opentelemetry-instrumentation-pyramid/pyproject.toml +++ b/instrumentation/opentelemetry-instrumentation-pyramid/pyproject.toml @@ -22,6 +22,7 @@ classifiers = [ "Programming Language :: Python :: 3.9", "Programming Language :: Python :: 3.10", "Programming Language :: Python :: 3.11", + "Programming Language :: Python :: 3.12", ] dependencies = [ "opentelemetry-api ~= 1.12", diff --git a/instrumentation/opentelemetry-instrumentation-redis/pyproject.toml b/instrumentation/opentelemetry-instrumentation-redis/pyproject.toml index 0139ba5fb8..af342aa076 100644 --- a/instrumentation/opentelemetry-instrumentation-redis/pyproject.toml +++ b/instrumentation/opentelemetry-instrumentation-redis/pyproject.toml @@ -22,6 +22,7 @@ classifiers = [ "Programming Language :: Python :: 3.9", "Programming Language :: Python :: 3.10", "Programming Language :: Python :: 3.11", + "Programming Language :: Python :: 3.12", ] dependencies = [ "opentelemetry-api ~= 1.12", diff --git a/instrumentation/opentelemetry-instrumentation-remoulade/pyproject.toml b/instrumentation/opentelemetry-instrumentation-remoulade/pyproject.toml index 5b4d838d56..d3c1bd345d 100644 --- a/instrumentation/opentelemetry-instrumentation-remoulade/pyproject.toml +++ b/instrumentation/opentelemetry-instrumentation-remoulade/pyproject.toml @@ -22,6 +22,7 @@ classifiers = [ "Programming Language :: Python :: 3.9", "Programming Language :: Python :: 3.10", "Programming Language :: Python :: 3.11", + "Programming Language :: Python :: 3.12", ] dependencies = [ "opentelemetry-api ~= 1.12", diff --git a/instrumentation/opentelemetry-instrumentation-requests/pyproject.toml b/instrumentation/opentelemetry-instrumentation-requests/pyproject.toml index b3a56b7976..504634007c 100644 --- a/instrumentation/opentelemetry-instrumentation-requests/pyproject.toml +++ b/instrumentation/opentelemetry-instrumentation-requests/pyproject.toml @@ -22,6 +22,7 @@ classifiers = [ "Programming Language :: Python :: 3.9", "Programming Language :: Python :: 3.10", "Programming Language :: Python :: 3.11", + "Programming Language :: Python :: 3.12", ] dependencies = [ "opentelemetry-api ~= 1.12", diff --git a/instrumentation/opentelemetry-instrumentation-sklearn/pyproject.toml b/instrumentation/opentelemetry-instrumentation-sklearn/pyproject.toml index 22fb150cf8..6e57529ed1 100644 --- a/instrumentation/opentelemetry-instrumentation-sklearn/pyproject.toml +++ b/instrumentation/opentelemetry-instrumentation-sklearn/pyproject.toml @@ -19,9 +19,6 @@ classifiers = [ "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", ] dependencies = [ "opentelemetry-api ~= 1.12", diff --git a/instrumentation/opentelemetry-instrumentation-sqlalchemy/pyproject.toml b/instrumentation/opentelemetry-instrumentation-sqlalchemy/pyproject.toml index ee602ead86..c9a54920a2 100644 --- a/instrumentation/opentelemetry-instrumentation-sqlalchemy/pyproject.toml +++ b/instrumentation/opentelemetry-instrumentation-sqlalchemy/pyproject.toml @@ -22,6 +22,7 @@ classifiers = [ "Programming Language :: Python :: 3.9", "Programming Language :: Python :: 3.10", "Programming Language :: Python :: 3.11", + "Programming Language :: Python :: 3.12", ] dependencies = [ "opentelemetry-api ~= 1.12", diff --git a/instrumentation/opentelemetry-instrumentation-sqlite3/pyproject.toml b/instrumentation/opentelemetry-instrumentation-sqlite3/pyproject.toml index ddc1eb1fab..09f302e64e 100644 --- a/instrumentation/opentelemetry-instrumentation-sqlite3/pyproject.toml +++ b/instrumentation/opentelemetry-instrumentation-sqlite3/pyproject.toml @@ -22,6 +22,7 @@ classifiers = [ "Programming Language :: Python :: 3.9", "Programming Language :: Python :: 3.10", "Programming Language :: Python :: 3.11", + "Programming Language :: Python :: 3.12", ] dependencies = [ "opentelemetry-api ~= 1.12", diff --git a/instrumentation/opentelemetry-instrumentation-starlette/pyproject.toml b/instrumentation/opentelemetry-instrumentation-starlette/pyproject.toml index bf087d64d2..9103dd6f2a 100644 --- a/instrumentation/opentelemetry-instrumentation-starlette/pyproject.toml +++ b/instrumentation/opentelemetry-instrumentation-starlette/pyproject.toml @@ -22,6 +22,7 @@ classifiers = [ "Programming Language :: Python :: 3.9", "Programming Language :: Python :: 3.10", "Programming Language :: Python :: 3.11", + "Programming Language :: Python :: 3.12", ] dependencies = [ "opentelemetry-api ~= 1.12", diff --git a/instrumentation/opentelemetry-instrumentation-system-metrics/pyproject.toml b/instrumentation/opentelemetry-instrumentation-system-metrics/pyproject.toml index 6847372597..07ba2faa20 100644 --- a/instrumentation/opentelemetry-instrumentation-system-metrics/pyproject.toml +++ b/instrumentation/opentelemetry-instrumentation-system-metrics/pyproject.toml @@ -22,6 +22,7 @@ classifiers = [ "Programming Language :: Python :: 3.9", "Programming Language :: Python :: 3.10", "Programming Language :: Python :: 3.11", + "Programming Language :: Python :: 3.12", ] dependencies = [ "opentelemetry-instrumentation == 0.47b0.dev", diff --git a/instrumentation/opentelemetry-instrumentation-threading/pyproject.toml b/instrumentation/opentelemetry-instrumentation-threading/pyproject.toml index 418bf5e537..d496b99f7a 100644 --- a/instrumentation/opentelemetry-instrumentation-threading/pyproject.toml +++ b/instrumentation/opentelemetry-instrumentation-threading/pyproject.toml @@ -22,6 +22,7 @@ classifiers = [ "Programming Language :: Python :: 3.9", "Programming Language :: Python :: 3.10", "Programming Language :: Python :: 3.11", + "Programming Language :: Python :: 3.12", ] dependencies = [ "opentelemetry-api ~= 1.12", diff --git a/instrumentation/opentelemetry-instrumentation-tornado/pyproject.toml b/instrumentation/opentelemetry-instrumentation-tornado/pyproject.toml index 345d226a55..ab5d522aa2 100644 --- a/instrumentation/opentelemetry-instrumentation-tornado/pyproject.toml +++ b/instrumentation/opentelemetry-instrumentation-tornado/pyproject.toml @@ -21,6 +21,7 @@ classifiers = [ "Programming Language :: Python :: 3.9", "Programming Language :: Python :: 3.10", "Programming Language :: Python :: 3.11", + "Programming Language :: Python :: 3.12", ] dependencies = [ "opentelemetry-api ~= 1.12", diff --git a/instrumentation/opentelemetry-instrumentation-tortoiseorm/pyproject.toml b/instrumentation/opentelemetry-instrumentation-tortoiseorm/pyproject.toml index 1d5d30aa45..dc0293d3d5 100644 --- a/instrumentation/opentelemetry-instrumentation-tortoiseorm/pyproject.toml +++ b/instrumentation/opentelemetry-instrumentation-tortoiseorm/pyproject.toml @@ -22,6 +22,7 @@ classifiers = [ "Programming Language :: Python :: 3.9", "Programming Language :: Python :: 3.10", "Programming Language :: Python :: 3.11", + "Programming Language :: Python :: 3.12", ] dependencies = [ "opentelemetry-api ~= 1.12", diff --git a/instrumentation/opentelemetry-instrumentation-urllib/pyproject.toml b/instrumentation/opentelemetry-instrumentation-urllib/pyproject.toml index cc1594a31e..90799c4492 100644 --- a/instrumentation/opentelemetry-instrumentation-urllib/pyproject.toml +++ b/instrumentation/opentelemetry-instrumentation-urllib/pyproject.toml @@ -22,6 +22,7 @@ classifiers = [ "Programming Language :: Python :: 3.9", "Programming Language :: Python :: 3.10", "Programming Language :: Python :: 3.11", + "Programming Language :: Python :: 3.12", ] dependencies = [ "opentelemetry-api ~= 1.12", diff --git a/instrumentation/opentelemetry-instrumentation-urllib3/pyproject.toml b/instrumentation/opentelemetry-instrumentation-urllib3/pyproject.toml index e4a6892b23..b9dd6d528f 100644 --- a/instrumentation/opentelemetry-instrumentation-urllib3/pyproject.toml +++ b/instrumentation/opentelemetry-instrumentation-urllib3/pyproject.toml @@ -22,6 +22,7 @@ classifiers = [ "Programming Language :: Python :: 3.9", "Programming Language :: Python :: 3.10", "Programming Language :: Python :: 3.11", + "Programming Language :: Python :: 3.12", ] dependencies = [ "opentelemetry-api ~= 1.12", diff --git a/instrumentation/opentelemetry-instrumentation-wsgi/pyproject.toml b/instrumentation/opentelemetry-instrumentation-wsgi/pyproject.toml index 32766c2def..e56e4e9eb9 100644 --- a/instrumentation/opentelemetry-instrumentation-wsgi/pyproject.toml +++ b/instrumentation/opentelemetry-instrumentation-wsgi/pyproject.toml @@ -22,6 +22,7 @@ classifiers = [ "Programming Language :: Python :: 3.9", "Programming Language :: Python :: 3.10", "Programming Language :: Python :: 3.11", + "Programming Language :: Python :: 3.12", ] dependencies = [ "opentelemetry-api ~= 1.12", diff --git a/opentelemetry-contrib-instrumentations/pyproject.toml b/opentelemetry-contrib-instrumentations/pyproject.toml index ff100a1ca6..74c28f38cf 100644 --- a/opentelemetry-contrib-instrumentations/pyproject.toml +++ b/opentelemetry-contrib-instrumentations/pyproject.toml @@ -26,6 +26,7 @@ classifiers = [ "Programming Language :: Python :: 3.9", "Programming Language :: Python :: 3.10", "Programming Language :: Python :: 3.11", + "Programming Language :: Python :: 3.12", ] dependencies = [ "opentelemetry-instrumentation-aio-pika==0.47b0.dev", diff --git a/opentelemetry-distro/pyproject.toml b/opentelemetry-distro/pyproject.toml index cf6b3a671b..17f8e5de43 100644 --- a/opentelemetry-distro/pyproject.toml +++ b/opentelemetry-distro/pyproject.toml @@ -19,6 +19,10 @@ classifiers = [ "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", "Typing :: Typed", ] dependencies = [ diff --git a/opentelemetry-instrumentation/pyproject.toml b/opentelemetry-instrumentation/pyproject.toml index a20b005911..edaf400419 100644 --- a/opentelemetry-instrumentation/pyproject.toml +++ b/opentelemetry-instrumentation/pyproject.toml @@ -22,6 +22,7 @@ classifiers = [ "Programming Language :: Python :: 3.9", "Programming Language :: Python :: 3.10", "Programming Language :: Python :: 3.11", + "Programming Language :: Python :: 3.12", ] dependencies = [ "opentelemetry-api ~= 1.4", diff --git a/processor/opentelemetry-processor-baggage/pyproject.toml b/processor/opentelemetry-processor-baggage/pyproject.toml index 0ef5392fdb..3fa80e1517 100644 --- a/processor/opentelemetry-processor-baggage/pyproject.toml +++ b/processor/opentelemetry-processor-baggage/pyproject.toml @@ -22,6 +22,7 @@ classifiers = [ "Programming Language :: Python :: 3.9", "Programming Language :: Python :: 3.10", "Programming Language :: Python :: 3.11", + "Programming Language :: Python :: 3.12", ] dependencies = [ "opentelemetry-api ~= 1.5", diff --git a/propagator/opentelemetry-propagator-aws-xray/pyproject.toml b/propagator/opentelemetry-propagator-aws-xray/pyproject.toml index 6361de39a0..69fd0bbbfa 100644 --- a/propagator/opentelemetry-propagator-aws-xray/pyproject.toml +++ b/propagator/opentelemetry-propagator-aws-xray/pyproject.toml @@ -22,6 +22,7 @@ classifiers = [ "Programming Language :: Python :: 3.9", "Programming Language :: Python :: 3.10", "Programming Language :: Python :: 3.11", + "Programming Language :: Python :: 3.12", ] dependencies = [ "opentelemetry-api ~= 1.12", diff --git a/propagator/opentelemetry-propagator-ot-trace/pyproject.toml b/propagator/opentelemetry-propagator-ot-trace/pyproject.toml index 41f374ee1b..93c7ad6784 100644 --- a/propagator/opentelemetry-propagator-ot-trace/pyproject.toml +++ b/propagator/opentelemetry-propagator-ot-trace/pyproject.toml @@ -22,6 +22,7 @@ classifiers = [ "Programming Language :: Python :: 3.9", "Programming Language :: Python :: 3.10", "Programming Language :: Python :: 3.11", + "Programming Language :: Python :: 3.12", ] dependencies = [ "opentelemetry-api ~= 1.12", diff --git a/resource/opentelemetry-resource-detector-azure/pyproject.toml b/resource/opentelemetry-resource-detector-azure/pyproject.toml index efa1b24ee7..f86f1f097b 100644 --- a/resource/opentelemetry-resource-detector-azure/pyproject.toml +++ b/resource/opentelemetry-resource-detector-azure/pyproject.toml @@ -22,6 +22,7 @@ classifiers = [ "Programming Language :: Python :: 3.9", "Programming Language :: Python :: 3.10", "Programming Language :: Python :: 3.11", + "Programming Language :: Python :: 3.12", ] dependencies = [ "opentelemetry-sdk ~= 1.21", diff --git a/resource/opentelemetry-resource-detector-container/pyproject.toml b/resource/opentelemetry-resource-detector-container/pyproject.toml index 4ad1df12cd..3993ecd06c 100644 --- a/resource/opentelemetry-resource-detector-container/pyproject.toml +++ b/resource/opentelemetry-resource-detector-container/pyproject.toml @@ -22,6 +22,7 @@ classifiers = [ "Programming Language :: Python :: 3.9", "Programming Language :: Python :: 3.10", "Programming Language :: Python :: 3.11", + "Programming Language :: Python :: 3.12", ] dependencies = [ "opentelemetry-sdk ~= 1.12", diff --git a/sdk-extension/opentelemetry-sdk-extension-aws/pyproject.toml b/sdk-extension/opentelemetry-sdk-extension-aws/pyproject.toml index 12b2b23ddc..767bebdd10 100644 --- a/sdk-extension/opentelemetry-sdk-extension-aws/pyproject.toml +++ b/sdk-extension/opentelemetry-sdk-extension-aws/pyproject.toml @@ -22,6 +22,7 @@ classifiers = [ "Programming Language :: Python :: 3.9", "Programming Language :: Python :: 3.10", "Programming Language :: Python :: 3.11", + "Programming Language :: Python :: 3.12", ] dependencies = [ "opentelemetry-sdk ~= 1.12", diff --git a/tox.ini b/tox.ini index 63c80083d4..e0d5d79cbc 100644 --- a/tox.ini +++ b/tox.ini @@ -7,53 +7,53 @@ envlist = ; for specifying supported Python versions per package. ; opentelemetry-resource-detector-container - py3{8,9,10,11}-test-resource-detector-container + py3{8,9,10,11,12}-test-resource-detector-container pypy3-test-resource-detector-container lint-resource-detector-container ; opentelemetry-sdk-extension-aws - py3{8,9,10,11}-test-sdk-extension-aws + py3{8,9,10,11,12}-test-sdk-extension-aws pypy3-test-sdk-extension-aws lint-sdk-extension-aws ; opentelemetry-distro - py3{8,9,10,11}-test-distro + py3{8,9,10,11,12}-test-distro pypy3-test-distro lint-distro ; opentelemetry-instrumentation - py3{8,9,10,11}-test-opentelemetry-instrumentation + py3{8,9,10,11,12}-test-opentelemetry-instrumentation pypy3-test-opentelemetry-instrumentation lint-opentelemetry-instrumentation ; opentelemetry-instrumentation-aiohttp-client - py3{8,9,10,11}-test-instrumentation-aiohttp-client + py3{8,9,10,11,12}-test-instrumentation-aiohttp-client pypy3-test-instrumentation-aiohttp-client lint-instrumentation-aiohttp-client ; opentelemetry-instrumentation-aiohttp-server - py3{8,9,10,11}-test-instrumentation-aiohttp-server + py3{8,9,10,11,12}-test-instrumentation-aiohttp-server pypy3-test-instrumentation-aiohttp-server lint-instrumentation-aiohttp-server ; opentelemetry-instrumentation-aiopg - py3{8,9,10,11}-test-instrumentation-aiopg + py3{8,9,10,11,12}-test-instrumentation-aiopg ; instrumentation-aiopg intentionally excluded from pypy3 lint-instrumentation-aiopg ; opentelemetry-instrumentation-aws-lambda - py3{8,9,10,11}-test-instrumentation-aws-lambda + py3{8,9,10,11,12}-test-instrumentation-aws-lambda pypy3-test-instrumentation-aws-lambda lint-instrumentation-aws-lambda ; opentelemetry-instrumentation-botocore - py3{8,9,10,11}-test-instrumentation-botocore + py3{8,9,10,11,12}-test-instrumentation-botocore ; FIXME: see https://github.com/open-telemetry/opentelemetry-python-contrib/issues/1736 ; pypy3-test-instrumentation-botocore lint-instrumentation-botocore ; opentelemetry-instrumentation-boto3sqs - py3{8,9,10,11}-test-instrumentation-boto3sqs + py3{8,9,10,11,12}-test-instrumentation-boto3sqs pypy3-test-instrumentation-boto3sqs lint-instrumentation-boto3sqs @@ -70,13 +70,13 @@ envlist = py3{8,9}-test-instrumentation-django-0 py3{8,9}-test-instrumentation-django-1 py3{8,9}-test-instrumentation-django-2 - py3{10,11}-test-instrumentation-django-1 - py3{10,11}-test-instrumentation-django-3 + py3{10,11,12}-test-instrumentation-django-1 + py3{10,11,12}-test-instrumentation-django-3 pypy3-test-instrumentation-django-{0,1} lint-instrumentation-django ; opentelemetry-instrumentation-dbapi - py3{8,9,10,11}-test-instrumentation-dbapi + py3{8,9,10,11,12}-test-instrumentation-dbapi pypy3-test-instrumentation-dbapi lint-instrumentation-dbapi @@ -92,7 +92,7 @@ envlist = ; 0: elasticsearch-dsl==6.4.0 elasticsearch==6.8.2 ; 1: elasticsearch-dsl==7.4.1 elasticsearch==7.17.9 ; 2: elasticsearch-dsl==8.13.1 elasticsearch==8.13.1 - py3{8,9,10,11}-test-instrumentation-elasticsearch-{0,1,2} + py3{8,9,10,11,12}-test-instrumentation-elasticsearch-{0,1,2} pypy3-test-instrumentation-elasticsearch-{0,1,2} lint-instrumentation-elasticsearch @@ -104,12 +104,12 @@ envlist = ; 1: falcon >=2.0.0,<3.0.0 ; 2: falcon >=3.0.0,<4.0.0 py3{8,9}-test-instrumentation-falcon-0 - py3{8,9,10,11}-test-instrumentation-falcon-{1,2} + py3{8,9,10,11,12}-test-instrumentation-falcon-{1,2} pypy3-test-instrumentation-falcon-{0,1,2} lint-instrumentation-falcon ; opentelemetry-instrumentation-fastapi - py3{8,9,10,11}-test-instrumentation-fastapi + py3{8,9,10,11,12}-test-instrumentation-fastapi pypy3-test-instrumentation-fastapi lint-instrumentation-fastapi @@ -119,13 +119,13 @@ envlist = ; 0: Flask ==2.1.3 Werkzeug <3.0.0 ; 1: Flask ==2.2.0 Werkzeug <3.0.0 ; 2: Flask >=3.0.0 Werkzeug >=3.0.0 - py3{8,9,10,11}-test-instrumentation-flask-{0,1} - py3{8,9,10,11}-test-instrumentation-flask-{2} + py3{8,9,10,11,12}-test-instrumentation-flask-{0,1} + py3{8,9,10,11,12}-test-instrumentation-flask-{2} pypy3-test-instrumentation-flask-{0,1} lint-instrumentation-flask ; opentelemetry-instrumentation-urllib - py3{8,9,10,11}-test-instrumentation-urllib + py3{8,9,10,11,12}-test-instrumentation-urllib pypy3-test-instrumentation-urllib lint-instrumentation-urllib @@ -134,47 +134,47 @@ envlist = ; below mean these dependencies are being used: ; 0: urllib3 >=1.0.0,<2.0.0 ; 1: urllib3 >=2.0.0,<3.0.0 - py3{8,9,10,11}-test-instrumentation-urllib3-{0,1} + py3{8,9,10,11,12}-test-instrumentation-urllib3-{0,1} pypy3-test-instrumentation-urllib3-{0,1} lint-instrumentation-urllib3 ; opentelemetry-instrumentation-requests - py3{8,9,10,11}-test-instrumentation-requests + py3{8,9,10,11,12}-test-instrumentation-requests ;pypy3-test-instrumentation-requests lint-instrumentation-requests ; opentelemetry-instrumentation-starlette - py3{8,9,10,11}-test-instrumentation-starlette + py3{8,9,10,11,12}-test-instrumentation-starlette pypy3-test-instrumentation-starlette lint-instrumentation-starlette ; opentelemetry-instrumentation-jinja2 - py3{8,9,10,11}-test-instrumentation-jinja2 + py3{8,9,10,11,12}-test-instrumentation-jinja2 pypy3-test-instrumentation-jinja2 lint-instrumentation-jinja2 ; opentelemetry-instrumentation-logging - py3{8,9,10,11}-test-instrumentation-logging + py3{8,9,10,11,12}-test-instrumentation-logging pypy3-test-instrumentation-logging lint-instrumentation-logging ; opentelemetry-exporter-richconsole - py3{8,9,10,11}-test-exporter-richconsole + py3{8,9,10,11,12}-test-exporter-richconsole pypy3-test-exporter-richconsole lint-exporter-richconsole ; opentelemetry-exporter-prometheus-remote-write - py3{8,9,10,11}-test-exporter-prometheus-remote-write + py3{8,9,10,11,12}-test-exporter-prometheus-remote-write pypy3-test-exporter-prometheus-remote-write lint-exporter-prometheus-remote-write ; opentelemetry-instrumentation-mysql - py3{8,9,10,11}-test-instrumentation-mysql + py3{8,9,10,11,12}-test-instrumentation-mysql pypy3-test-instrumentation-mysql lint-instrumentation-mysql ; opentelemetry-instrumentation-mysqlclient - py3{8,9,10,11}-test-instrumentation-mysqlclient + py3{8,9,10,11,12}-test-instrumentation-mysqlclient pypy3-test-instrumentation-mysqlclient ; prerequisite: follow the instructions here ; https://github.com/PyMySQL/mysqlclient#install @@ -182,12 +182,12 @@ envlist = lint-instrumentation-mysqlclient ; opentelemetry-instrumentation-psycopg2 - py3{8,9,10,11}-test-instrumentation-psycopg2 + py3{8,9,10,11,12}-test-instrumentation-psycopg2 ; ext-psycopg2 intentionally excluded from pypy3 lint-instrumentation-psycopg2 ; opentelemetry-instrumentation-psycopg - py3{8,9,10,11}-test-instrumentation-psycopg + py3{8,9,10,11,12}-test-instrumentation-psycopg pypy3-test-instrumentation-psycopg lint-instrumentation-psycopg @@ -199,47 +199,47 @@ envlist = ; 2: pymemcache >3.0.0,<3.4.2 ; 3: pymemcache ==3.4.2 ; 4: pymemcache ==4.0.0 - py3{8,9,10,11}-test-instrumentation-pymemcache-{0,1,2,3,4} + py3{8,9,10,11,12}-test-instrumentation-pymemcache-{0,1,2,3,4} pypy3-test-instrumentation-pymemcache-{0,1,2,3,4} lint-instrumentation-pymemcache ; opentelemetry-instrumentation-pymongo - py3{8,9,10,11}-test-instrumentation-pymongo + py3{8,9,10,11,12}-test-instrumentation-pymongo pypy3-test-instrumentation-pymongo lint-instrumentation-pymongo ; opentelemetry-instrumentation-pymysql - py3{8,9,10,11}-test-instrumentation-pymysql + py3{8,9,10,11,12}-test-instrumentation-pymysql pypy3-test-instrumentation-pymysql lint-instrumentation-pymysql ; opentelemetry-instrumentation-pyramid - py3{8,9,10,11}-test-instrumentation-pyramid + py3{8,9,10,11,12}-test-instrumentation-pyramid pypy3-test-instrumentation-pyramid lint-instrumentation-pyramid ; opentelemetry-instrumentation-asgi - py3{8,9,10,11}-test-instrumentation-asgi + py3{8,9,10,11,12}-test-instrumentation-asgi pypy3-test-instrumentation-asgi lint-instrumentation-asgi ; opentelemetry-instrumentation-asyncpg - py3{8,9,10,11}-test-instrumentation-asyncpg + py3{8,9,10,11,12}-test-instrumentation-asyncpg ; ext-asyncpg intentionally excluded from pypy3 lint-instrumentation-asyncpg ; opentelemetry-instrumentation-sqlite3 - py3{8,9,10,11}-test-instrumentation-sqlite3 + py3{8,9,10,11,12}-test-instrumentation-sqlite3 pypy3-test-instrumentation-sqlite3 lint-instrumentation-sqlite3 ; opentelemetry-instrumentation-wsgi - py3{8,9,10,11}-test-instrumentation-wsgi + py3{8,9,10,11,12}-test-instrumentation-wsgi pypy3-test-instrumentation-wsgi lint-instrumentation-wsgi ; opentelemetry-instrumentation-grpc - py3{8,9,10,11}-test-instrumentation-grpc + py3{8,9,10,11,12}-test-instrumentation-grpc pypy3-test-instrumentation-grpc lint-instrumentation-grpc @@ -248,22 +248,22 @@ envlist = ; below mean these dependencies are being used: ; 0: sqlalchemy>=1.1,<1.2 ; 1: sqlalchemy~=1.4 aiosqlite - py3{8,9,10,11}-test-instrumentation-sqlalchemy-{1} + py3{8,9,10,11,12}-test-instrumentation-sqlalchemy-{1} pypy3-test-instrumentation-sqlalchemy-{0,1} lint-instrumentation-sqlalchemy ; opentelemetry-instrumentation-redis - py3{8,9,10,11}-test-instrumentation-redis + py3{8,9,10,11,12}-test-instrumentation-redis pypy3-test-instrumentation-redis lint-instrumentation-redis ; opentelemetry-instrumentation-remoulade - py3{8,9,10,11}-test-instrumentation-remoulade + py3{8,9,10,11,12}-test-instrumentation-remoulade ; instrumentation-remoulade intentionally excluded from pypy3 lint-instrumentation-remoulade ; opentelemetry-instrumentation-celery - py3{8,9,10,11}-test-instrumentation-celery + py3{8,9,10,11,12}-test-instrumentation-celery pypy3-test-instrumentation-celery lint-instrumentation-celery @@ -272,22 +272,22 @@ envlist = lint-instrumentation-sklearn ; opentelemetry-instrumentation-system-metrics - py3{8,9,10,11}-test-instrumentation-system-metrics + py3{8,9,10,11,12}-test-instrumentation-system-metrics pypy3-test-instrumentation-system-metrics lint-instrumentation-system-metrics ; opentelemetry-instrumentation-threading - py3{8,9,10,11}-test-instrumentation-threading + py3{8,9,10,11,12}-test-instrumentation-threading pypy3-test-instrumentation-threading lint-instrumentation-threading ; opentelemetry-instrumentation-tornado - py3{8,9,10,11}-test-instrumentation-tornado + py3{8,9,10,11,12}-test-instrumentation-tornado pypy3-test-instrumentation-tornado lint-instrumentation-tornado ; opentelemetry-instrumentation-tortoiseorm - py3{8,9,10,11}-test-instrumentation-tortoiseorm + py3{8,9,10,11,12}-test-instrumentation-tortoiseorm pypy3-test-instrumentation-tortoiseorm lint-instrumentation-tortoiseorm @@ -296,21 +296,21 @@ envlist = ; below mean these dependencies are being used: ; 0: httpx>=0.18.0,<0.19.0 respx~=0.17.0 ; 1: httpx>=0.19.0 respx~=0.20.1 - py3{8,9,10,11}-test-instrumentation-httpx-{0,1} + py3{8,9,10,11,12}-test-instrumentation-httpx-{0,1} pypy3-test-instrumentation-httpx-{0,1} lint-instrumentation-httpx ; opentelemetry-util-http - py3{8,9,10,11}-test-util-http + py3{8,9,10,11,12}-test-util-http pypy3-test-util-http ; opentelemetry-propagator-aws-xray - py3{8,9,10,11}-test-propagator-aws-xray + py3{8,9,10,11,12}-test-propagator-aws-xray pypy3-test-propagator-aws-xray lint-propagator-aws-xray ; opentelemetry-propagator-ot-trace - py3{8,9,10,11}-test-propagator-ot-trace + py3{8,9,10,11,12}-test-propagator-ot-trace pypy3-test-propagator-ot-trace lint-propagator-ot-trace @@ -319,7 +319,7 @@ envlist = ; below mean these dependencies are being used: ; 0: pika>=0.12.0,<1.0.0 ; 1: pika>=1.0.0 - py3{8,9,10,11}-test-instrumentation-sio-pika-{0,1} + py3{8,9,10,11,12}-test-instrumentation-sio-pika-{0,1} pypy3-test-instrumentation-sio-pika-{0,1} lint-instrumentation-sio-pika @@ -330,7 +330,7 @@ envlist = ; 1: aio_pika==8.3.0 ; 2: aio_pika==9.0.5 ; 3: aio_pika==9.4.1 - py3{8,9,10,11}-test-instrumentation-aio-pika-{0,1,2,3} + py3{8,9,10,11,12}-test-instrumentation-aio-pika-{0,1,2,3} pypy3-test-instrumentation-aio-pika-{0,1,2,3} lint-instrumentation-aio-pika @@ -340,21 +340,21 @@ envlist = lint-instrumentation-kafka-python ; opentelemetry-instrumentation-confluent-kafka - py3{8,9,10,11}-test-instrumentation-confluent-kafka + py3{8,9,10,11,12}-test-instrumentation-confluent-kafka pypy3-test-instrumentation-confluent-kafka lint-instrumentation-confluent-kafka ; opentelemetry-instrumentation-asyncio - py3{8,9,10,11}-test-instrumentation-asyncio + py3{8,9,10,11,12}-test-instrumentation-asyncio lint-instrumentation-asyncio ; opentelemetry-instrumentation-cassandra - py3{8,9,10,11}-test-instrumentation-cassandra + py3{8,9,10,11,12}-test-instrumentation-cassandra pypy3-test-instrumentation-cassandra lint-instrumentation-cassandra ; opentelemetry-processor-baggage - py3{8,9,10,11}-test-processor-baggage + py3{8,9,10,11,12}-test-processor-baggage pypy3-test-processor-baggage ; requires snappy headers to be available on the system lint-processor-baggage @@ -407,7 +407,7 @@ commands_pre = celery: pip install opentelemetry-sdk@{env:CORE_REPO}\#egg=opentelemetry-sdk&subdirectory=opentelemetry-sdk celery: pip install opentelemetry-test-utils@{env:CORE_REPO}\#egg=opentelemetry-test-utils&subdirectory=tests/opentelemetry-test-utils py3{8,9}-test-instrumentation-celery: pip install -r {toxinidir}/instrumentation/opentelemetry-instrumentation-celery/test-requirements-0.txt - py3{10,11}-test-instrumentation-celery: pip install -r {toxinidir}/instrumentation/opentelemetry-instrumentation-celery/test-requirements-1.txt + py3{10,11,12}-test-instrumentation-celery: pip install -r {toxinidir}/instrumentation/opentelemetry-instrumentation-celery/test-requirements-1.txt pypy3-test-instrumentation-celery: pip install -r {toxinidir}/instrumentation/opentelemetry-instrumentation-celery/test-requirements-1.txt lint-instrumentation-celery: pip install -r {toxinidir}/instrumentation/opentelemetry-instrumentation-celery/test-requirements-1.txt @@ -531,8 +531,8 @@ commands_pre = py3{8,9}-test-instrumentation-django-0: pip install -r {toxinidir}/instrumentation/opentelemetry-instrumentation-django/test-requirements-0.txt py3{8,9}-test-instrumentation-django-1: pip install -r {toxinidir}/instrumentation/opentelemetry-instrumentation-django/test-requirements-1.txt py3{8,9}-test-instrumentation-django-2: pip install -r {toxinidir}/instrumentation/opentelemetry-instrumentation-django/test-requirements-2.txt - py3{10,11}-test-instrumentation-django-1: pip install -r {toxinidir}/instrumentation/opentelemetry-instrumentation-django/test-requirements-1.txt - py3{10,11}-test-instrumentation-django-3: pip install -r {toxinidir}/instrumentation/opentelemetry-instrumentation-django/test-requirements-3.txt + py3{10,11,12}-test-instrumentation-django-1: pip install -r {toxinidir}/instrumentation/opentelemetry-instrumentation-django/test-requirements-1.txt + py3{10,11,12}-test-instrumentation-django-3: pip install -r {toxinidir}/instrumentation/opentelemetry-instrumentation-django/test-requirements-3.txt pypy3-test-instrumentation-django-0: pip install -r {toxinidir}/instrumentation/opentelemetry-instrumentation-django/test-requirements-0.txt pypy3-test-instrumentation-django-1: pip install -r {toxinidir}/instrumentation/opentelemetry-instrumentation-django/test-requirements-1.txt lint-instrumentation-django: pip install -r {toxinidir}/instrumentation/opentelemetry-instrumentation-django/test-requirements-3.txt @@ -577,7 +577,7 @@ commands_pre = psycopg: pip install opentelemetry-sdk@{env:CORE_REPO}\#egg=opentelemetry-sdk&subdirectory=opentelemetry-sdk psycopg: pip install opentelemetry-test-utils@{env:CORE_REPO}\#egg=opentelemetry-test-utils&subdirectory=tests/opentelemetry-test-utils py3{8,9}-test-instrumentation-psycopg: pip install -r {toxinidir}/instrumentation/opentelemetry-instrumentation-psycopg/test-requirements-0.txt - py3{10,11}-test-instrumentation-psycopg: pip install -r {toxinidir}/instrumentation/opentelemetry-instrumentation-psycopg/test-requirements-1.txt + py3{10,11,12}-test-instrumentation-psycopg: pip install -r {toxinidir}/instrumentation/opentelemetry-instrumentation-psycopg/test-requirements-1.txt pypy3-test-instrumentation-psycopg: pip install -r {toxinidir}/instrumentation/opentelemetry-instrumentation-psycopg/test-requirements-1.txt lint-instrumentation-psycopg: pip install -r {toxinidir}/instrumentation/opentelemetry-instrumentation-psycopg/test-requirements-1.txt diff --git a/util/opentelemetry-util-http/pyproject.toml b/util/opentelemetry-util-http/pyproject.toml index 88724caf1a..0e632a81b3 100644 --- a/util/opentelemetry-util-http/pyproject.toml +++ b/util/opentelemetry-util-http/pyproject.toml @@ -22,6 +22,7 @@ classifiers = [ "Programming Language :: Python :: 3.9", "Programming Language :: Python :: 3.10", "Programming Language :: Python :: 3.11", + "Programming Language :: Python :: 3.12", ] [project.urls] From 20e68e38e7d0bce21b78060272c5422e09be0112 Mon Sep 17 00:00:00 2001 From: Riccardo Magliocchetti Date: Tue, 11 Jun 2024 18:18:56 +0200 Subject: [PATCH 45/56] requirements: bump Jinja2 to 3.1.4 (#2593) --- .../test-requirements.txt | 2 +- .../opentelemetry-instrumentation-flask/test-requirements-0.txt | 2 +- .../opentelemetry-instrumentation-flask/test-requirements-1.txt | 2 +- .../opentelemetry-instrumentation-flask/test-requirements-2.txt | 2 +- .../opentelemetry-instrumentation-jinja2/test-requirements.txt | 2 +- .../opentelemetry-instrumentation-tornado/test-requirements.txt | 2 +- 6 files changed, 6 insertions(+), 6 deletions(-) diff --git a/instrumentation/opentelemetry-instrumentation-aiohttp-client/test-requirements.txt b/instrumentation/opentelemetry-instrumentation-aiohttp-client/test-requirements.txt index f02ffb216f..8f713687bd 100644 --- a/instrumentation/opentelemetry-instrumentation-aiohttp-client/test-requirements.txt +++ b/instrumentation/opentelemetry-instrumentation-aiohttp-client/test-requirements.txt @@ -14,7 +14,7 @@ idna==3.7 importlib-metadata==6.11.0 iniconfig==2.0.0 itsdangerous==2.1.2 -Jinja2==3.1.3 +Jinja2==3.1.4 MarkupSafe==2.1.5 multidict==6.0.5 packaging==24.0 diff --git a/instrumentation/opentelemetry-instrumentation-flask/test-requirements-0.txt b/instrumentation/opentelemetry-instrumentation-flask/test-requirements-0.txt index fcedc7c695..fad2f5e2b0 100644 --- a/instrumentation/opentelemetry-instrumentation-flask/test-requirements-0.txt +++ b/instrumentation/opentelemetry-instrumentation-flask/test-requirements-0.txt @@ -5,7 +5,7 @@ Flask==2.1.3 importlib-metadata==6.11.0 iniconfig==2.0.0 itsdangerous==2.1.2 -Jinja2==3.1.3 +Jinja2==3.1.4 MarkupSafe==2.1.2 packaging==24.0 pluggy==1.5.0 diff --git a/instrumentation/opentelemetry-instrumentation-flask/test-requirements-1.txt b/instrumentation/opentelemetry-instrumentation-flask/test-requirements-1.txt index c6773ad2e9..919ee6d431 100644 --- a/instrumentation/opentelemetry-instrumentation-flask/test-requirements-1.txt +++ b/instrumentation/opentelemetry-instrumentation-flask/test-requirements-1.txt @@ -5,7 +5,7 @@ Flask==2.2.0 importlib-metadata==6.11.0 iniconfig==2.0.0 itsdangerous==2.1.2 -Jinja2==3.1.3 +Jinja2==3.1.4 MarkupSafe==2.1.2 packaging==24.0 pluggy==1.5.0 diff --git a/instrumentation/opentelemetry-instrumentation-flask/test-requirements-2.txt b/instrumentation/opentelemetry-instrumentation-flask/test-requirements-2.txt index 98638a4ed6..16d91d2058 100644 --- a/instrumentation/opentelemetry-instrumentation-flask/test-requirements-2.txt +++ b/instrumentation/opentelemetry-instrumentation-flask/test-requirements-2.txt @@ -6,7 +6,7 @@ Flask==3.0.2 importlib-metadata==6.11.0 iniconfig==2.0.0 itsdangerous==2.1.2 -Jinja2==3.1.3 +Jinja2==3.1.4 MarkupSafe==2.1.2 packaging==24.0 pluggy==1.5.0 diff --git a/instrumentation/opentelemetry-instrumentation-jinja2/test-requirements.txt b/instrumentation/opentelemetry-instrumentation-jinja2/test-requirements.txt index 6461129bee..e547f9bd20 100644 --- a/instrumentation/opentelemetry-instrumentation-jinja2/test-requirements.txt +++ b/instrumentation/opentelemetry-instrumentation-jinja2/test-requirements.txt @@ -2,7 +2,7 @@ asgiref==3.7.2 Deprecated==1.2.14 importlib-metadata==6.11.0 iniconfig==2.0.0 -Jinja2==3.1.3 +Jinja2==3.1.4 MarkupSafe==2.0.1 packaging==24.0 pluggy==1.5.0 diff --git a/instrumentation/opentelemetry-instrumentation-tornado/test-requirements.txt b/instrumentation/opentelemetry-instrumentation-tornado/test-requirements.txt index 121fdacf3c..a68f40e5d2 100644 --- a/instrumentation/opentelemetry-instrumentation-tornado/test-requirements.txt +++ b/instrumentation/opentelemetry-instrumentation-tornado/test-requirements.txt @@ -10,7 +10,7 @@ idna==3.7 importlib-metadata==6.11.0 iniconfig==2.0.0 itsdangerous==2.1.2 -Jinja2==3.1.3 +Jinja2==3.1.4 MarkupSafe==2.1.5 packaging==24.0 pluggy==1.5.0 From af9675cf04f3172c53fbb89c31c1b91954cb36d2 Mon Sep 17 00:00:00 2001 From: Riccardo Magliocchetti Date: Tue, 11 Jun 2024 18:44:16 +0200 Subject: [PATCH 46/56] requirements: bump sqlparse to 0.5.0 (#2595) --- .../test-requirements-0.txt | 2 +- .../test-requirements-1.txt | 2 +- .../test-requirements-2.txt | 2 +- .../test-requirements-3.txt | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/instrumentation/opentelemetry-instrumentation-django/test-requirements-0.txt b/instrumentation/opentelemetry-instrumentation-django/test-requirements-0.txt index 2203da3e33..a6162e7c00 100644 --- a/instrumentation/opentelemetry-instrumentation-django/test-requirements-0.txt +++ b/instrumentation/opentelemetry-instrumentation-django/test-requirements-0.txt @@ -9,7 +9,7 @@ py-cpuinfo==9.0.0 pytest==7.4.4 pytest-benchmark==4.0.0 pytz==2024.1 -sqlparse==0.4.4 +sqlparse==0.5.0 tomli==2.0.1 typing_extensions==4.10.0 wrapt==1.16.0 diff --git a/instrumentation/opentelemetry-instrumentation-django/test-requirements-1.txt b/instrumentation/opentelemetry-instrumentation-django/test-requirements-1.txt index bf7239cce6..58f5d5c88b 100644 --- a/instrumentation/opentelemetry-instrumentation-django/test-requirements-1.txt +++ b/instrumentation/opentelemetry-instrumentation-django/test-requirements-1.txt @@ -9,7 +9,7 @@ py-cpuinfo==9.0.0 pytest==7.4.4 pytest-benchmark==4.0.0 pytz==2024.1 -sqlparse==0.4.4 +sqlparse==0.5.0 tomli==2.0.1 typing_extensions==4.10.0 wrapt==1.16.0 diff --git a/instrumentation/opentelemetry-instrumentation-django/test-requirements-2.txt b/instrumentation/opentelemetry-instrumentation-django/test-requirements-2.txt index 03d4570977..ffc43f4023 100644 --- a/instrumentation/opentelemetry-instrumentation-django/test-requirements-2.txt +++ b/instrumentation/opentelemetry-instrumentation-django/test-requirements-2.txt @@ -9,7 +9,7 @@ pluggy==1.5.0 py-cpuinfo==9.0.0 pytest==7.4.4 pytest-benchmark==4.0.0 -sqlparse==0.4.4 +sqlparse==0.5.0 tomli==2.0.1 typing_extensions==4.10.0 wrapt==1.16.0 diff --git a/instrumentation/opentelemetry-instrumentation-django/test-requirements-3.txt b/instrumentation/opentelemetry-instrumentation-django/test-requirements-3.txt index ec200f92ef..92ebaa83e4 100644 --- a/instrumentation/opentelemetry-instrumentation-django/test-requirements-3.txt +++ b/instrumentation/opentelemetry-instrumentation-django/test-requirements-3.txt @@ -8,7 +8,7 @@ pluggy==1.5.0 py-cpuinfo==9.0.0 pytest==7.4.4 pytest-benchmark==4.0.0 -sqlparse==0.4.4 +sqlparse==0.5.0 tomli==2.0.1 typing_extensions==4.10.0 wrapt==1.16.0 From da78275a5560c155492b0b18f48e4db250974226 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Em=C3=ADdio=20Neto?= <9735060+emdneto@users.noreply.github.com> Date: Tue, 11 Jun 2024 14:16:18 -0300 Subject: [PATCH 47/56] increase delta for fastapi flaky test (#2591) --- .../tests/test_fastapi_instrumentation.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/instrumentation/opentelemetry-instrumentation-fastapi/tests/test_fastapi_instrumentation.py b/instrumentation/opentelemetry-instrumentation-fastapi/tests/test_fastapi_instrumentation.py index 948bd343db..a7cd5045ee 100644 --- a/instrumentation/opentelemetry-instrumentation-fastapi/tests/test_fastapi_instrumentation.py +++ b/instrumentation/opentelemetry-instrumentation-fastapi/tests/test_fastapi_instrumentation.py @@ -254,7 +254,7 @@ def test_basic_metric_success(self): dict(point.attributes), ) self.assertEqual(point.count, 1) - self.assertAlmostEqual(duration, point.sum, delta=30) + self.assertAlmostEqual(duration, point.sum, delta=40) if isinstance(point, NumberDataPoint): self.assertDictEqual( expected_requests_count_attributes, @@ -279,7 +279,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=30) + self.assertAlmostEqual(duration, point.sum, delta=40) elif metric.name == "http.server.response.size": self.assertEqual(response_size, point.sum) elif metric.name == "http.server.request.size": From 184d8d45b99b6a60e5621bc39c31959c5ea28340 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Em=C3=ADdio=20Neto?= <9735060+emdneto@users.noreply.github.com> Date: Wed, 12 Jun 2024 12:02:24 -0300 Subject: [PATCH 48/56] Change issue templates to forms (#2602) --- .github/ISSUE_TEMPLATE/bug_report.md | 19 ------ .github/ISSUE_TEMPLATE/bug_report.yaml | 66 +++++++++++++++++++++ .github/ISSUE_TEMPLATE/config.yml | 4 ++ .github/ISSUE_TEMPLATE/feature_request.md | 19 ------ .github/ISSUE_TEMPLATE/feature_request.yaml | 50 ++++++++++++++++ 5 files changed, 120 insertions(+), 38 deletions(-) delete mode 100644 .github/ISSUE_TEMPLATE/bug_report.md create mode 100644 .github/ISSUE_TEMPLATE/bug_report.yaml create mode 100644 .github/ISSUE_TEMPLATE/config.yml delete mode 100644 .github/ISSUE_TEMPLATE/feature_request.md create mode 100644 .github/ISSUE_TEMPLATE/feature_request.yaml diff --git a/.github/ISSUE_TEMPLATE/bug_report.md b/.github/ISSUE_TEMPLATE/bug_report.md deleted file mode 100644 index 2597b185d0..0000000000 --- a/.github/ISSUE_TEMPLATE/bug_report.md +++ /dev/null @@ -1,19 +0,0 @@ ---- -name: Bug Report -about: Create a report to help us improve -labels: bug ---- - -**Describe your environment** Describe any aspect of your environment relevant to the problem, including your Python version, [platform](https://docs.python.org/3/library/platform.html), version numbers of installed dependencies, information about your cloud hosting provider, etc. If you're reporting a problem with a specific version of a library in this repo, please check whether the problem has been fixed on main. - -**Steps to reproduce** -Describe exactly how to reproduce the error. Include a code sample if applicable. - -**What is the expected behavior?** -What did you expect to see? - -**What is the actual behavior?** -What did you see instead? - -**Additional context** -Add any other context about the problem here. diff --git a/.github/ISSUE_TEMPLATE/bug_report.yaml b/.github/ISSUE_TEMPLATE/bug_report.yaml new file mode 100644 index 0000000000..6718481a76 --- /dev/null +++ b/.github/ISSUE_TEMPLATE/bug_report.yaml @@ -0,0 +1,66 @@ +--- +name: Bug Report +description: Create a report to help us improve +labels: [bug] +body: + - type: markdown + attributes: + value: | + Thanks for taking the time to fill out this bug report! Please make sure to fill out the entire form below, providing as much context as you can in order to help us triage and track down your bug as quickly as possible. + + Before filing a bug, please be sure you have searched through [existing bugs](https://github.com/open-telemetry/opentelemetry-python-contrib/issues?q=is%3Aissue+is%3Aopen+sort%3Aupdated-desc+label%3Abug) to see if your bug is already addressed. + + - type: textarea + id: environment + attributes: + label: Describe your environment + description: | + Please describe any aspect of your environment relevant to the problem, including your Python version, [platform](https://docs.python.org/3/library/platform.html), version numbers of installed dependencies, information about your cloud hosting provider, etc. If you're reporting a problem with a specific version of a library in this repo, please check whether the problem has been fixed on main. + value: | + OS: (e.g, Ubuntu) + Python version: (e.g., Python 3.8.10) + Package version: (e.g., 0.46.0) + + - type: textarea + attributes: + label: What happened? + description: Please provide as much detail as you reasonably can. + validations: + required: true + + - type: textarea + attributes: + label: Steps to Reproduce + description: Provide a [minimal reproducible example](https://stackoverflow.com/help/minimal-reproducible-example) if possible and the needed steps to reproduce the problem. + validations: + required: true + + - type: textarea + attributes: + label: Expected Result + description: What did you expect to see? + validations: + required: true + + - type: textarea + attributes: + label: Actual Result + description: What did you see instead? + validations: + required: true + + - type: textarea + id: additional-context + attributes: + label: Additional context + description: Add any other context about the problem here. + placeholder: Any additional information... + + - type: dropdown + id: contribute + attributes: + label: Would you like to implement a fix? + description: For guidance on how to get started, refer to the [contribution guide](https://github.com/open-telemetry/opentelemetry-python-contrib/blob/main/CONTRIBUTING.md). + options: + - "No" + - "Yes" diff --git a/.github/ISSUE_TEMPLATE/config.yml b/.github/ISSUE_TEMPLATE/config.yml new file mode 100644 index 0000000000..f6acad9c9b --- /dev/null +++ b/.github/ISSUE_TEMPLATE/config.yml @@ -0,0 +1,4 @@ +contact_links: + - name: Slack + url: https://cloud-native.slack.com/archives/C01PD4HUVBL + about: Or the `#otel-python` channel in the CNCF Slack instance. diff --git a/.github/ISSUE_TEMPLATE/feature_request.md b/.github/ISSUE_TEMPLATE/feature_request.md deleted file mode 100644 index 973549ab2d..0000000000 --- a/.github/ISSUE_TEMPLATE/feature_request.md +++ /dev/null @@ -1,19 +0,0 @@ ---- -name: Feature Request -about: Suggest an idea for this project -labels: feature-request ---- - -Before opening a feature request against this repo, consider whether the feature should/could be implemented in the [other OpenTelemetry client libraries](https://github.com/open-telemetry/). If so, please [open an issue on opentelemetry-specification](https://github.com/open-telemetry/opentelemetry-specification/issues/new) first. - -**Is your feature request related to a problem?** -If so, provide a concise description of the problem. - -**Describe the solution you'd like** -What do you want to happen instead? What is the expected behavior? - -**Describe alternatives you've considered** -Which alternative solutions or features have you considered? - -**Additional context** -Add any other context about the feature request here. diff --git a/.github/ISSUE_TEMPLATE/feature_request.yaml b/.github/ISSUE_TEMPLATE/feature_request.yaml new file mode 100644 index 0000000000..270409a495 --- /dev/null +++ b/.github/ISSUE_TEMPLATE/feature_request.yaml @@ -0,0 +1,50 @@ +--- +name: Feature Request +description: Suggest an idea for this project +labels: [feature-request] +body: + - type: markdown + attributes: + value: | + Before opening a feature request against this repo, consider whether the feature should/could be implemented in the [other OpenTelemetry client libraries](https://github.com/open-telemetry/). If so, please [open an issue on opentelemetry-specification](https://github.com/open-telemetry/opentelemetry-specification/issues/new) first. + - type: textarea + id: related-problem + attributes: + label: What problem do you want to solve? + description: Is your feature request related to a problem? If so, provide a concise description of the problem. + placeholder: Describe the problem and include relevant issue IDs + validations: + required: true + - type: textarea + id: solution + attributes: + label: Describe the solution you'd like + description: What do you want to happen instead? What is the expected behavior? + placeholder: I'd like to ... + validations: + required: true + - type: textarea + id: alternatives + attributes: + label: Describe alternatives you've considered + description: Which alternative solutions or features have you considered? + placeholder: Some potential solutions + validations: + required: false + - type: textarea + id: additional-context + attributes: + label: Additional Context + description: Add any other context about the feature request here. + placeholder: Some related requests in other projects or upstream spec proposals. + validations: + required: false + - type: dropdown + id: contribute + attributes: + label: Would you like to implement a fix? + description: | + For guidance on how to get started, refer to the [contribution guide](https://github.com/open-telemetry/opentelemetry-python-contrib/blob/main/CONTRIBUTING.md). + options: + - "No" + - "Yes" From 477b73cd9ae965ed98cccb746c74b4f063c81075 Mon Sep 17 00:00:00 2001 From: Riccardo Magliocchetti Date: Wed, 12 Jun 2024 17:14:11 +0200 Subject: [PATCH 49/56] requirements: bump requests to 2.32.3 (#2603) --- .../test-requirements.txt | 2 +- .../test-requirements.txt | 2 +- .../opentelemetry-instrumentation-boto/test-requirements.txt | 2 +- .../test-requirements.txt | 2 +- .../opentelemetry-instrumentation-fastapi/test-requirements.txt | 2 +- .../test-requirements.txt | 2 +- .../test-requirements.txt | 2 +- .../opentelemetry-instrumentation-tornado/test-requirements.txt | 2 +- .../opentelemetry-propagator-aws-xray/test-requirements.txt | 2 +- 9 files changed, 9 insertions(+), 9 deletions(-) diff --git a/exporter/opentelemetry-exporter-prometheus-remote-write/test-requirements.txt b/exporter/opentelemetry-exporter-prometheus-remote-write/test-requirements.txt index 7c3ab4d83e..ffd5916ae7 100644 --- a/exporter/opentelemetry-exporter-prometheus-remote-write/test-requirements.txt +++ b/exporter/opentelemetry-exporter-prometheus-remote-write/test-requirements.txt @@ -13,7 +13,7 @@ py-cpuinfo==9.0.0 pytest==7.4.4 pytest-benchmark==4.0.0 python-snappy==0.7.1 -requests==2.31.0 +requests==2.32.3 tomli==2.0.1 typing_extensions==4.10.0 urllib3==2.2.1 diff --git a/instrumentation/opentelemetry-instrumentation-aiohttp-client/test-requirements.txt b/instrumentation/opentelemetry-instrumentation-aiohttp-client/test-requirements.txt index 8f713687bd..0a9c451d33 100644 --- a/instrumentation/opentelemetry-instrumentation-aiohttp-client/test-requirements.txt +++ b/instrumentation/opentelemetry-instrumentation-aiohttp-client/test-requirements.txt @@ -22,7 +22,7 @@ pluggy==1.5.0 py-cpuinfo==9.0.0 pytest==7.4.4 pytest-benchmark==4.0.0 -requests==2.31.0 +requests==2.32.3 tomli==2.0.1 typing_extensions==4.10.0 urllib3==2.2.1 diff --git a/instrumentation/opentelemetry-instrumentation-boto/test-requirements.txt b/instrumentation/opentelemetry-instrumentation-boto/test-requirements.txt index 9f3bbd7508..8d8aad2f0e 100644 --- a/instrumentation/opentelemetry-instrumentation-boto/test-requirements.txt +++ b/instrumentation/opentelemetry-instrumentation-boto/test-requirements.txt @@ -24,7 +24,7 @@ pytest-benchmark==4.0.0 python-dateutil==2.8.2 pytz==2024.1 PyYAML==6.0.1 -requests==2.31.0 +requests==2.32.3 responses==0.25.0 s3transfer==0.10.0 six==1.16.0 diff --git a/instrumentation/opentelemetry-instrumentation-botocore/test-requirements.txt b/instrumentation/opentelemetry-instrumentation-botocore/test-requirements.txt index 29c6c90230..f52060f22e 100644 --- a/instrumentation/opentelemetry-instrumentation-botocore/test-requirements.txt +++ b/instrumentation/opentelemetry-instrumentation-botocore/test-requirements.txt @@ -24,7 +24,7 @@ pytest-benchmark==4.0.0 python-dateutil==2.8.2 pytz==2024.1 PyYAML==6.0.1 -requests==2.31.0 +requests==2.32.3 responses==0.25.0 s3transfer==0.7.0 six==1.16.0 diff --git a/instrumentation/opentelemetry-instrumentation-fastapi/test-requirements.txt b/instrumentation/opentelemetry-instrumentation-fastapi/test-requirements.txt index 3806570105..c73b0ed688 100644 --- a/instrumentation/opentelemetry-instrumentation-fastapi/test-requirements.txt +++ b/instrumentation/opentelemetry-instrumentation-fastapi/test-requirements.txt @@ -19,7 +19,7 @@ pydantic==2.6.2 pydantic_core==2.16.3 pytest==7.4.4 pytest-benchmark==4.0.0 -requests==2.31.0 +requests==2.32.3 sniffio==1.3.0 starlette==0.36.3 tomli==2.0.1 diff --git a/instrumentation/opentelemetry-instrumentation-requests/test-requirements.txt b/instrumentation/opentelemetry-instrumentation-requests/test-requirements.txt index 16458d96d4..1270d12eb1 100644 --- a/instrumentation/opentelemetry-instrumentation-requests/test-requirements.txt +++ b/instrumentation/opentelemetry-instrumentation-requests/test-requirements.txt @@ -11,7 +11,7 @@ pluggy==1.5.0 py-cpuinfo==9.0.0 pytest==7.4.4 pytest-benchmark==4.0.0 -requests==2.31.0 +requests==2.32.3 tomli==2.0.1 typing_extensions==4.9.0 urllib3==2.2.1 diff --git a/instrumentation/opentelemetry-instrumentation-starlette/test-requirements.txt b/instrumentation/opentelemetry-instrumentation-starlette/test-requirements.txt index 53f85db350..882f0e165a 100644 --- a/instrumentation/opentelemetry-instrumentation-starlette/test-requirements.txt +++ b/instrumentation/opentelemetry-instrumentation-starlette/test-requirements.txt @@ -15,7 +15,7 @@ pluggy==1.5.0 py-cpuinfo==9.0.0 pytest==7.4.4 pytest-benchmark==4.0.0 -requests==2.31.0 +requests==2.32.3 sniffio==1.3.0 starlette==0.13.8 tomli==2.0.1 diff --git a/instrumentation/opentelemetry-instrumentation-tornado/test-requirements.txt b/instrumentation/opentelemetry-instrumentation-tornado/test-requirements.txt index a68f40e5d2..86ef01b096 100644 --- a/instrumentation/opentelemetry-instrumentation-tornado/test-requirements.txt +++ b/instrumentation/opentelemetry-instrumentation-tornado/test-requirements.txt @@ -17,7 +17,7 @@ pluggy==1.5.0 py-cpuinfo==9.0.0 pytest==7.4.4 pytest-benchmark==4.0.0 -requests==2.31.0 +requests==2.32.3 tomli==2.0.1 tornado==6.4 typing_extensions==4.9.0 diff --git a/propagator/opentelemetry-propagator-aws-xray/test-requirements.txt b/propagator/opentelemetry-propagator-aws-xray/test-requirements.txt index bbe805e794..26f637bbb2 100644 --- a/propagator/opentelemetry-propagator-aws-xray/test-requirements.txt +++ b/propagator/opentelemetry-propagator-aws-xray/test-requirements.txt @@ -10,7 +10,7 @@ pluggy==1.5.0 py-cpuinfo==9.0.0 pytest==7.4.4 pytest-benchmark==4.0.0 -requests==2.31.0 +requests==2.32.3 tomli==2.0.1 typing_extensions==4.10.0 urllib3==2.2.1 From 361da3e45e99cc42e571c6e3f9913d37e51da89d Mon Sep 17 00:00:00 2001 From: Riccardo Magliocchetti Date: Fri, 14 Jun 2024 00:56:04 +0200 Subject: [PATCH 50/56] botocore: bump moto to latest (#2605) So we can bump Werkzeug too. --- .../test-requirements.txt | 6 +- .../tests/test_botocore_dynamodb.py | 48 +++++++++----- .../tests/test_botocore_instrumentation.py | 62 ++++++++----------- .../tests/test_botocore_lambda.py | 8 +-- .../tests/test_botocore_sns.py | 10 +-- .../tests/test_botocore_sqs.py | 10 +-- 6 files changed, 76 insertions(+), 68 deletions(-) diff --git a/instrumentation/opentelemetry-instrumentation-botocore/test-requirements.txt b/instrumentation/opentelemetry-instrumentation-botocore/test-requirements.txt index f52060f22e..c61d546e07 100644 --- a/instrumentation/opentelemetry-instrumentation-botocore/test-requirements.txt +++ b/instrumentation/opentelemetry-instrumentation-botocore/test-requirements.txt @@ -13,8 +13,8 @@ importlib-metadata==6.11.0 iniconfig==2.0.0 Jinja2==3.1.4 jmespath==1.0.1 -MarkupSafe==2.0.1 -moto==3.1.19 +MarkupSafe==2.1.5 +moto==5.0.9 packaging==24.0 pluggy==1.5.0 py-cpuinfo==9.0.0 @@ -31,7 +31,7 @@ six==1.16.0 tomli==2.0.1 typing_extensions==4.9.0 urllib3==1.26.18 -Werkzeug==2.1.2 +Werkzeug==3.0.3 wrapt==1.16.0 xmltodict==0.13.0 zipp==3.17.0 diff --git a/instrumentation/opentelemetry-instrumentation-botocore/tests/test_botocore_dynamodb.py b/instrumentation/opentelemetry-instrumentation-botocore/tests/test_botocore_dynamodb.py index 12ebe8f2b7..2240baff3a 100644 --- a/instrumentation/opentelemetry-instrumentation-botocore/tests/test_botocore_dynamodb.py +++ b/instrumentation/opentelemetry-instrumentation-botocore/tests/test_botocore_dynamodb.py @@ -16,7 +16,7 @@ from unittest import mock import botocore.session -from moto import mock_dynamodb2 # pylint: disable=import-error +from moto import mock_aws # pylint: disable=import-error from opentelemetry.instrumentation.botocore import BotocoreInstrumentor from opentelemetry.instrumentation.botocore.extensions.dynamodb import ( @@ -184,7 +184,7 @@ def assert_extension_item_col_metrics(self, operation: str): ) self.assert_item_col_metrics(span) - @mock_dynamodb2 + @mock_aws def test_batch_get_item(self): table_name1 = "test_table1" table_name2 = "test_table2" @@ -203,7 +203,7 @@ def test_batch_get_item(self): self.assert_table_names(span, table_name1, table_name2) self.assert_consumed_capacity(span, table_name1, table_name2) - @mock_dynamodb2 + @mock_aws def test_batch_write_item(self): table_name1 = "test_table1" table_name2 = "test_table2" @@ -224,7 +224,7 @@ def test_batch_write_item(self): self.assert_consumed_capacity(span, table_name1, table_name2) self.assert_item_col_metrics(span) - @mock_dynamodb2 + @mock_aws def test_create_table(self): local_sec_idx = { "IndexName": "local_sec_idx", @@ -268,7 +268,7 @@ def test_create_table(self): ) self.assert_provisioned_read_cap(span, 42) - @mock_dynamodb2 + @mock_aws def test_delete_item(self): self._create_prepared_table() @@ -297,7 +297,7 @@ def test_delete_item_consumed_capacity(self): def test_delete_item_item_collection_metrics(self): self.assert_extension_item_col_metrics("DeleteItem") - @mock_dynamodb2 + @mock_aws def test_delete_table(self): self._create_prepared_table() @@ -306,7 +306,7 @@ def test_delete_table(self): span = self.assert_span("DeleteTable") self.assert_table_names(span, self.default_table_name) - @mock_dynamodb2 + @mock_aws def test_describe_table(self): self._create_prepared_table() @@ -315,15 +315,31 @@ def test_describe_table(self): span = self.assert_span("DescribeTable") self.assert_table_names(span, self.default_table_name) - @mock_dynamodb2 - def test_get_item(self): + @mock_aws + def test_get_item_expression(self): + self._create_prepared_table() + + self.client.get_item( + TableName=self.default_table_name, + Key={"id": {"S": "1"}}, + ConsistentRead=True, + ProjectionExpression="PE", + ReturnConsumedCapacity="TOTAL", + ) + + span = self.assert_span("GetItem") + self.assert_table_names(span, self.default_table_name) + self.assert_consistent_read(span, True) + self.assert_consumed_capacity(span, self.default_table_name) + + @mock_aws + def test_get_item_non_expression(self): self._create_prepared_table() self.client.get_item( TableName=self.default_table_name, Key={"id": {"S": "1"}}, ConsistentRead=True, - AttributesToGet=["id"], ProjectionExpression="PE", ReturnConsumedCapacity="TOTAL", ) @@ -334,7 +350,7 @@ def test_get_item(self): self.assert_projection(span, "PE") self.assert_consumed_capacity(span, self.default_table_name) - @mock_dynamodb2 + @mock_aws def test_list_tables(self): self._create_table(TableName="my_table") self._create_prepared_table() @@ -351,7 +367,7 @@ def test_list_tables(self): ) self.assertEqual(5, span.attributes[SpanAttributes.AWS_DYNAMODB_LIMIT]) - @mock_dynamodb2 + @mock_aws def test_put_item(self): table = "test_table" self._create_prepared_table(TableName=table) @@ -372,7 +388,7 @@ def test_put_item(self): def test_put_item_item_collection_metrics(self): self.assert_extension_item_col_metrics("PutItem") - @mock_dynamodb2 + @mock_aws def test_query(self): self._create_prepared_table() @@ -407,7 +423,7 @@ def test_query(self): self.assert_select(span, "ALL_ATTRIBUTES") self.assert_consumed_capacity(span, self.default_table_name) - @mock_dynamodb2 + @mock_aws def test_scan(self): self._create_prepared_table() @@ -444,7 +460,7 @@ def test_scan(self): self.assert_select(span, "ALL_ATTRIBUTES") self.assert_consumed_capacity(span, self.default_table_name) - @mock_dynamodb2 + @mock_aws def test_update_item(self): self._create_prepared_table() @@ -465,7 +481,7 @@ def test_update_item(self): def test_update_item_item_collection_metrics(self): self.assert_extension_item_col_metrics("UpdateItem") - @mock_dynamodb2 + @mock_aws def test_update_table(self): self._create_prepared_table() diff --git a/instrumentation/opentelemetry-instrumentation-botocore/tests/test_botocore_instrumentation.py b/instrumentation/opentelemetry-instrumentation-botocore/tests/test_botocore_instrumentation.py index bb6d283399..62357a3336 100644 --- a/instrumentation/opentelemetry-instrumentation-botocore/tests/test_botocore_instrumentation.py +++ b/instrumentation/opentelemetry-instrumentation-botocore/tests/test_botocore_instrumentation.py @@ -12,19 +12,11 @@ # See the License for the specific language governing permissions and # limitations under the License. import json -from unittest.mock import Mock, patch +from unittest.mock import ANY, Mock, patch import botocore.session from botocore.exceptions import ParamValidationError -from moto import ( # pylint: disable=import-error - mock_ec2, - mock_kinesis, - mock_kms, - mock_s3, - mock_sqs, - mock_sts, - mock_xray, -) +from moto import mock_aws # pylint: disable=import-error from opentelemetry import trace as trace_api from opentelemetry.instrumentation.botocore import BotocoreInstrumentor @@ -39,7 +31,7 @@ from opentelemetry.test.test_base import TestBase from opentelemetry.trace.span import format_span_id, format_trace_id -_REQUEST_ID_REGEX_MATCH = r"[A-Z0-9]{52}" +_REQUEST_ID_REGEX_MATCH = r"[A-Za-z0-9]{52}" # pylint:disable=too-many-public-methods @@ -102,7 +94,7 @@ def assert_span( self.assertEqual(f"{service}.{operation}", span.name) return span - @mock_ec2 + @mock_aws def test_traced_client(self): ec2 = self._make_client("ec2") @@ -111,7 +103,7 @@ def test_traced_client(self): request_id = "fdcdcab1-ae5c-489e-9c33-4637c5dda355" self.assert_span("EC2", "DescribeInstances", request_id=request_id) - @mock_ec2 + @mock_aws def test_not_recording(self): mock_tracer = Mock() mock_span = Mock() @@ -126,7 +118,7 @@ def test_not_recording(self): self.assertFalse(mock_span.set_attribute.called) self.assertFalse(mock_span.set_status.called) - @mock_s3 + @mock_aws def test_exception(self): s3 = self._make_client("s3") @@ -149,14 +141,14 @@ def test_exception(self): self.assertIn(SpanAttributes.EXCEPTION_TYPE, event.attributes) self.assertIn(SpanAttributes.EXCEPTION_MESSAGE, event.attributes) - @mock_s3 + @mock_aws def test_s3_client(self): s3 = self._make_client("s3") s3.list_buckets() self.assert_span("S3", "ListBuckets") - @mock_s3 + @mock_aws def test_s3_put(self): s3 = self._make_client("s3") @@ -174,7 +166,7 @@ def test_s3_put(self): s3.get_object(Bucket="mybucket", Key="foo") self.assert_span("S3", "GetObject", request_id=_REQUEST_ID_REGEX_MATCH) - @mock_sqs + @mock_aws def test_sqs_client(self): sqs = self._make_client("sqs") @@ -184,7 +176,7 @@ def test_sqs_client(self): "SQS", "ListQueues", request_id=_REQUEST_ID_REGEX_MATCH ) - @mock_sqs + @mock_aws def test_sqs_send_message(self): sqs = self._make_client("sqs") test_queue_name = "test_queue_name" @@ -205,14 +197,14 @@ def test_sqs_send_message(self): attributes={"aws.queue_url": queue_url}, ) - @mock_kinesis + @mock_aws def test_kinesis_client(self): kinesis = self._make_client("kinesis") kinesis.list_streams() self.assert_span("Kinesis", "ListStreams") - @mock_kinesis + @mock_aws def test_unpatch(self): kinesis = self._make_client("kinesis") @@ -221,7 +213,7 @@ def test_unpatch(self): kinesis.list_streams() self.assertEqual(0, len(self.memory_exporter.get_finished_spans())) - @mock_ec2 + @mock_aws def test_uninstrument_does_not_inject_headers(self): headers = {} @@ -240,7 +232,7 @@ def intercept_headers(**kwargs): self.assertNotIn(TRACE_HEADER_KEY, headers) - @mock_sqs + @mock_aws def test_double_patch(self): sqs = self._make_client("sqs") @@ -252,19 +244,19 @@ def test_double_patch(self): "SQS", "ListQueues", request_id=_REQUEST_ID_REGEX_MATCH ) - @mock_kms + @mock_aws def test_kms_client(self): kms = self._make_client("kms") kms.list_keys(Limit=21) span = self.assert_only_span() + expected = self._default_span_attributes("KMS", "ListKeys") + expected["aws.request_id"] = ANY # check for exact attribute set to make sure not to leak any kms secrets - self.assertEqual( - self._default_span_attributes("KMS", "ListKeys"), span.attributes - ) + self.assertEqual(expected, dict(span.attributes)) - @mock_sts + @mock_aws def test_sts_client(self): sts = self._make_client("sts") @@ -272,11 +264,11 @@ def test_sts_client(self): span = self.assert_only_span() expected = self._default_span_attributes("STS", "GetCallerIdentity") - expected["aws.request_id"] = "c6104cbe-af31-11e0-8154-cbc7ccf896c7" + expected["aws.request_id"] = ANY # check for exact attribute set to make sure not to leak any sts secrets - self.assertEqual(expected, span.attributes) + self.assertEqual(expected, dict(span.attributes)) - @mock_ec2 + @mock_aws def test_propagator_injects_into_request(self): headers = {} previous_propagator = get_global_textmap() @@ -316,7 +308,7 @@ def check_headers(**kwargs): finally: set_global_textmap(previous_propagator) - @mock_ec2 + @mock_aws def test_override_xray_propagator_injects_into_request(self): headers = {} @@ -335,7 +327,7 @@ def check_headers(**kwargs): self.assertNotIn(MockTextMapPropagator.TRACE_ID_KEY, headers) self.assertNotIn(MockTextMapPropagator.SPAN_ID_KEY, headers) - @mock_xray + @mock_aws def test_suppress_instrumentation_xray_client(self): xray_client = self._make_client("xray") with suppress_instrumentation(): @@ -343,7 +335,7 @@ def test_suppress_instrumentation_xray_client(self): xray_client.put_trace_segments(TraceSegmentDocuments=["str2"]) self.assertEqual(0, len(self.get_finished_spans())) - @mock_xray + @mock_aws def test_suppress_http_instrumentation_xray_client(self): xray_client = self._make_client("xray") with suppress_http_instrumentation(): @@ -351,7 +343,7 @@ def test_suppress_http_instrumentation_xray_client(self): xray_client.put_trace_segments(TraceSegmentDocuments=["str2"]) self.assertEqual(2, len(self.get_finished_spans())) - @mock_s3 + @mock_aws def test_request_hook(self): request_hook_service_attribute_name = "request_hook.service_name" request_hook_operation_attribute_name = "request_hook.operation_name" @@ -386,7 +378,7 @@ def request_hook(span, service_name, operation_name, api_params): }, ) - @mock_s3 + @mock_aws def test_response_hook(self): response_hook_service_attribute_name = "request_hook.service_name" response_hook_operation_attribute_name = "response_hook.operation_name" diff --git a/instrumentation/opentelemetry-instrumentation-botocore/tests/test_botocore_lambda.py b/instrumentation/opentelemetry-instrumentation-botocore/tests/test_botocore_lambda.py index 7388323100..098edfc896 100644 --- a/instrumentation/opentelemetry-instrumentation-botocore/tests/test_botocore_lambda.py +++ b/instrumentation/opentelemetry-instrumentation-botocore/tests/test_botocore_lambda.py @@ -19,7 +19,7 @@ from unittest import mock import botocore.session -from moto import mock_iam, mock_lambda # pylint: disable=import-error +from moto import mock_aws # pylint: disable=import-error from pytest import mark from opentelemetry.instrumentation.botocore import BotocoreInstrumentor @@ -96,12 +96,12 @@ def _create_extension(operation: str) -> _LambdaExtension: mock_call_context = mock.MagicMock(operation=operation, params={}) return _LambdaExtension(mock_call_context) - @mock_lambda + @mock_aws def test_list_functions(self): self.client.list_functions() self.assert_span("ListFunctions") - @mock_iam + @mock_aws def _create_role_and_get_arn(self) -> str: return self.iam_client.create_role( RoleName="my-role", @@ -131,7 +131,7 @@ def _create_lambda_function(self, function_name: str, function_code: str): sys.platform == "win32", reason="requires docker and Github CI Windows does not have docker installed by default", ) - @mock_lambda + @mock_aws def test_invoke(self): previous_propagator = get_global_textmap() try: diff --git a/instrumentation/opentelemetry-instrumentation-botocore/tests/test_botocore_sns.py b/instrumentation/opentelemetry-instrumentation-botocore/tests/test_botocore_sns.py index e2b4c55732..5d6b94f145 100644 --- a/instrumentation/opentelemetry-instrumentation-botocore/tests/test_botocore_sns.py +++ b/instrumentation/opentelemetry-instrumentation-botocore/tests/test_botocore_sns.py @@ -18,7 +18,7 @@ import botocore.session from botocore.awsrequest import AWSResponse -from moto import mock_sns +from moto import mock_aws from opentelemetry.instrumentation.botocore import BotocoreInstrumentor from opentelemetry.semconv.trace import ( @@ -91,11 +91,11 @@ def assert_injected_span(self, message_attrs: Dict[str, Any], span: Span): self.assertEqual(span_context.trace_id, int(trace_parent[1], 16)) self.assertEqual(span_context.span_id, int(trace_parent[2], 16)) - @mock_sns + @mock_aws def test_publish_to_topic_arn(self): self._test_publish_to_arn("TopicArn") - @mock_sns + @mock_aws def test_publish_to_target_arn(self): self._test_publish_to_arn("TargetArn") @@ -125,7 +125,7 @@ def _test_publish_to_arn(self, arg_name: str): span.attributes["messaging.destination.name"], ) - @mock_sns + @mock_aws def test_publish_to_phone_number(self): phone_number = "+10000000000" self.client.publish( @@ -138,7 +138,7 @@ def test_publish_to_phone_number(self): phone_number, span.attributes[SpanAttributes.MESSAGING_DESTINATION] ) - @mock_sns + @mock_aws def test_publish_injects_span(self): message_attrs = {} topic_arn = self._create_topic() diff --git a/instrumentation/opentelemetry-instrumentation-botocore/tests/test_botocore_sqs.py b/instrumentation/opentelemetry-instrumentation-botocore/tests/test_botocore_sqs.py index 6bcffd9274..cdf39e4ece 100644 --- a/instrumentation/opentelemetry-instrumentation-botocore/tests/test_botocore_sqs.py +++ b/instrumentation/opentelemetry-instrumentation-botocore/tests/test_botocore_sqs.py @@ -1,5 +1,5 @@ import botocore.session -from moto import mock_sqs +from moto import mock_aws from opentelemetry.instrumentation.botocore import BotocoreInstrumentor from opentelemetry.semconv.trace import SpanAttributes @@ -22,7 +22,7 @@ def tearDown(self): super().tearDown() BotocoreInstrumentor().uninstrument() - @mock_sqs + @mock_aws def test_sqs_messaging_send_message(self): create_queue_result = self.client.create_queue( QueueName="test_queue_name" @@ -51,7 +51,7 @@ def test_sqs_messaging_send_message(self): response["MessageId"], ) - @mock_sqs + @mock_aws def test_sqs_messaging_send_message_batch(self): create_queue_result = self.client.create_queue( QueueName="test_queue_name" @@ -85,7 +85,7 @@ def test_sqs_messaging_send_message_batch(self): response["Successful"][0]["MessageId"], ) - @mock_sqs + @mock_aws def test_sqs_messaging_receive_message(self): create_queue_result = self.client.create_queue( QueueName="test_queue_name" @@ -116,7 +116,7 @@ def test_sqs_messaging_receive_message(self): message_result["Messages"][0]["MessageId"], ) - @mock_sqs + @mock_aws def test_sqs_messaging_failed_operation(self): with self.assertRaises(Exception): self.client.send_message( From 881a179e3b16ecff305faf4d74566b6b954c4dd2 Mon Sep 17 00:00:00 2001 From: Diego Hurtado Date: Thu, 13 Jun 2024 17:50:45 -0600 Subject: [PATCH 51/56] Add xray propagators that prioritizes xray environment variable (#2573) * Add AwsXrayLambdaPropagator Fixes #2457 * Remove unnecessary AWS_TRACE_HEADER_PROP * Add docstring * Fix nit * Add no environment variable test case * Add test case for valid context * Remove ipdb * Fix lint * Add missing entry point --- CHANGELOG.md | 5 + .../pyproject.toml | 1 + .../propagators/aws/aws_xray_propagator.py | 32 ++++ .../tests/test_aws_xray_lambda_propagator.py | 164 ++++++++++++++++++ 4 files changed, 202 insertions(+) create mode 100644 propagator/opentelemetry-propagator-aws-xray/tests/test_aws_xray_lambda_propagator.py diff --git a/CHANGELOG.md b/CHANGELOG.md index e17542b104..eead4dd886 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -7,6 +7,11 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ## Unreleased +### Added + +- `opentelemetry-sdk-extension-aws` Add AwsXrayLambdaPropagator + ([#2573](https://github.com/open-telemetry/opentelemetry-python-contrib/pull/2573)) + ### Breaking changes - `opentelemetry-instrumentation-asgi`, `opentelemetry-instrumentation-fastapi`, `opentelemetry-instrumentation-starlette` Use `tracer` and `meter` of originating components instead of one from `asgi` middleware diff --git a/propagator/opentelemetry-propagator-aws-xray/pyproject.toml b/propagator/opentelemetry-propagator-aws-xray/pyproject.toml index 69fd0bbbfa..4a3e22269a 100644 --- a/propagator/opentelemetry-propagator-aws-xray/pyproject.toml +++ b/propagator/opentelemetry-propagator-aws-xray/pyproject.toml @@ -30,6 +30,7 @@ dependencies = [ [project.entry-points.opentelemetry_propagator] xray = "opentelemetry.propagators.aws:AwsXRayPropagator" +xray_lambda = "opentelemetry.propagators.aws:AwsXRayLambdaPropagator" [project.urls] Homepage = "https://github.com/open-telemetry/opentelemetry-python-contrib/tree/main/propagator/opentelemetry-propagator-aws-xray" diff --git a/propagator/opentelemetry-propagator-aws-xray/src/opentelemetry/propagators/aws/aws_xray_propagator.py b/propagator/opentelemetry-propagator-aws-xray/src/opentelemetry/propagators/aws/aws_xray_propagator.py index 4e4a6872ea..4966218211 100644 --- a/propagator/opentelemetry-propagator-aws-xray/src/opentelemetry/propagators/aws/aws_xray_propagator.py +++ b/propagator/opentelemetry-propagator-aws-xray/src/opentelemetry/propagators/aws/aws_xray_propagator.py @@ -58,6 +58,7 @@ import logging import typing +from os import environ from opentelemetry import trace from opentelemetry.context import Context @@ -71,6 +72,7 @@ ) TRACE_HEADER_KEY = "X-Amzn-Trace-Id" +AWS_TRACE_HEADER_ENV_KEY = "_X_AMZN_TRACE_ID" KV_PAIR_DELIMITER = ";" KEY_AND_VALUE_DELIMITER = "=" @@ -324,3 +326,33 @@ def fields(self): """Returns a set with the fields set in `inject`.""" return {TRACE_HEADER_KEY} + + +class AwsXrayLambdaPropagator(AwsXRayPropagator): + """Implementation of the AWS X-Ray Trace Header propagation protocol but + with special handling for Lambda's ``_X_AMZN_TRACE_ID` environment + variable. + """ + + def extract( + self, + carrier: CarrierT, + context: typing.Optional[Context] = None, + getter: Getter[CarrierT] = default_getter, + ) -> Context: + + xray_context = super().extract(carrier, context=context, getter=getter) + + if trace.get_current_span(context=context).get_span_context().is_valid: + return xray_context + + trace_header = environ.get(AWS_TRACE_HEADER_ENV_KEY) + + if trace_header is None: + return xray_context + + return super().extract( + {TRACE_HEADER_KEY: trace_header}, + context=xray_context, + getter=getter, + ) diff --git a/propagator/opentelemetry-propagator-aws-xray/tests/test_aws_xray_lambda_propagator.py b/propagator/opentelemetry-propagator-aws-xray/tests/test_aws_xray_lambda_propagator.py new file mode 100644 index 0000000000..a0432d1457 --- /dev/null +++ b/propagator/opentelemetry-propagator-aws-xray/tests/test_aws_xray_lambda_propagator.py @@ -0,0 +1,164 @@ +# 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 os import environ +from unittest import TestCase +from unittest.mock import patch + +from requests.structures import CaseInsensitiveDict + +from opentelemetry.context import get_current +from opentelemetry.propagators.aws.aws_xray_propagator import ( + TRACE_HEADER_KEY, + AwsXrayLambdaPropagator, +) +from opentelemetry.propagators.textmap import DefaultGetter +from opentelemetry.sdk.trace import ReadableSpan +from opentelemetry.trace import ( + Link, + NonRecordingSpan, + SpanContext, + TraceState, + get_current_span, + use_span, +) + + +class AwsXRayLambdaPropagatorTest(TestCase): + + def test_extract_no_environment_variable(self): + + actual_context = get_current_span( + AwsXrayLambdaPropagator().extract( + {}, context=get_current(), getter=DefaultGetter() + ) + ).get_span_context() + + self.assertEqual(hex(actual_context.trace_id), "0x0") + self.assertEqual(hex(actual_context.span_id), "0x0") + self.assertFalse( + actual_context.trace_flags.sampled, + ) + self.assertEqual(actual_context.trace_state, TraceState.get_default()) + + def test_extract_no_environment_variable_valid_context(self): + + with use_span(NonRecordingSpan(SpanContext(1, 2, False))): + + actual_context = get_current_span( + AwsXrayLambdaPropagator().extract( + {}, context=get_current(), getter=DefaultGetter() + ) + ).get_span_context() + + self.assertEqual(hex(actual_context.trace_id), "0x1") + self.assertEqual(hex(actual_context.span_id), "0x2") + self.assertFalse( + actual_context.trace_flags.sampled, + ) + self.assertEqual( + actual_context.trace_state, TraceState.get_default() + ) + + @patch.dict( + environ, + { + "_X_AMZN_TRACE_ID": ( + "Root=1-00000001-d188f8fa79d48a391a778fa6;" + "Parent=53995c3f42cd8ad8;Sampled=1;Foo=Bar" + ) + }, + ) + def test_extract_from_environment_variable(self): + + actual_context = get_current_span( + AwsXrayLambdaPropagator().extract( + {}, context=get_current(), getter=DefaultGetter() + ) + ).get_span_context() + + self.assertEqual( + hex(actual_context.trace_id), "0x1d188f8fa79d48a391a778fa6" + ) + self.assertEqual(hex(actual_context.span_id), "0x53995c3f42cd8ad8") + self.assertTrue( + actual_context.trace_flags.sampled, + ) + self.assertEqual(actual_context.trace_state, TraceState.get_default()) + + @patch.dict( + environ, + { + "_X_AMZN_TRACE_ID": ( + "Root=1-00000002-240000000000000000000002;" + "Parent=1600000000000002;Sampled=1;Foo=Bar" + ) + }, + ) + def test_add_link_from_environment_variable(self): + + propagator = AwsXrayLambdaPropagator() + + default_getter = DefaultGetter() + + carrier = CaseInsensitiveDict( + { + TRACE_HEADER_KEY: ( + "Root=1-00000001-240000000000000000000001;" + "Parent=1600000000000001;Sampled=1" + ) + } + ) + + extracted_context = propagator.extract( + carrier, context=get_current(), getter=default_getter + ) + + link_context = propagator.extract( + carrier, context=extracted_context, getter=default_getter + ) + + span = ReadableSpan( + "test", parent=extracted_context, links=[Link(link_context)] + ) + + span_parent_context = get_current_span(span.parent).get_span_context() + + self.assertEqual( + hex(span_parent_context.trace_id), "0x2240000000000000000000002" + ) + self.assertEqual( + hex(span_parent_context.span_id), "0x1600000000000002" + ) + self.assertTrue( + span_parent_context.trace_flags.sampled, + ) + self.assertEqual( + span_parent_context.trace_state, TraceState.get_default() + ) + + span_link_context = get_current_span( + span.links[0].context + ).get_span_context() + + self.assertEqual( + hex(span_link_context.trace_id), "0x1240000000000000000000001" + ) + self.assertEqual(hex(span_link_context.span_id), "0x1600000000000001") + self.assertTrue( + span_link_context.trace_flags.sampled, + ) + self.assertEqual( + span_link_context.trace_state, TraceState.get_default() + ) From 6be205e60445c7c485a487158fb26538e3ab1c03 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Em=C3=ADdio=20Neto?= <9735060+emdneto@users.noreply.github.com> Date: Fri, 14 Jun 2024 13:53:28 -0300 Subject: [PATCH 52/56] consistently use of suppress_instrumentation utils (#2590) --- CHANGELOG.md | 2 + .../aiohttp_server/__init__.py | 14 ++--- .../tests/test_aiohttp_server_integration.py | 29 +++++++++- .../instrumentation/httpx/__init__.py | 10 ++-- .../tests/test_httpx_integration.py | 17 ++---- .../opentelemetry/instrumentation/utils.py | 15 ++++-- .../tests/test_utils.py | 54 +++++++++++++++++++ .../CHANGELOG.md | 5 ++ .../resource/detector/azure/vm.py | 24 ++++----- 9 files changed, 125 insertions(+), 45 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index eead4dd886..05199a98a4 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 ([#2538](https://github.com/open-telemetry/opentelemetry-python-contrib/pull/2538)) - Add Python 3.12 support ([#2572](https://github.com/open-telemetry/opentelemetry-python-contrib/pull/2572)) +- `opentelemetry-instrumentation-aiohttp-server`, `opentelemetry-instrumentation-httpx` Ensure consistently use of suppress_instrumentation utils + ([#2590](https://github.com/open-telemetry/opentelemetry-python-contrib/pull/2590)) ## Version 1.25.0/0.46b0 (2024-05-31) 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 c1ab960818..2e519ac1c5 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 @@ -19,12 +19,14 @@ from aiohttp import web from multidict import CIMultiDictProxy -from opentelemetry import context, metrics, trace -from opentelemetry.context import _SUPPRESS_HTTP_INSTRUMENTATION_KEY +from opentelemetry import metrics, trace from opentelemetry.instrumentation.aiohttp_server.package import _instruments from opentelemetry.instrumentation.aiohttp_server.version import __version__ from opentelemetry.instrumentation.instrumentor import BaseInstrumentor -from opentelemetry.instrumentation.utils import http_status_to_status_code +from opentelemetry.instrumentation.utils import ( + http_status_to_status_code, + is_http_instrumentation_enabled, +) from opentelemetry.propagate import extract from opentelemetry.propagators.textmap import Getter from opentelemetry.semconv.metrics import MetricInstruments @@ -191,10 +193,8 @@ def keys(self, carrier: Dict) -> List: @web.middleware async def middleware(request, handler): """Middleware for aiohttp implementing tracing logic""" - if ( - context.get_value("suppress_instrumentation") - or context.get_value(_SUPPRESS_HTTP_INSTRUMENTATION_KEY) - or _excluded_urls.url_disabled(request.url.path) + if not is_http_instrumentation_enabled() or _excluded_urls.url_disabled( + request.url.path ): return await handler(request) diff --git a/instrumentation/opentelemetry-instrumentation-aiohttp-server/tests/test_aiohttp_server_integration.py b/instrumentation/opentelemetry-instrumentation-aiohttp-server/tests/test_aiohttp_server_integration.py index b5e8ec468f..e9dfb11389 100644 --- a/instrumentation/opentelemetry-instrumentation-aiohttp-server/tests/test_aiohttp_server_integration.py +++ b/instrumentation/opentelemetry-instrumentation-aiohttp-server/tests/test_aiohttp_server_integration.py @@ -23,6 +23,7 @@ from opentelemetry.instrumentation.aiohttp_server import ( AioHttpServerInstrumentor, ) +from opentelemetry.instrumentation.utils import suppress_http_instrumentation from opentelemetry.semconv.trace import SpanAttributes from opentelemetry.test.globals_test import reset_trace_globals from opentelemetry.test.test_base import TestBase @@ -64,16 +65,25 @@ async def default_handler(request, status=200): return aiohttp.web.Response(status=status) +@pytest.fixture(name="suppress") +def fixture_suppress(): + return False + + @pytest_asyncio.fixture(name="server_fixture") -async def fixture_server_fixture(tracer, aiohttp_server): +async def fixture_server_fixture(tracer, aiohttp_server, suppress): _, memory_exporter = tracer AioHttpServerInstrumentor().instrument() app = aiohttp.web.Application() app.add_routes([aiohttp.web.get("/test-path", default_handler)]) + if suppress: + with suppress_http_instrumentation(): + server = await aiohttp_server(app) + else: + server = await aiohttp_server(app) - server = await aiohttp_server(app) yield server, app memory_exporter.clear() @@ -128,3 +138,18 @@ async def test_status_code_instrumentation( f"http://{server.host}:{server.port}{url}" == span.attributes[SpanAttributes.HTTP_URL] ) + + +@pytest.mark.asyncio +@pytest.mark.parametrize("suppress", [True]) +async def test_suppress_instrumentation( + tracer, server_fixture, aiohttp_client +): + _, memory_exporter = tracer + server, _ = server_fixture + assert len(memory_exporter.get_finished_spans()) == 0 + + client = await aiohttp_client(server) + await client.get("/test-path") + + assert len(memory_exporter.get_finished_spans()) == 0 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 850e76eea3..5404b2f025 100644 --- a/instrumentation/opentelemetry-instrumentation-httpx/src/opentelemetry/instrumentation/httpx/__init__.py +++ b/instrumentation/opentelemetry-instrumentation-httpx/src/opentelemetry/instrumentation/httpx/__init__.py @@ -196,11 +196,13 @@ async def async_response_hook(span, request, response): import httpx -from opentelemetry import context from opentelemetry.instrumentation.httpx.package import _instruments from opentelemetry.instrumentation.httpx.version import __version__ from opentelemetry.instrumentation.instrumentor import BaseInstrumentor -from opentelemetry.instrumentation.utils import http_status_to_status_code +from opentelemetry.instrumentation.utils import ( + http_status_to_status_code, + is_http_instrumentation_enabled, +) from opentelemetry.propagate import inject from opentelemetry.semconv.trace import SpanAttributes from opentelemetry.trace import SpanKind, TracerProvider, get_tracer @@ -347,7 +349,7 @@ def handle_request( httpx.Response, ]: """Add request info to span.""" - if context.get_value("suppress_instrumentation"): + if not is_http_instrumentation_enabled(): return self._transport.handle_request(*args, **kwargs) method, url, headers, stream, extensions = _extract_parameters( @@ -438,7 +440,7 @@ async def handle_async_request(self, *args, **kwargs) -> typing.Union[ httpx.Response, ]: """Add request info to span.""" - if context.get_value("suppress_instrumentation"): + if not is_http_instrumentation_enabled(): return await self._transport.handle_async_request(*args, **kwargs) method, url, headers, stream, extensions = _extract_parameters( diff --git a/instrumentation/opentelemetry-instrumentation-httpx/tests/test_httpx_integration.py b/instrumentation/opentelemetry-instrumentation-httpx/tests/test_httpx_integration.py index d64db1a8f5..06ad963ab0 100644 --- a/instrumentation/opentelemetry-instrumentation-httpx/tests/test_httpx_integration.py +++ b/instrumentation/opentelemetry-instrumentation-httpx/tests/test_httpx_integration.py @@ -21,12 +21,13 @@ import respx import opentelemetry.instrumentation.httpx -from opentelemetry import context, trace +from opentelemetry import trace from opentelemetry.instrumentation.httpx import ( AsyncOpenTelemetryTransport, HTTPXClientInstrumentor, SyncOpenTelemetryTransport, ) +from opentelemetry.instrumentation.utils import suppress_http_instrumentation from opentelemetry.propagate import get_global_textmap, set_global_textmap from opentelemetry.sdk import resources from opentelemetry.semconv.trace import SpanAttributes @@ -191,14 +192,9 @@ def test_not_foundbasic(self): ) def test_suppress_instrumentation(self): - token = context.attach( - context.set_value("suppress_instrumentation", True) - ) - try: + with suppress_http_instrumentation(): result = self.perform_request(self.URL) self.assertEqual(result.text, "Hello!") - finally: - context.detach(token) self.assert_span(num_spans=0) @@ -512,15 +508,10 @@ def test_not_recording(self): def test_suppress_instrumentation_new_client(self): HTTPXClientInstrumentor().instrument() - token = context.attach( - context.set_value("suppress_instrumentation", True) - ) - try: + with suppress_http_instrumentation(): client = self.create_client() result = self.perform_request(self.URL, client=client) self.assertEqual(result.text, "Hello!") - finally: - context.detach(token) self.assert_span(num_spans=0) HTTPXClientInstrumentor().uninstrument() diff --git a/opentelemetry-instrumentation/src/opentelemetry/instrumentation/utils.py b/opentelemetry-instrumentation/src/opentelemetry/instrumentation/utils.py index 318aaeaa74..73c000ee9c 100644 --- a/opentelemetry-instrumentation/src/opentelemetry/instrumentation/utils.py +++ b/opentelemetry-instrumentation/src/opentelemetry/instrumentation/utils.py @@ -37,6 +37,10 @@ propagator = TraceContextTextMapPropagator() +_SUPPRESS_INSTRUMENTATION_KEY_PLAIN = ( + "suppress_instrumentation" # Set for backward compatibility +) + def extract_attributes_from_object( obj: any, attributes: Sequence[str], existing: Dict[str, str] = None @@ -161,9 +165,10 @@ def _python_path_without_directory(python_path, directory, path_separator): def is_instrumentation_enabled() -> bool: - if context.get_value(_SUPPRESS_INSTRUMENTATION_KEY): - return False - return True + return not ( + context.get_value(_SUPPRESS_INSTRUMENTATION_KEY) + or context.get_value(_SUPPRESS_INSTRUMENTATION_KEY_PLAIN) + ) def is_http_instrumentation_enabled() -> bool: @@ -188,7 +193,9 @@ def _suppress_instrumentation(*keys: str) -> Iterable[None]: @contextmanager def suppress_instrumentation() -> Iterable[None]: """Suppress instrumentation within the context.""" - with _suppress_instrumentation(_SUPPRESS_INSTRUMENTATION_KEY): + with _suppress_instrumentation( + _SUPPRESS_INSTRUMENTATION_KEY, _SUPPRESS_INSTRUMENTATION_KEY_PLAIN + ): yield diff --git a/opentelemetry-instrumentation/tests/test_utils.py b/opentelemetry-instrumentation/tests/test_utils.py index cf6cfdfd37..d3807a1bdb 100644 --- a/opentelemetry-instrumentation/tests/test_utils.py +++ b/opentelemetry-instrumentation/tests/test_utils.py @@ -15,10 +15,20 @@ import unittest from http import HTTPStatus +from opentelemetry.context import ( + _SUPPRESS_HTTP_INSTRUMENTATION_KEY, + _SUPPRESS_INSTRUMENTATION_KEY, + get_current, + get_value, +) from opentelemetry.instrumentation.sqlcommenter_utils import _add_sql_comment from opentelemetry.instrumentation.utils import ( _python_path_without_directory, http_status_to_status_code, + is_http_instrumentation_enabled, + is_instrumentation_enabled, + suppress_http_instrumentation, + suppress_instrumentation, ) from opentelemetry.trace import StatusCode @@ -186,3 +196,47 @@ def test_add_sql_comments_without_comments(self): ) self.assertEqual(commented_sql_without_semicolon, "Select 1") + + def test_is_instrumentation_enabled_by_default(self): + self.assertTrue(is_instrumentation_enabled()) + self.assertTrue(is_http_instrumentation_enabled()) + + def test_suppress_instrumentation(self): + with suppress_instrumentation(): + self.assertFalse(is_instrumentation_enabled()) + self.assertFalse(is_http_instrumentation_enabled()) + + self.assertTrue(is_instrumentation_enabled()) + self.assertTrue(is_http_instrumentation_enabled()) + + def test_suppress_http_instrumentation(self): + with suppress_http_instrumentation(): + self.assertFalse(is_http_instrumentation_enabled()) + self.assertTrue(is_instrumentation_enabled()) + + self.assertTrue(is_instrumentation_enabled()) + self.assertTrue(is_http_instrumentation_enabled()) + + def test_suppress_instrumentation_key(self): + self.assertIsNone(get_value(_SUPPRESS_INSTRUMENTATION_KEY)) + self.assertIsNone(get_value("suppress_instrumentation")) + + with suppress_instrumentation(): + ctx = get_current() + self.assertIn(_SUPPRESS_INSTRUMENTATION_KEY, ctx) + self.assertIn("suppress_instrumentation", ctx) + self.assertTrue(get_value(_SUPPRESS_INSTRUMENTATION_KEY)) + self.assertTrue(get_value("suppress_instrumentation")) + + self.assertIsNone(get_value(_SUPPRESS_INSTRUMENTATION_KEY)) + self.assertIsNone(get_value("suppress_instrumentation")) + + def test_suppress_http_instrumentation_key(self): + self.assertIsNone(get_value(_SUPPRESS_HTTP_INSTRUMENTATION_KEY)) + + with suppress_http_instrumentation(): + ctx = get_current() + self.assertIn(_SUPPRESS_HTTP_INSTRUMENTATION_KEY, ctx) + self.assertTrue(get_value(_SUPPRESS_HTTP_INSTRUMENTATION_KEY)) + + self.assertIsNone(get_value(_SUPPRESS_HTTP_INSTRUMENTATION_KEY)) diff --git a/resource/opentelemetry-resource-detector-azure/CHANGELOG.md b/resource/opentelemetry-resource-detector-azure/CHANGELOG.md index f77fce18f1..5e16c83d63 100644 --- a/resource/opentelemetry-resource-detector-azure/CHANGELOG.md +++ b/resource/opentelemetry-resource-detector-azure/CHANGELOG.md @@ -5,6 +5,11 @@ All notable changes to this project will be documented in this file. The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). +## Unreleased + +- Ensure consistently use of suppress_instrumentation utils + ([#2590](https://github.com/open-telemetry/opentelemetry-python-contrib/pull/2590)) + ## Version 0.1.5 (2024-05-16) - Ignore vm detector if already in other rps diff --git a/resource/opentelemetry-resource-detector-azure/src/opentelemetry/resource/detector/azure/vm.py b/resource/opentelemetry-resource-detector-azure/src/opentelemetry/resource/detector/azure/vm.py index 2112282949..63281a46e5 100644 --- a/resource/opentelemetry-resource-detector-azure/src/opentelemetry/resource/detector/azure/vm.py +++ b/resource/opentelemetry-resource-detector-azure/src/opentelemetry/resource/detector/azure/vm.py @@ -17,12 +17,7 @@ from urllib.error import URLError from urllib.request import Request, urlopen -from opentelemetry.context import ( - _SUPPRESS_INSTRUMENTATION_KEY, - attach, - detach, - set_value, -) +from opentelemetry.instrumentation.utils import suppress_instrumentation from opentelemetry.sdk.resources import Resource, ResourceDetector from opentelemetry.semconv.resource import ( CloudPlatformValues, @@ -46,15 +41,14 @@ class AzureVMResourceDetector(ResourceDetector): def detect(self) -> "Resource": attributes = {} if not _can_ignore_vm_detect(): - token = attach(set_value(_SUPPRESS_INSTRUMENTATION_KEY, True)) - metadata_json = _get_azure_vm_metadata() - if not metadata_json: - return Resource(attributes) - for attribute_key in _EXPECTED_AZURE_AMS_ATTRIBUTES: - attributes[attribute_key] = _get_attribute_from_metadata( - metadata_json, attribute_key - ) - detach(token) + with suppress_instrumentation(): + metadata_json = _get_azure_vm_metadata() + if not metadata_json: + return Resource(attributes) + for attribute_key in _EXPECTED_AZURE_AMS_ATTRIBUTES: + attributes[attribute_key] = _get_attribute_from_metadata( + metadata_json, attribute_key + ) return Resource(attributes) From 795c93376c9db0a426aa62d79e28389e4ef27cf6 Mon Sep 17 00:00:00 2001 From: Riccardo Magliocchetti Date: Fri, 14 Jun 2024 19:01:11 +0200 Subject: [PATCH 53/56] instrumentation/pymysql: bump pymysql to 1.1.1 in test requirements (#2608) --- .../opentelemetry-instrumentation-pymysql/test-requirements.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/instrumentation/opentelemetry-instrumentation-pymysql/test-requirements.txt b/instrumentation/opentelemetry-instrumentation-pymysql/test-requirements.txt index 9a1076a543..5f2d8b7783 100644 --- a/instrumentation/opentelemetry-instrumentation-pymysql/test-requirements.txt +++ b/instrumentation/opentelemetry-instrumentation-pymysql/test-requirements.txt @@ -5,7 +5,7 @@ iniconfig==2.0.0 packaging==24.0 pluggy==1.5.0 py-cpuinfo==9.0.0 -PyMySQL==1.1.0 +PyMySQL==1.1.1 pytest==7.4.4 pytest-benchmark==4.0.0 tomli==2.0.1 From 91a69d4c9971a6b7e1c2b7b3eeb5856a7a300b0f Mon Sep 17 00:00:00 2001 From: Riccardo Magliocchetti Date: Fri, 14 Jun 2024 19:11:24 +0200 Subject: [PATCH 54/56] aiohttp: bump aiohttp in test requirements to latest (#2607) --- .../test-requirements.txt | 2 +- .../test-requirements.txt | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/instrumentation/opentelemetry-instrumentation-aiohttp-client/test-requirements.txt b/instrumentation/opentelemetry-instrumentation-aiohttp-client/test-requirements.txt index 0a9c451d33..1110776262 100644 --- a/instrumentation/opentelemetry-instrumentation-aiohttp-client/test-requirements.txt +++ b/instrumentation/opentelemetry-instrumentation-aiohttp-client/test-requirements.txt @@ -1,4 +1,4 @@ -aiohttp==3.9.3 +aiohttp==3.9.4 aiosignal==1.3.1 asgiref==3.7.2 async-timeout==4.0.3 diff --git a/instrumentation/opentelemetry-instrumentation-aiohttp-server/test-requirements.txt b/instrumentation/opentelemetry-instrumentation-aiohttp-server/test-requirements.txt index c62da59804..fe7582a2bb 100644 --- a/instrumentation/opentelemetry-instrumentation-aiohttp-server/test-requirements.txt +++ b/instrumentation/opentelemetry-instrumentation-aiohttp-server/test-requirements.txt @@ -1,4 +1,4 @@ -aiohttp==3.9.3 +aiohttp==3.9.4 aiosignal==1.3.1 asgiref==3.7.2 async-timeout==4.0.3 From daa84a6c6386dbebbb6a57c012257a93e4267113 Mon Sep 17 00:00:00 2001 From: Riccardo Magliocchetti Date: Fri, 14 Jun 2024 19:20:50 +0200 Subject: [PATCH 55/56] instrumentation/tornado: bump to latest 6.4.1 in test-requirements (#2606) --- .../opentelemetry-instrumentation-tornado/test-requirements.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/instrumentation/opentelemetry-instrumentation-tornado/test-requirements.txt b/instrumentation/opentelemetry-instrumentation-tornado/test-requirements.txt index 86ef01b096..700911213a 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 pytest-benchmark==4.0.0 requests==2.32.3 tomli==2.0.1 -tornado==6.4 +tornado==6.4.1 typing_extensions==4.9.0 urllib3==2.2.1 Werkzeug==3.0.3 From b94c5906fd9cc723ba81da965f89ae73264ec835 Mon Sep 17 00:00:00 2001 From: Leighton Chen Date: Mon, 17 Jun 2024 09:20:17 -0700 Subject: [PATCH 56/56] Use generated symbols from semantic conventions package (#2611) --- CHANGELOG.md | 2 + .../instrumentation/flask/__init__.py | 8 +- .../tests/test_programmatic.py | 6 +- .../instrumentation/requests/__init__.py | 38 +++---- .../tests/test_requests_integration.py | 100 +++++++++--------- .../instrumentation/wsgi/__init__.py | 14 +-- .../tests/test_wsgi_middleware.py | 72 +++++++------ .../opentelemetry/instrumentation/_semconv.py | 93 ++++++++-------- 8 files changed, 172 insertions(+), 161 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 05199a98a4..bbbf49f453 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -25,6 +25,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ([#2572](https://github.com/open-telemetry/opentelemetry-python-contrib/pull/2572)) - `opentelemetry-instrumentation-aiohttp-server`, `opentelemetry-instrumentation-httpx` Ensure consistently use of suppress_instrumentation utils ([#2590](https://github.com/open-telemetry/opentelemetry-python-contrib/pull/2590)) +- Reference symbols from generated semantic conventions + ([#2611](https://github.com/open-telemetry/opentelemetry-python-contrib/pull/2611)) ## Version 1.25.0/0.46b0 (2024-05-31) 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 f2e0ee34cc..34e9b5ea50 100644 --- a/instrumentation/opentelemetry-instrumentation-flask/src/opentelemetry/instrumentation/flask/__init__.py +++ b/instrumentation/opentelemetry-instrumentation-flask/src/opentelemetry/instrumentation/flask/__init__.py @@ -251,7 +251,6 @@ def response_hook(span: Span, status: str, response_headers: List): import opentelemetry.instrumentation.wsgi as otel_wsgi from opentelemetry import context, trace from opentelemetry.instrumentation._semconv import ( - _METRIC_ATTRIBUTES_SERVER_DURATION_NAME, _get_schema_url, _HTTPStabilityMode, _OpenTelemetrySemanticConventionStability, @@ -268,6 +267,9 @@ def response_hook(span: Span, status: str, response_headers: List): from opentelemetry.instrumentation.utils import _start_internal_or_server_span from opentelemetry.metrics import get_meter from opentelemetry.semconv.metrics import MetricInstruments +from opentelemetry.semconv.metrics.http_metrics import ( + HTTP_SERVER_REQUEST_DURATION, +) from opentelemetry.semconv.trace import SpanAttributes from opentelemetry.util.http import ( get_excluded_urls, @@ -553,7 +555,7 @@ def __init__(self, *args, **kwargs): duration_histogram_new = None if _report_new(_InstrumentedFlask._sem_conv_opt_in_mode): duration_histogram_new = meter.create_histogram( - name=_METRIC_ATTRIBUTES_SERVER_DURATION_NAME, + name=HTTP_SERVER_REQUEST_DURATION, unit="s", description="measures the duration of the inbound HTTP request", ) @@ -684,7 +686,7 @@ def instrument_app( duration_histogram_new = None if _report_new(sem_conv_opt_in_mode): duration_histogram_new = meter.create_histogram( - name=_METRIC_ATTRIBUTES_SERVER_DURATION_NAME, + name=HTTP_SERVER_REQUEST_DURATION, unit="s", description="measures the duration of the inbound HTTP request", ) diff --git a/instrumentation/opentelemetry-instrumentation-flask/tests/test_programmatic.py b/instrumentation/opentelemetry-instrumentation-flask/tests/test_programmatic.py index d30a100b0e..f50d3245a0 100644 --- a/instrumentation/opentelemetry-instrumentation-flask/tests/test_programmatic.py +++ b/instrumentation/opentelemetry-instrumentation-flask/tests/test_programmatic.py @@ -20,7 +20,6 @@ from opentelemetry import trace from opentelemetry.instrumentation._semconv import ( - _SPAN_ATTRIBUTES_ERROR_TYPE, OTEL_SEMCONV_STABILITY_OPT_IN, _OpenTelemetrySemanticConventionStability, _server_active_requests_count_attrs_new, @@ -40,6 +39,7 @@ NumberDataPoint, ) from opentelemetry.sdk.resources import Resource +from opentelemetry.semconv.attributes.error_attributes import ERROR_TYPE from opentelemetry.semconv.trace import SpanAttributes from opentelemetry.test.wsgitestutil import WsgiTestBase from opentelemetry.util.http import ( @@ -379,7 +379,7 @@ def test_internal_error_new_semconv(self): SpanAttributes.URL_PATH: "/hello/500", SpanAttributes.HTTP_ROUTE: "/hello/", SpanAttributes.HTTP_RESPONSE_STATUS_CODE: 500, - _SPAN_ATTRIBUTES_ERROR_TYPE: "500", + ERROR_TYPE: "500", SpanAttributes.URL_SCHEME: "http", } ) @@ -405,7 +405,7 @@ def test_internal_error_both_semconv(self): { SpanAttributes.URL_PATH: "/hello/500", SpanAttributes.HTTP_RESPONSE_STATUS_CODE: 500, - _SPAN_ATTRIBUTES_ERROR_TYPE: "500", + ERROR_TYPE: "500", SpanAttributes.URL_SCHEME: "http", } ) 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 8c54482a46..18cc3e767c 100644 --- a/instrumentation/opentelemetry-instrumentation-requests/src/opentelemetry/instrumentation/requests/__init__.py +++ b/instrumentation/opentelemetry-instrumentation-requests/src/opentelemetry/instrumentation/requests/__init__.py @@ -59,10 +59,6 @@ from requests.structures import CaseInsensitiveDict from opentelemetry.instrumentation._semconv import ( - _METRIC_ATTRIBUTES_CLIENT_DURATION_NAME, - _SPAN_ATTRIBUTES_ERROR_TYPE, - _SPAN_ATTRIBUTES_NETWORK_PEER_ADDRESS, - _SPAN_ATTRIBUTES_NETWORK_PEER_PORT, _client_duration_attrs_new, _client_duration_attrs_old, _filter_semconv_duration_attrs, @@ -91,7 +87,15 @@ ) from opentelemetry.metrics import Histogram, get_meter from opentelemetry.propagate import inject +from opentelemetry.semconv.attributes.error_attributes import ERROR_TYPE +from opentelemetry.semconv.attributes.network_attributes import ( + NETWORK_PEER_ADDRESS, + NETWORK_PEER_PORT, +) from opentelemetry.semconv.metrics import MetricInstruments +from opentelemetry.semconv.metrics.http_metrics import ( + HTTP_CLIENT_REQUEST_DURATION, +) from opentelemetry.trace import SpanKind, Tracer, get_tracer from opentelemetry.trace.span import Span from opentelemetry.trace.status import StatusCode @@ -191,9 +195,7 @@ def get_or_create_headers(): sem_conv_opt_in_mode, ) # Use semconv library when available - span_attributes[_SPAN_ATTRIBUTES_NETWORK_PEER_ADDRESS] = ( - parsed_url.hostname - ) + span_attributes[NETWORK_PEER_ADDRESS] = parsed_url.hostname if parsed_url.port: _set_http_peer_port_client( metric_labels, parsed_url.port, sem_conv_opt_in_mode @@ -203,9 +205,7 @@ def get_or_create_headers(): span_attributes, parsed_url.port, sem_conv_opt_in_mode ) # Use semconv library when available - span_attributes[_SPAN_ATTRIBUTES_NETWORK_PEER_PORT] = ( - parsed_url.port - ) + span_attributes[NETWORK_PEER_PORT] = parsed_url.port except ValueError: pass @@ -250,12 +250,8 @@ def get_or_create_headers(): _report_new(sem_conv_opt_in_mode) and status_code is StatusCode.ERROR ): - span_attributes[_SPAN_ATTRIBUTES_ERROR_TYPE] = str( - result.status_code - ) - metric_labels[_SPAN_ATTRIBUTES_ERROR_TYPE] = str( - result.status_code - ) + span_attributes[ERROR_TYPE] = str(result.status_code) + metric_labels[ERROR_TYPE] = str(result.status_code) if result.raw is not None: version = getattr(result.raw, "version", None) @@ -278,12 +274,8 @@ def get_or_create_headers(): response_hook(span, request, result) if exception is not None and _report_new(sem_conv_opt_in_mode): - span.set_attribute( - _SPAN_ATTRIBUTES_ERROR_TYPE, type(exception).__qualname__ - ) - metric_labels[_SPAN_ATTRIBUTES_ERROR_TYPE] = type( - exception - ).__qualname__ + span.set_attribute(ERROR_TYPE, type(exception).__qualname__) + metric_labels[ERROR_TYPE] = type(exception).__qualname__ if duration_histogram_old is not None: duration_attrs_old = _filter_semconv_duration_attrs( @@ -403,7 +395,7 @@ def _instrument(self, **kwargs): duration_histogram_new = None if _report_new(semconv_opt_in_mode): duration_histogram_new = meter.create_histogram( - name=_METRIC_ATTRIBUTES_CLIENT_DURATION_NAME, + name=HTTP_CLIENT_REQUEST_DURATION, unit="s", description="Duration of HTTP client requests.", ) diff --git a/instrumentation/opentelemetry-instrumentation-requests/tests/test_requests_integration.py b/instrumentation/opentelemetry-instrumentation-requests/tests/test_requests_integration.py index d85d70e20e..75518fc8d3 100644 --- a/instrumentation/opentelemetry-instrumentation-requests/tests/test_requests_integration.py +++ b/instrumentation/opentelemetry-instrumentation-requests/tests/test_requests_integration.py @@ -23,9 +23,6 @@ import opentelemetry.instrumentation.requests from opentelemetry import trace from opentelemetry.instrumentation._semconv import ( - _SPAN_ATTRIBUTES_ERROR_TYPE, - _SPAN_ATTRIBUTES_NETWORK_PEER_ADDRESS, - _SPAN_ATTRIBUTES_NETWORK_PEER_PORT, OTEL_SEMCONV_STABILITY_OPT_IN, _OpenTelemetrySemanticConventionStability, ) @@ -36,6 +33,21 @@ ) from opentelemetry.propagate import get_global_textmap, set_global_textmap from opentelemetry.sdk import resources +from opentelemetry.semconv.attributes.error_attributes import ERROR_TYPE +from opentelemetry.semconv.attributes.http_attributes import ( + HTTP_REQUEST_METHOD, + HTTP_RESPONSE_STATUS_CODE, +) +from opentelemetry.semconv.attributes.network_attributes import ( + NETWORK_PEER_ADDRESS, + NETWORK_PEER_PORT, + NETWORK_PROTOCOL_VERSION, +) +from opentelemetry.semconv.attributes.server_attributes import ( + SERVER_ADDRESS, + SERVER_PORT, +) +from opentelemetry.semconv.attributes.url_attributes import URL_FULL from opentelemetry.semconv.trace import SpanAttributes from opentelemetry.test.mock_textmap import MockTextMapPropagator from opentelemetry.test.test_base import TestBase @@ -176,14 +188,14 @@ def test_basic_new_semconv(self): self.assertEqual( span.attributes, { - SpanAttributes.HTTP_REQUEST_METHOD: "GET", - SpanAttributes.URL_FULL: url_with_port, - SpanAttributes.SERVER_ADDRESS: "mock", - _SPAN_ATTRIBUTES_NETWORK_PEER_ADDRESS: "mock", - SpanAttributes.HTTP_RESPONSE_STATUS_CODE: 200, - SpanAttributes.NETWORK_PROTOCOL_VERSION: "1.1", - SpanAttributes.SERVER_PORT: 80, - _SPAN_ATTRIBUTES_NETWORK_PEER_PORT: 80, + HTTP_REQUEST_METHOD: "GET", + URL_FULL: url_with_port, + SERVER_ADDRESS: "mock", + NETWORK_PEER_ADDRESS: "mock", + HTTP_RESPONSE_STATUS_CODE: 200, + NETWORK_PROTOCOL_VERSION: "1.1", + SERVER_PORT: 80, + NETWORK_PEER_PORT: 80, }, ) @@ -213,19 +225,19 @@ def test_basic_both_semconv(self): span.attributes, { SpanAttributes.HTTP_METHOD: "GET", - SpanAttributes.HTTP_REQUEST_METHOD: "GET", + HTTP_REQUEST_METHOD: "GET", SpanAttributes.HTTP_URL: url_with_port, - SpanAttributes.URL_FULL: url_with_port, + URL_FULL: url_with_port, SpanAttributes.HTTP_HOST: "mock", - SpanAttributes.SERVER_ADDRESS: "mock", - _SPAN_ATTRIBUTES_NETWORK_PEER_ADDRESS: "mock", + SERVER_ADDRESS: "mock", + NETWORK_PEER_ADDRESS: "mock", SpanAttributes.NET_PEER_PORT: 80, SpanAttributes.HTTP_STATUS_CODE: 200, - SpanAttributes.HTTP_RESPONSE_STATUS_CODE: 200, + HTTP_RESPONSE_STATUS_CODE: 200, SpanAttributes.HTTP_FLAVOR: "1.1", - SpanAttributes.NETWORK_PROTOCOL_VERSION: "1.1", - SpanAttributes.SERVER_PORT: 80, - _SPAN_ATTRIBUTES_NETWORK_PEER_PORT: 80, + NETWORK_PROTOCOL_VERSION: "1.1", + SERVER_PORT: 80, + NETWORK_PEER_PORT: 80, }, ) @@ -328,12 +340,8 @@ def test_not_foundbasic_new_semconv(self): span = self.assert_span() - self.assertEqual( - span.attributes.get(SpanAttributes.HTTP_RESPONSE_STATUS_CODE), 404 - ) - self.assertEqual( - span.attributes.get(_SPAN_ATTRIBUTES_ERROR_TYPE), "404" - ) + self.assertEqual(span.attributes.get(HTTP_RESPONSE_STATUS_CODE), 404) + self.assertEqual(span.attributes.get(ERROR_TYPE), "404") self.assertIs( span.status.status_code, @@ -355,12 +363,8 @@ def test_not_foundbasic_both_semconv(self): self.assertEqual( span.attributes.get(SpanAttributes.HTTP_STATUS_CODE), 404 ) - self.assertEqual( - span.attributes.get(SpanAttributes.HTTP_RESPONSE_STATUS_CODE), 404 - ) - self.assertEqual( - span.attributes.get(_SPAN_ATTRIBUTES_ERROR_TYPE), "404" - ) + self.assertEqual(span.attributes.get(HTTP_RESPONSE_STATUS_CODE), 404) + self.assertEqual(span.attributes.get(ERROR_TYPE), "404") self.assertIs( span.status.status_code, @@ -527,13 +531,13 @@ def test_requests_exception_new_semconv(self, *_, **__): self.assertEqual( span.attributes, { - SpanAttributes.HTTP_REQUEST_METHOD: "GET", - SpanAttributes.URL_FULL: url_with_port, - SpanAttributes.SERVER_ADDRESS: "mock", - SpanAttributes.SERVER_PORT: 80, - _SPAN_ATTRIBUTES_NETWORK_PEER_PORT: 80, - _SPAN_ATTRIBUTES_NETWORK_PEER_ADDRESS: "mock", - _SPAN_ATTRIBUTES_ERROR_TYPE: "RequestException", + HTTP_REQUEST_METHOD: "GET", + URL_FULL: url_with_port, + SERVER_ADDRESS: "mock", + SERVER_PORT: 80, + NETWORK_PEER_PORT: 80, + NETWORK_PEER_ADDRESS: "mock", + ERROR_TYPE: "RequestException", }, ) self.assertEqual(span.status.status_code, StatusCode.ERROR) @@ -724,11 +728,11 @@ def test_basic_metric_new_semconv(self): self.perform_request(self.URL) expected_attributes = { - SpanAttributes.HTTP_RESPONSE_STATUS_CODE: 200, - SpanAttributes.SERVER_ADDRESS: "examplehost", - SpanAttributes.SERVER_PORT: 8000, - SpanAttributes.HTTP_REQUEST_METHOD: "GET", - SpanAttributes.NETWORK_PROTOCOL_VERSION: "1.1", + HTTP_RESPONSE_STATUS_CODE: 200, + SERVER_ADDRESS: "examplehost", + SERVER_PORT: 8000, + HTTP_REQUEST_METHOD: "GET", + NETWORK_PROTOCOL_VERSION: "1.1", } for ( resource_metrics @@ -760,11 +764,11 @@ def test_basic_metric_both_semconv(self): } expected_attributes_new = { - SpanAttributes.HTTP_RESPONSE_STATUS_CODE: 200, - SpanAttributes.SERVER_ADDRESS: "examplehost", - SpanAttributes.SERVER_PORT: 8000, - SpanAttributes.HTTP_REQUEST_METHOD: "GET", - SpanAttributes.NETWORK_PROTOCOL_VERSION: "1.1", + HTTP_RESPONSE_STATUS_CODE: 200, + SERVER_ADDRESS: "examplehost", + SERVER_PORT: 8000, + HTTP_REQUEST_METHOD: "GET", + NETWORK_PROTOCOL_VERSION: "1.1", } for ( 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 810a07e315..6a1883fa7e 100644 --- a/instrumentation/opentelemetry-instrumentation-wsgi/src/opentelemetry/instrumentation/wsgi/__init__.py +++ b/instrumentation/opentelemetry-instrumentation-wsgi/src/opentelemetry/instrumentation/wsgi/__init__.py @@ -214,8 +214,6 @@ def response_hook(span: Span, environ: WSGIEnvironment, status: str, response_he from opentelemetry import context, trace from opentelemetry.instrumentation._semconv import ( - _METRIC_ATTRIBUTES_SERVER_DURATION_NAME, - _SPAN_ATTRIBUTES_ERROR_TYPE, _filter_semconv_active_request_count_attr, _filter_semconv_duration_attrs, _get_schema_url, @@ -244,7 +242,11 @@ def response_hook(span: Span, environ: WSGIEnvironment, status: str, response_he from opentelemetry.instrumentation.wsgi.version import __version__ from opentelemetry.metrics import get_meter from opentelemetry.propagators.textmap import Getter +from opentelemetry.semconv.attributes.error_attributes import ERROR_TYPE from opentelemetry.semconv.metrics import MetricInstruments +from opentelemetry.semconv.metrics.http_metrics import ( + HTTP_SERVER_REQUEST_DURATION, +) from opentelemetry.semconv.trace import SpanAttributes from opentelemetry.trace.status import Status, StatusCode from opentelemetry.util.http import ( @@ -573,7 +575,7 @@ def __init__( self.duration_histogram_new = None if _report_new(sem_conv_opt_in_mode): self.duration_histogram_new = self.meter.create_histogram( - name=_METRIC_ATTRIBUTES_SERVER_DURATION_NAME, + name=HTTP_SERVER_REQUEST_DURATION, unit="s", description="measures the duration of the inbound HTTP request", ) @@ -670,11 +672,9 @@ def __call__(self, environ, start_response): return _end_span_after_iterating(iterable, span, token) except Exception as ex: if _report_new(self._sem_conv_opt_in_mode): - req_attrs[_SPAN_ATTRIBUTES_ERROR_TYPE] = type(ex).__qualname__ + req_attrs[ERROR_TYPE] = type(ex).__qualname__ if span.is_recording(): - span.set_attribute( - _SPAN_ATTRIBUTES_ERROR_TYPE, type(ex).__qualname__ - ) + span.set_attribute(ERROR_TYPE, type(ex).__qualname__) span.set_status(Status(StatusCode.ERROR, str(ex))) span.end() if token is not None: diff --git a/instrumentation/opentelemetry-instrumentation-wsgi/tests/test_wsgi_middleware.py b/instrumentation/opentelemetry-instrumentation-wsgi/tests/test_wsgi_middleware.py index 2b26cbb5f9..777d19f41d 100644 --- a/instrumentation/opentelemetry-instrumentation-wsgi/tests/test_wsgi_middleware.py +++ b/instrumentation/opentelemetry-instrumentation-wsgi/tests/test_wsgi_middleware.py @@ -36,6 +36,23 @@ NumberDataPoint, ) from opentelemetry.sdk.resources import Resource +from opentelemetry.semconv.attributes.http_attributes import ( + HTTP_REQUEST_METHOD, + HTTP_RESPONSE_STATUS_CODE, +) +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.url_attributes import ( + URL_FULL, + URL_PATH, + URL_QUERY, + URL_SCHEME, +) from opentelemetry.semconv.trace import SpanAttributes from opentelemetry.test.test_base import TestBase from opentelemetry.test.wsgitestutil import WsgiTestBase @@ -237,11 +254,11 @@ def validate_response( SpanAttributes.NET_HOST_NAME: "127.0.0.1", } expected_attributes_new = { - SpanAttributes.SERVER_PORT: 80, - SpanAttributes.SERVER_ADDRESS: "127.0.0.1", - SpanAttributes.NETWORK_PROTOCOL_VERSION: "1.0", - SpanAttributes.HTTP_RESPONSE_STATUS_CODE: 200, - SpanAttributes.URL_SCHEME: "http", + SERVER_PORT: 80, + SERVER_ADDRESS: "127.0.0.1", + NETWORK_PROTOCOL_VERSION: "1.0", + HTTP_RESPONSE_STATUS_CODE: 200, + URL_SCHEME: "http", } if old_sem_conv: expected_attributes.update(expected_attributes_old) @@ -253,9 +270,7 @@ def validate_response( if old_sem_conv: expected_attributes[SpanAttributes.HTTP_METHOD] = http_method if new_sem_conv: - expected_attributes[SpanAttributes.HTTP_REQUEST_METHOD] = ( - http_method - ) + expected_attributes[HTTP_REQUEST_METHOD] = http_method self.assertEqual(span_list[0].attributes, expected_attributes) def test_basic_wsgi_call(self): @@ -517,13 +532,13 @@ def test_request_attributes_new_semconv(self): self.assertDictEqual( attrs, { - SpanAttributes.HTTP_REQUEST_METHOD: "GET", - SpanAttributes.SERVER_ADDRESS: "127.0.0.1", - SpanAttributes.SERVER_PORT: 80, - SpanAttributes.NETWORK_PROTOCOL_VERSION: "1.0", - SpanAttributes.URL_PATH: "/", - SpanAttributes.URL_QUERY: "foo=bar", - SpanAttributes.URL_SCHEME: "http", + HTTP_REQUEST_METHOD: "GET", + SERVER_ADDRESS: "127.0.0.1", + SERVER_PORT: 80, + NETWORK_PROTOCOL_VERSION: "1.0", + URL_PATH: "/", + URL_QUERY: "foo=bar", + URL_SCHEME: "http", }, ) @@ -543,11 +558,10 @@ def validate_url( SpanAttributes.HTTP_SERVER_NAME: parts.hostname, # Not true in the general case, but for all tests. } expected_new = { - SpanAttributes.SERVER_PORT: parts.port - or (80 if parts.scheme == "http" else 443), - SpanAttributes.SERVER_ADDRESS: parts.hostname, - SpanAttributes.URL_PATH: parts.path, - SpanAttributes.URL_QUERY: parts.query, + SERVER_PORT: parts.port or (80 if parts.scheme == "http" else 443), + SERVER_ADDRESS: parts.hostname, + URL_PATH: parts.path, + URL_QUERY: parts.query, } if old_semconv: if raw: @@ -560,17 +574,15 @@ def validate_url( expected_old[SpanAttributes.HTTP_HOST] = parts.hostname if new_semconv: if raw: - expected_new[SpanAttributes.URL_PATH] = expected_url.split( - parts.path, 1 - )[1] + expected_new[URL_PATH] = expected_url.split(parts.path, 1)[1] if parts.query: - expected_new[SpanAttributes.URL_QUERY] = ( - expected_url.split(parts.query, 1)[1] - ) + expected_new[URL_QUERY] = expected_url.split( + parts.query, 1 + )[1] else: - expected_new[SpanAttributes.HTTP_URL] = expected_url + expected_new[URL_FULL] = expected_url if has_host: - expected_new[SpanAttributes.SERVER_ADDRESS] = parts.hostname + expected_new[SERVER_ADDRESS] = parts.hostname attrs = otel_wsgi.collect_request_attributes(self.environ) self.assertGreaterEqual( @@ -720,8 +732,8 @@ def test_request_attributes_with_full_request_uri(self): SpanAttributes.HTTP_TARGET: "http://docs.python.org:80/3/library/urllib.parse.html?highlight=params#url-parsing", } expected_new = { - SpanAttributes.URL_PATH: "/3/library/urllib.parse.html", - SpanAttributes.URL_QUERY: "highlight=params", + URL_PATH: "/3/library/urllib.parse.html", + URL_QUERY: "highlight=params", } self.assertGreaterEqual( otel_wsgi.collect_request_attributes(self.environ).items(), diff --git a/opentelemetry-instrumentation/src/opentelemetry/instrumentation/_semconv.py b/opentelemetry-instrumentation/src/opentelemetry/instrumentation/_semconv.py index efe3c75f70..baa06ff99b 100644 --- a/opentelemetry-instrumentation/src/opentelemetry/instrumentation/_semconv.py +++ b/opentelemetry-instrumentation/src/opentelemetry/instrumentation/_semconv.py @@ -17,16 +17,27 @@ from enum import Enum from opentelemetry.instrumentation.utils import http_status_to_status_code +from opentelemetry.semconv.attributes.error_attributes import ERROR_TYPE +from opentelemetry.semconv.attributes.http_attributes import ( + HTTP_REQUEST_METHOD, + HTTP_REQUEST_METHOD_ORIGINAL, + HTTP_RESPONSE_STATUS_CODE, + HTTP_ROUTE, +) +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.url_attributes import ( + URL_FULL, + URL_SCHEME, +) from opentelemetry.semconv.trace import SpanAttributes from opentelemetry.trace.status import Status, StatusCode -# TODO: will come through semconv package once updated -_SPAN_ATTRIBUTES_ERROR_TYPE = "error.type" -_SPAN_ATTRIBUTES_NETWORK_PEER_ADDRESS = "network.peer.address" -_SPAN_ATTRIBUTES_NETWORK_PEER_PORT = "network.peer.port" -_METRIC_ATTRIBUTES_CLIENT_DURATION_NAME = "http.client.request.duration" -_METRIC_ATTRIBUTES_SERVER_DURATION_NAME = "http.server.request.duration" - _client_duration_attrs_old = [ SpanAttributes.HTTP_STATUS_CODE, SpanAttributes.HTTP_HOST, @@ -38,14 +49,14 @@ ] _client_duration_attrs_new = [ - _SPAN_ATTRIBUTES_ERROR_TYPE, - SpanAttributes.HTTP_REQUEST_METHOD, - SpanAttributes.HTTP_RESPONSE_STATUS_CODE, - SpanAttributes.NETWORK_PROTOCOL_VERSION, - SpanAttributes.SERVER_ADDRESS, - SpanAttributes.SERVER_PORT, + ERROR_TYPE, + HTTP_REQUEST_METHOD, + HTTP_RESPONSE_STATUS_CODE, + NETWORK_PROTOCOL_VERSION, + SERVER_ADDRESS, + SERVER_PORT, # TODO: Support opt-in for scheme in new semconv - # SpanAttributes.URL_SCHEME, + # URL_SCHEME, ] _server_duration_attrs_old = [ @@ -60,12 +71,12 @@ ] _server_duration_attrs_new = [ - _SPAN_ATTRIBUTES_ERROR_TYPE, - SpanAttributes.HTTP_REQUEST_METHOD, - SpanAttributes.HTTP_RESPONSE_STATUS_CODE, - SpanAttributes.HTTP_ROUTE, - SpanAttributes.NETWORK_PROTOCOL_VERSION, - SpanAttributes.URL_SCHEME, + ERROR_TYPE, + HTTP_REQUEST_METHOD, + HTTP_RESPONSE_STATUS_CODE, + HTTP_ROUTE, + NETWORK_PROTOCOL_VERSION, + URL_SCHEME, ] _server_active_requests_count_attrs_old = [ @@ -79,8 +90,8 @@ ] _server_active_requests_count_attrs_new = [ - SpanAttributes.HTTP_REQUEST_METHOD, - SpanAttributes.URL_SCHEME, + HTTP_REQUEST_METHOD, + URL_SCHEME, ] OTEL_SEMCONV_STABILITY_OPT_IN = "OTEL_SEMCONV_STABILITY_OPT_IN" @@ -202,46 +213,40 @@ def _set_http_method(result, original, normalized, sem_conv_opt_in_mode): # See https://github.com/open-telemetry/semantic-conventions/blob/main/docs/http/http-spans.md#common-attributes # Method is case sensitive. "http.request.method_original" should not be sanitized or automatically capitalized. if original != normalized and _report_new(sem_conv_opt_in_mode): - set_string_attribute( - result, SpanAttributes.HTTP_REQUEST_METHOD_ORIGINAL, original - ) + set_string_attribute(result, HTTP_REQUEST_METHOD_ORIGINAL, original) if _report_old(sem_conv_opt_in_mode): set_string_attribute(result, SpanAttributes.HTTP_METHOD, normalized) if _report_new(sem_conv_opt_in_mode): - set_string_attribute( - result, SpanAttributes.HTTP_REQUEST_METHOD, normalized - ) + set_string_attribute(result, HTTP_REQUEST_METHOD, normalized) def _set_http_status_code(result, code, sem_conv_opt_in_mode): if _report_old(sem_conv_opt_in_mode): set_int_attribute(result, SpanAttributes.HTTP_STATUS_CODE, code) if _report_new(sem_conv_opt_in_mode): - set_int_attribute( - result, SpanAttributes.HTTP_RESPONSE_STATUS_CODE, code - ) + set_int_attribute(result, HTTP_RESPONSE_STATUS_CODE, code) def _set_http_url(result, url, sem_conv_opt_in_mode): if _report_old(sem_conv_opt_in_mode): set_string_attribute(result, SpanAttributes.HTTP_URL, url) if _report_new(sem_conv_opt_in_mode): - set_string_attribute(result, SpanAttributes.URL_FULL, url) + set_string_attribute(result, URL_FULL, url) def _set_http_scheme(result, scheme, sem_conv_opt_in_mode): if _report_old(sem_conv_opt_in_mode): set_string_attribute(result, SpanAttributes.HTTP_SCHEME, scheme) if _report_new(sem_conv_opt_in_mode): - set_string_attribute(result, SpanAttributes.URL_SCHEME, scheme) + set_string_attribute(result, URL_SCHEME, scheme) def _set_http_host(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, SpanAttributes.SERVER_ADDRESS, host) + set_string_attribute(result, SERVER_ADDRESS, host) # Client @@ -251,23 +256,21 @@ 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) if _report_new(sem_conv_opt_in_mode): - set_string_attribute(result, SpanAttributes.SERVER_ADDRESS, peer_name) + set_string_attribute(result, SERVER_ADDRESS, peer_name) def _set_http_peer_port_client(result, port, sem_conv_opt_in_mode): if _report_old(sem_conv_opt_in_mode): set_int_attribute(result, SpanAttributes.NET_PEER_PORT, port) if _report_new(sem_conv_opt_in_mode): - set_int_attribute(result, SpanAttributes.SERVER_PORT, port) + set_int_attribute(result, SERVER_PORT, port) def _set_http_network_protocol_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, SpanAttributes.NETWORK_PROTOCOL_VERSION, version - ) + set_string_attribute(result, NETWORK_PROTOCOL_VERSION, version) # Server @@ -347,8 +350,8 @@ def _set_status( ): if status_code < 0: if _report_new(sem_conv_opt_in_mode): - span.set_attribute(_SPAN_ATTRIBUTES_ERROR_TYPE, status_code_str) - metrics_attributes[_SPAN_ATTRIBUTES_ERROR_TYPE] = status_code_str + span.set_attribute(ERROR_TYPE, status_code_str) + metrics_attributes[ERROR_TYPE] = status_code_str span.set_status( Status( @@ -370,12 +373,8 @@ def _set_status( status_code ) if status == StatusCode.ERROR: - span.set_attribute( - _SPAN_ATTRIBUTES_ERROR_TYPE, status_code_str - ) - metrics_attributes[_SPAN_ATTRIBUTES_ERROR_TYPE] = ( - status_code_str - ) + span.set_attribute(ERROR_TYPE, status_code_str) + metrics_attributes[ERROR_TYPE] = status_code_str span.set_status(Status(status))