From 40018e00e0fc0a4e9b82c1a91011b1eece097485 Mon Sep 17 00:00:00 2001 From: Miguel Alexandre Date: Fri, 25 Nov 2022 18:03:58 +0100 Subject: [PATCH 1/7] Instrument newer confluent-kafka versions Signed-off-by: Miguel Alexandre --- .../pyproject.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/instrumentation/opentelemetry-instrumentation-confluent-kafka/pyproject.toml b/instrumentation/opentelemetry-instrumentation-confluent-kafka/pyproject.toml index 43b640fd1e..a84f7d959e 100644 --- a/instrumentation/opentelemetry-instrumentation-confluent-kafka/pyproject.toml +++ b/instrumentation/opentelemetry-instrumentation-confluent-kafka/pyproject.toml @@ -31,7 +31,7 @@ dependencies = [ [project.optional-dependencies] instruments = [ - "confluent-kafka ~= 1.8.2", + "confluent-kafka >= 1.8.2, < 2.0.0", ] test = [ "opentelemetry-instrumentation-confluent-kafka[instruments]", From 62d9249a2bf99270c98597b53ec7fba33d5fcc1b Mon Sep 17 00:00:00 2001 From: Miguel Alexandre Date: Fri, 25 Nov 2022 18:04:07 +0100 Subject: [PATCH 2/7] Add testing commands to tox Signed-off-by: Miguel Alexandre --- tox.ini | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/tox.ini b/tox.ini index f61540b7c4..69f55391e5 100644 --- a/tox.ini +++ b/tox.ini @@ -207,6 +207,10 @@ envlist = py3{7,8,9,10,11}-test-instrumentation-kafka-python pypy3-test-instrumentation-kafka-python + ; opentelemetry-instrumentation-confluent-kafka + py3{7,8,9,10,11}-test-instrumentation-confluent-kafka + pypy3-test-instrumentation-confluent-kafka + lint spellcheck docker-tests @@ -284,6 +288,7 @@ changedir = test-instrumentation-grpc: instrumentation/opentelemetry-instrumentation-grpc/tests test-instrumentation-jinja2: instrumentation/opentelemetry-instrumentation-jinja2/tests test-instrumentation-kafka-python: instrumentation/opentelemetry-instrumentation-kafka-python/tests + test-instrumentation-confluent-kafka: instrumentation/opentelemetry-instrumentation-confluent-kafka/tests test-instrumentation-logging: instrumentation/opentelemetry-instrumentation-logging/tests test-instrumentation-mysql: instrumentation/opentelemetry-instrumentation-mysql/tests test-instrumentation-pika{0,1}: instrumentation/opentelemetry-instrumentation-pika/tests @@ -330,6 +335,8 @@ commands_pre = kafka-python: pip install {toxinidir}/instrumentation/opentelemetry-instrumentation-kafka-python[test] + confluent-kafka: pip install {toxinidir}/instrumentation/opentelemetry-instrumentation-confluent-kafka[test] + grpc: pip install {toxinidir}/instrumentation/opentelemetry-instrumentation-grpc[test] falcon{1,2,3},flask,django{1,2,3,4},pyramid,tornado,starlette,fastapi,aiohttp,asgi,requests,urllib,urllib3,wsgi: pip install {toxinidir}/util/opentelemetry-util-http[test] @@ -492,6 +499,7 @@ commands_pre = python -m pip install -e {toxinidir}/instrumentation/opentelemetry-instrumentation-fastapi[test] python -m pip install -e {toxinidir}/instrumentation/opentelemetry-instrumentation-jinja2[test] python -m pip install -e {toxinidir}/instrumentation/opentelemetry-instrumentation-kafka-python[test] + python -m pip install -e {toxinidir}/instrumentation/opentelemetry-instrumentation-confluent-kafka[test] python -m pip install -e {toxinidir}/instrumentation/opentelemetry-instrumentation-logging[test] python -m pip install -e {toxinidir}/instrumentation/opentelemetry-instrumentation-pymemcache[test] python -m pip install -e {toxinidir}/instrumentation/opentelemetry-instrumentation-psycopg2[test] @@ -556,6 +564,7 @@ commands_pre = -e {toxinidir}/instrumentation/opentelemetry-instrumentation-celery \ -e {toxinidir}/instrumentation/opentelemetry-instrumentation-pika \ -e {toxinidir}/instrumentation/opentelemetry-instrumentation-kafka-python \ + -e {toxinidir}/instrumentation/opentelemetry-instrumentation-confluent-kafka \ -e {toxinidir}/instrumentation/opentelemetry-instrumentation-dbapi \ -e {toxinidir}/instrumentation/opentelemetry-instrumentation-mysql \ -e {toxinidir}/instrumentation/opentelemetry-instrumentation-psycopg2 \ From c30cf67306c1deb8f1f03e18e42e2be17f99addb Mon Sep 17 00:00:00 2001 From: Miguel Alexandre Date: Fri, 25 Nov 2022 18:07:30 +0100 Subject: [PATCH 3/7] Add changelog Signed-off-by: Miguel Alexandre --- CHANGELOG.md | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index f336be0cba..bbf0b88bff 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -28,6 +28,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ([#1409](https://github.com/open-telemetry/opentelemetry-python-contrib/pull/1409)) - Strip leading comments from SQL queries when generating the span name. ([#1434](https://github.com/open-telemetry/opentelemetry-python-contrib/pull/1434)) +- `opentelemetry-instrumentation-confluent-kafka` Add support for the latest versions of the library. ### Fixed From 7333fa21712e7a5ce939b9fa0f5b8fa5a9cb2c32 Mon Sep 17 00:00:00 2001 From: Miguel Alexandre Date: Fri, 25 Nov 2022 18:08:43 +0100 Subject: [PATCH 4/7] Update README Signed-off-by: Miguel Alexandre --- instrumentation/README.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/instrumentation/README.md b/instrumentation/README.md index d5ef42954c..aa73a09ac6 100644 --- a/instrumentation/README.md +++ b/instrumentation/README.md @@ -11,7 +11,7 @@ | [opentelemetry-instrumentation-boto3sqs](./opentelemetry-instrumentation-boto3sqs) | boto3 ~= 1.0 | No | [opentelemetry-instrumentation-botocore](./opentelemetry-instrumentation-botocore) | botocore ~= 1.0 | No | [opentelemetry-instrumentation-celery](./opentelemetry-instrumentation-celery) | celery >= 4.0, < 6.0 | No -| [opentelemetry-instrumentation-confluent-kafka](./opentelemetry-instrumentation-confluent-kafka) | confluent-kafka ~= 1.8.2 | No +| [opentelemetry-instrumentation-confluent-kafka](./opentelemetry-instrumentation-confluent-kafka) | confluent-kafka >= 1.8.2, < 2.0.0 | No | [opentelemetry-instrumentation-dbapi](./opentelemetry-instrumentation-dbapi) | dbapi | No | [opentelemetry-instrumentation-django](./opentelemetry-instrumentation-django) | django >= 1.10 | Yes | [opentelemetry-instrumentation-elasticsearch](./opentelemetry-instrumentation-elasticsearch) | elasticsearch >= 2.0 | No @@ -42,4 +42,4 @@ | [opentelemetry-instrumentation-tortoiseorm](./opentelemetry-instrumentation-tortoiseorm) | tortoise-orm >= 0.17.0 | No | [opentelemetry-instrumentation-urllib](./opentelemetry-instrumentation-urllib) | urllib | No | [opentelemetry-instrumentation-urllib3](./opentelemetry-instrumentation-urllib3) | urllib3 >= 1.0.0, < 2.0.0 | Yes -| [opentelemetry-instrumentation-wsgi](./opentelemetry-instrumentation-wsgi) | wsgi | Yes \ No newline at end of file +| [opentelemetry-instrumentation-wsgi](./opentelemetry-instrumentation-wsgi) | wsgi | Yes From 103cde614e090907bb23ae7c3c4df217682fac8a Mon Sep 17 00:00:00 2001 From: Miguel Alexandre Date: Mon, 28 Nov 2022 14:59:54 +0100 Subject: [PATCH 5/7] Add link to changelog Signed-off-by: Miguel Alexandre --- CHANGELOG.md | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index bbf0b88bff..59ed8913cb 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -29,6 +29,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 - Strip leading comments from SQL queries when generating the span name. ([#1434](https://github.com/open-telemetry/opentelemetry-python-contrib/pull/1434)) - `opentelemetry-instrumentation-confluent-kafka` Add support for the latest versions of the library. + ([#1468](https://github.com/open-telemetry/opentelemetry-python-contrib/pull/1468)) ### Fixed From 1bec75f8d0ca688a7ece9084afa2fb3675f541e8 Mon Sep 17 00:00:00 2001 From: Miguel Alexandre Date: Mon, 28 Nov 2022 15:28:41 +0100 Subject: [PATCH 6/7] Run the code generator Signed-off-by: Miguel Alexandre --- instrumentation/README.md | 2 +- .../opentelemetry/instrumentation/confluent_kafka/package.py | 2 +- .../src/opentelemetry/instrumentation/bootstrap_gen.py | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/instrumentation/README.md b/instrumentation/README.md index aa73a09ac6..0439bc1cae 100644 --- a/instrumentation/README.md +++ b/instrumentation/README.md @@ -42,4 +42,4 @@ | [opentelemetry-instrumentation-tortoiseorm](./opentelemetry-instrumentation-tortoiseorm) | tortoise-orm >= 0.17.0 | No | [opentelemetry-instrumentation-urllib](./opentelemetry-instrumentation-urllib) | urllib | No | [opentelemetry-instrumentation-urllib3](./opentelemetry-instrumentation-urllib3) | urllib3 >= 1.0.0, < 2.0.0 | Yes -| [opentelemetry-instrumentation-wsgi](./opentelemetry-instrumentation-wsgi) | wsgi | Yes +| [opentelemetry-instrumentation-wsgi](./opentelemetry-instrumentation-wsgi) | wsgi | Yes \ No newline at end of file diff --git a/instrumentation/opentelemetry-instrumentation-confluent-kafka/src/opentelemetry/instrumentation/confluent_kafka/package.py b/instrumentation/opentelemetry-instrumentation-confluent-kafka/src/opentelemetry/instrumentation/confluent_kafka/package.py index dbe3ac484b..eab664d9ee 100644 --- a/instrumentation/opentelemetry-instrumentation-confluent-kafka/src/opentelemetry/instrumentation/confluent_kafka/package.py +++ b/instrumentation/opentelemetry-instrumentation-confluent-kafka/src/opentelemetry/instrumentation/confluent_kafka/package.py @@ -13,4 +13,4 @@ # limitations under the License. -_instruments = ("confluent-kafka ~= 1.8.2",) +_instruments = ("confluent-kafka >= 1.8.2, < 2.0.0",) diff --git a/opentelemetry-instrumentation/src/opentelemetry/instrumentation/bootstrap_gen.py b/opentelemetry-instrumentation/src/opentelemetry/instrumentation/bootstrap_gen.py index e3564ba189..32c96a9e2c 100644 --- a/opentelemetry-instrumentation/src/opentelemetry/instrumentation/bootstrap_gen.py +++ b/opentelemetry-instrumentation/src/opentelemetry/instrumentation/bootstrap_gen.py @@ -53,7 +53,7 @@ "instrumentation": "opentelemetry-instrumentation-celery==0.36b0.dev", }, "confluent-kafka": { - "library": "confluent-kafka ~= 1.8.2", + "library": "confluent-kafka >= 1.8.2, < 2.0.0", "instrumentation": "opentelemetry-instrumentation-confluent-kafka==0.36b0.dev", }, "django": { From 84ac77ccb6e5d0a6e524c945c63f225b94f07e25 Mon Sep 17 00:00:00 2001 From: Miguel Alexandre Date: Mon, 5 Dec 2022 10:29:09 +0100 Subject: [PATCH 7/7] Disable tests for 3.11 and pypy Signed-off-by: Miguel Alexandre --- tox.ini | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tox.ini b/tox.ini index 69f55391e5..4cd6fa02f5 100644 --- a/tox.ini +++ b/tox.ini @@ -208,8 +208,8 @@ envlist = pypy3-test-instrumentation-kafka-python ; opentelemetry-instrumentation-confluent-kafka - py3{7,8,9,10,11}-test-instrumentation-confluent-kafka - pypy3-test-instrumentation-confluent-kafka + // FIXME: Enable support for python 3.11 when https://github.com/confluentinc/confluent-kafka-python/issues/1452 is fixed + py3{7,8,9,10}-test-instrumentation-confluent-kafka lint spellcheck