From d69fe1440225c2b908660d18c5381a94eb67f7db Mon Sep 17 00:00:00 2001 From: Adrian Garcia Badaracco <1755071+adriangb@users.noreply.github.com> Date: Tue, 27 Jul 2021 13:33:19 -0500 Subject: [PATCH 1/6] Make Falcon instrumentation compatible with Falcon >=3 Replace falcon.api.Request -> falcon.Request which exists on both Falcon 2 & 3 --- .../src/opentelemetry/instrumentation/falcon/__init__.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/instrumentation/opentelemetry-instrumentation-falcon/src/opentelemetry/instrumentation/falcon/__init__.py b/instrumentation/opentelemetry-instrumentation-falcon/src/opentelemetry/instrumentation/falcon/__init__.py index 2d4992072c..8d05ea73b3 100644 --- a/instrumentation/opentelemetry-instrumentation-falcon/src/opentelemetry/instrumentation/falcon/__init__.py +++ b/instrumentation/opentelemetry-instrumentation-falcon/src/opentelemetry/instrumentation/falcon/__init__.py @@ -126,7 +126,7 @@ def response_hook(span, req, resp): _excluded_urls = get_excluded_urls("FALCON") _traced_request_attrs = get_traced_request_attrs("FALCON") -_response_propagation_setter = FuncSetter(falcon.api.Response.append_header) +_response_propagation_setter = FuncSetter(falcon.Response.append_header) class FalconInstrumentor(BaseInstrumentor): From 3609d8ed6223d7d2461bb159fd6cac867ea1a291 Mon Sep 17 00:00:00 2001 From: Adrian Garcia Badaracco <1755071+adriangb@users.noreply.github.com> Date: Fri, 30 Jul 2021 23:04:07 -0500 Subject: [PATCH 2/6] Update package.py --- .../src/opentelemetry/instrumentation/falcon/package.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/instrumentation/opentelemetry-instrumentation-falcon/src/opentelemetry/instrumentation/falcon/package.py b/instrumentation/opentelemetry-instrumentation-falcon/src/opentelemetry/instrumentation/falcon/package.py index 7e554264ff..278b8f9a1a 100644 --- a/instrumentation/opentelemetry-instrumentation-falcon/src/opentelemetry/instrumentation/falcon/package.py +++ b/instrumentation/opentelemetry-instrumentation-falcon/src/opentelemetry/instrumentation/falcon/package.py @@ -13,4 +13,4 @@ # limitations under the License. -_instruments = ("falcon ~= 2.0",) +_instruments = ("falcon ~= 2.0", "falcon ~= 3.0") From 96cabaed4282841625323038274db5e565a0c45e Mon Sep 17 00:00:00 2001 From: Adrian Garcia Badaracco <1755071+adriangb@users.noreply.github.com> Date: Fri, 30 Jul 2021 23:06:43 -0500 Subject: [PATCH 3/6] Update CHANGELOG.md --- CHANGELOG.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index c332cda6d8..6a7f24f2ff 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 ([#595](https://github.com/open-telemetry/opentelemetry-python-contrib/pull/595)) ### Changed +- `opentelemetry-instrumentation-falcon` added support for Falcon 3. + ([#607](https://github.com/open-telemetry/opentelemetry-python-contrib/pull/607)) - `opentelemetry-instrumentation-tornado` properly instrument work done in tornado on_finish method. ([#499](https://github.com/open-telemetry/opentelemetry-python-contrib/pull/499)) - `opentelemetry-instrumentation` Fixed cases where trying to use an instrumentation package without the From 73b5ff9dc643ed3532ff850e1d08c6bc1467cd7e Mon Sep 17 00:00:00 2001 From: Adrian Garcia Badaracco <1755071+adriangb@users.noreply.github.com> Date: Mon, 2 Aug 2021 10:29:11 -0500 Subject: [PATCH 4/6] update tox.ini --- tox.ini | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/tox.ini b/tox.ini index 2d58b8928e..ab578ee486 100644 --- a/tox.ini +++ b/tox.ini @@ -38,8 +38,8 @@ envlist = pypy3-test-instrumentation-elasticsearch{2,5,6,7} ; opentelemetry-instrumentation-falcon - py3{4,5,6,7,8,9}-test-instrumentation-falcon - pypy3-test-instrumentation-falcon + py3{4,5,6,7,8,9}-test-instrumentation-falcon{2,3} + pypy3-test-instrumentation-falcon{2,3} ; opentelemetry-instrumentation-fastapi ; fastapi only supports 3.6 and above. @@ -173,6 +173,8 @@ deps = elasticsearch6: elasticsearch>=6.0,<7.0 elasticsearch7: elasticsearch-dsl>=7.0,<8.0 elasticsearch7: elasticsearch>=7.0,<8.0 + falcon2: falcon >=2.0.0,<3.0.0 + falcon3: falcon >=3.0.0,<4.0.0 ; FIXME: add coverage testing ; FIXME: add mypy testing @@ -188,7 +190,7 @@ changedir = test-instrumentation-dbapi: instrumentation/opentelemetry-instrumentation-dbapi/tests test-instrumentation-django: instrumentation/opentelemetry-instrumentation-django/tests test-instrumentation-elasticsearch{2,5,6,7}: instrumentation/opentelemetry-instrumentation-elasticsearch/tests - test-instrumentation-falcon: instrumentation/opentelemetry-instrumentation-falcon/tests + test-instrumentation-falcon{2,3}: instrumentation/opentelemetry-instrumentation-falcon/tests test-instrumentation-fastapi: instrumentation/opentelemetry-instrumentation-fastapi/tests test-instrumentation-flask: instrumentation/opentelemetry-instrumentation-flask/tests test-instrumentation-urllib: instrumentation/opentelemetry-instrumentation-urllib/tests @@ -240,7 +242,7 @@ commands_pre = boto: pip install {toxinidir}/instrumentation/opentelemetry-instrumentation-botocore[test] boto: pip install {toxinidir}/instrumentation/opentelemetry-instrumentation-boto[test] - falcon: pip install {toxinidir}/instrumentation/opentelemetry-instrumentation-falcon[test] + falcon{2,3}: pip install {toxinidir}/instrumentation/opentelemetry-instrumentation-falcon[test] flask: pip install {toxinidir}/instrumentation/opentelemetry-instrumentation-flask[test] From b580ab0c6a1d55e9a731c9a1132218da43974b8d Mon Sep 17 00:00:00 2001 From: Adrian Garcia Badaracco <1755071+adriangb@users.noreply.github.com> Date: Mon, 2 Aug 2021 14:19:05 -0500 Subject: [PATCH 5/6] revert changes to tox.ini to test failures --- tox.ini | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/tox.ini b/tox.ini index ab578ee486..2d58b8928e 100644 --- a/tox.ini +++ b/tox.ini @@ -38,8 +38,8 @@ envlist = pypy3-test-instrumentation-elasticsearch{2,5,6,7} ; opentelemetry-instrumentation-falcon - py3{4,5,6,7,8,9}-test-instrumentation-falcon{2,3} - pypy3-test-instrumentation-falcon{2,3} + py3{4,5,6,7,8,9}-test-instrumentation-falcon + pypy3-test-instrumentation-falcon ; opentelemetry-instrumentation-fastapi ; fastapi only supports 3.6 and above. @@ -173,8 +173,6 @@ deps = elasticsearch6: elasticsearch>=6.0,<7.0 elasticsearch7: elasticsearch-dsl>=7.0,<8.0 elasticsearch7: elasticsearch>=7.0,<8.0 - falcon2: falcon >=2.0.0,<3.0.0 - falcon3: falcon >=3.0.0,<4.0.0 ; FIXME: add coverage testing ; FIXME: add mypy testing @@ -190,7 +188,7 @@ changedir = test-instrumentation-dbapi: instrumentation/opentelemetry-instrumentation-dbapi/tests test-instrumentation-django: instrumentation/opentelemetry-instrumentation-django/tests test-instrumentation-elasticsearch{2,5,6,7}: instrumentation/opentelemetry-instrumentation-elasticsearch/tests - test-instrumentation-falcon{2,3}: instrumentation/opentelemetry-instrumentation-falcon/tests + test-instrumentation-falcon: instrumentation/opentelemetry-instrumentation-falcon/tests test-instrumentation-fastapi: instrumentation/opentelemetry-instrumentation-fastapi/tests test-instrumentation-flask: instrumentation/opentelemetry-instrumentation-flask/tests test-instrumentation-urllib: instrumentation/opentelemetry-instrumentation-urllib/tests @@ -242,7 +240,7 @@ commands_pre = boto: pip install {toxinidir}/instrumentation/opentelemetry-instrumentation-botocore[test] boto: pip install {toxinidir}/instrumentation/opentelemetry-instrumentation-boto[test] - falcon{2,3}: pip install {toxinidir}/instrumentation/opentelemetry-instrumentation-falcon[test] + falcon: pip install {toxinidir}/instrumentation/opentelemetry-instrumentation-falcon[test] flask: pip install {toxinidir}/instrumentation/opentelemetry-instrumentation-flask[test] From aa5d256715ff4d8b7524ca5f89da3ba32ad526d8 Mon Sep 17 00:00:00 2001 From: Adrian Garcia Badaracco <1755071+adriangb@users.noreply.github.com> Date: Tue, 3 Aug 2021 14:46:08 -0500 Subject: [PATCH 6/6] Update package.py --- .../src/opentelemetry/instrumentation/falcon/package.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/instrumentation/opentelemetry-instrumentation-falcon/src/opentelemetry/instrumentation/falcon/package.py b/instrumentation/opentelemetry-instrumentation-falcon/src/opentelemetry/instrumentation/falcon/package.py index 278b8f9a1a..7e554264ff 100644 --- a/instrumentation/opentelemetry-instrumentation-falcon/src/opentelemetry/instrumentation/falcon/package.py +++ b/instrumentation/opentelemetry-instrumentation-falcon/src/opentelemetry/instrumentation/falcon/package.py @@ -13,4 +13,4 @@ # limitations under the License. -_instruments = ("falcon ~= 2.0", "falcon ~= 3.0") +_instruments = ("falcon ~= 2.0",)