From 7f6a04197d270532c51b4ce1f570e7a285a841a3 Mon Sep 17 00:00:00 2001 From: Ron Yishai Date: Mon, 29 Aug 2022 19:36:04 +0300 Subject: [PATCH 1/9] Deprecate otlp_proto_grpc and otlp_proto_http in auto-instrumentation --- .../src/opentelemetry/distro/__init__.py | 4 ++-- opentelemetry-instrumentation/README.rst | 12 +++++++----- 2 files changed, 9 insertions(+), 7 deletions(-) diff --git a/opentelemetry-distro/src/opentelemetry/distro/__init__.py b/opentelemetry-distro/src/opentelemetry/distro/__init__.py index c9e8e1a685..b478bb76db 100644 --- a/opentelemetry-distro/src/opentelemetry/distro/__init__.py +++ b/opentelemetry-distro/src/opentelemetry/distro/__init__.py @@ -34,5 +34,5 @@ class OpenTelemetryDistro(BaseDistro): # pylint: disable=no-self-use def _configure(self, **kwargs): - os.environ.setdefault(OTEL_TRACES_EXPORTER, "otlp_proto_grpc") - os.environ.setdefault(OTEL_METRICS_EXPORTER, "otlp_proto_grpc") + os.environ.setdefault(OTEL_TRACES_EXPORTER, "otlp") + os.environ.setdefault(OTEL_METRICS_EXPORTER, "otlp") diff --git a/opentelemetry-instrumentation/README.rst b/opentelemetry-instrumentation/README.rst index a93bedcc27..74f8401902 100644 --- a/opentelemetry-instrumentation/README.rst +++ b/opentelemetry-instrumentation/README.rst @@ -22,7 +22,7 @@ This package provides a couple of commands that help automatically instruments a For more info about ``opentelemetry-distro`` check `here `__ :: - pip install opentelemetry-distro[otlp] + pip install opentelemetry-distro opentelemetry-bootstrap @@ -57,6 +57,7 @@ The command supports the following configuration options as CLI arguments and en * ``--traces_exporter`` or ``OTEL_TRACES_EXPORTER`` +* ``--metrics_exporter`` or ``OTEL_METRICS_EXPORTER`` Used to specify which trace exporter to use. Can be set to one or more of the well-known exporter names (see below). @@ -71,13 +72,14 @@ Well known trace exporter names: - jaeger_proto - jaeger_thrift - opencensus - - otlp - - otlp_proto_grpc - - otlp_proto_http - zipkin_json - zipkin_proto + - otlp + - otlp_proto_grpc (`deprecated`) + - otlp_proto_http (`deprecated`) -``otlp`` is an alias for ``otlp_proto_grpc``. +Note: The default transport protocol for ``otlp`` is gRPC. +HTTP is currently supported for traces only, and should be set using ``OTEL_EXPORTER_OTLP_TRACES_PROTOCOL=http/protobuf`` * ``--id-generator`` or ``OTEL_PYTHON_ID_GENERATOR`` From da269f5af03b70c9d4b0cbd5b5d6138af7092043 Mon Sep 17 00:00:00 2001 From: Ron Yishai Date: Mon, 29 Aug 2022 19:58:25 +0300 Subject: [PATCH 2/9] tests --- opentelemetry-distro/tests/test_distro.py | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/opentelemetry-distro/tests/test_distro.py b/opentelemetry-distro/tests/test_distro.py index 6888e8e9ce..b438e561e2 100644 --- a/opentelemetry-distro/tests/test_distro.py +++ b/opentelemetry-distro/tests/test_distro.py @@ -19,7 +19,10 @@ from pkg_resources import DistributionNotFound, require from opentelemetry.distro import OpenTelemetryDistro -from opentelemetry.environment_variables import OTEL_TRACES_EXPORTER +from opentelemetry.environment_variables import ( + OTEL_TRACES_EXPORTER, + OTEL_METRICS_EXPORTER, +) class TestDistribution(TestCase): @@ -32,7 +35,11 @@ def test_package_available(self): 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_proto_grpc", os.environ.get(OTEL_TRACES_EXPORTER) + "otlp", os.environ.get(OTEL_TRACES_EXPORTER) + ) + self.assertEqual( + "otlp", os.environ.get(OTEL_METRICS_EXPORTER) ) From 922b349582bc0c78fa0e816ff0c1cf00a20d69bf Mon Sep 17 00:00:00 2001 From: Ron Yishai Date: Tue, 30 Aug 2022 11:29:21 +0300 Subject: [PATCH 3/9] lint --- opentelemetry-distro/tests/test_distro.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/opentelemetry-distro/tests/test_distro.py b/opentelemetry-distro/tests/test_distro.py index b438e561e2..b039aededf 100644 --- a/opentelemetry-distro/tests/test_distro.py +++ b/opentelemetry-distro/tests/test_distro.py @@ -20,8 +20,8 @@ from opentelemetry.distro import OpenTelemetryDistro from opentelemetry.environment_variables import ( - OTEL_TRACES_EXPORTER, OTEL_METRICS_EXPORTER, + OTEL_TRACES_EXPORTER, ) From f96e7685b823bb6a9957ec38c96c70b03487072c Mon Sep 17 00:00:00 2001 From: Ron Yishai Date: Sun, 11 Sep 2022 19:30:28 +0300 Subject: [PATCH 4/9] CR fix --- opentelemetry-distro/src/opentelemetry/distro/__init__.py | 2 ++ opentelemetry-distro/tests/test_distro.py | 4 ++++ opentelemetry-instrumentation/README.rst | 2 +- 3 files changed, 7 insertions(+), 1 deletion(-) diff --git a/opentelemetry-distro/src/opentelemetry/distro/__init__.py b/opentelemetry-distro/src/opentelemetry/distro/__init__.py index b478bb76db..4900f445cd 100644 --- a/opentelemetry-distro/src/opentelemetry/distro/__init__.py +++ b/opentelemetry-distro/src/opentelemetry/distro/__init__.py @@ -18,6 +18,7 @@ OTEL_METRICS_EXPORTER, OTEL_TRACES_EXPORTER, ) +from opentelemetry.sdk.environment_variables import OTEL_EXPORTER_OTLP_PROTOCOL from opentelemetry.instrumentation.distro import BaseDistro from opentelemetry.sdk._configuration import _OTelSDKConfigurator @@ -36,3 +37,4 @@ class OpenTelemetryDistro(BaseDistro): def _configure(self, **kwargs): os.environ.setdefault(OTEL_TRACES_EXPORTER, "otlp") os.environ.setdefault(OTEL_METRICS_EXPORTER, "otlp") + os.environ.setdefault(OTEL_EXPORTER_OTLP_PROTOCOL, "grpc") diff --git a/opentelemetry-distro/tests/test_distro.py b/opentelemetry-distro/tests/test_distro.py index b039aededf..205d7c838e 100644 --- a/opentelemetry-distro/tests/test_distro.py +++ b/opentelemetry-distro/tests/test_distro.py @@ -23,6 +23,7 @@ OTEL_METRICS_EXPORTER, OTEL_TRACES_EXPORTER, ) +from opentelemetry.sdk.environment_variables import OTEL_EXPORTER_OTLP_PROTOCOL class TestDistribution(TestCase): @@ -43,3 +44,6 @@ def test_default_configuration(self): self.assertEqual( "otlp", os.environ.get(OTEL_METRICS_EXPORTER) ) + self.assertEqual( + "grpc", os.environ.get(OTEL_METRICS_EXPORTER) + ) diff --git a/opentelemetry-instrumentation/README.rst b/opentelemetry-instrumentation/README.rst index 74f8401902..95b8fe582b 100644 --- a/opentelemetry-instrumentation/README.rst +++ b/opentelemetry-instrumentation/README.rst @@ -22,7 +22,7 @@ This package provides a couple of commands that help automatically instruments a For more info about ``opentelemetry-distro`` check `here `__ :: - pip install opentelemetry-distro + pip install opentelemetry-distro[otlp] opentelemetry-bootstrap From 612c86d20aaec7b6ad5339877c66ec17f08d198d Mon Sep 17 00:00:00 2001 From: Ron Yishai Date: Sun, 11 Sep 2022 20:26:18 +0300 Subject: [PATCH 5/9] Update opentelemetry-distro/tests/test_distro.py Co-authored-by: Srikanth Chekuri --- opentelemetry-distro/tests/test_distro.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/opentelemetry-distro/tests/test_distro.py b/opentelemetry-distro/tests/test_distro.py index 205d7c838e..dd8f9c4cc4 100644 --- a/opentelemetry-distro/tests/test_distro.py +++ b/opentelemetry-distro/tests/test_distro.py @@ -45,5 +45,5 @@ def test_default_configuration(self): "otlp", os.environ.get(OTEL_METRICS_EXPORTER) ) self.assertEqual( - "grpc", os.environ.get(OTEL_METRICS_EXPORTER) + "grpc", os.environ.get(OTEL_EXPORTER_OTLP_PROTOCOL) ) From 67b07e9a8b7494dd796a222ac3cdcaadbb540cba Mon Sep 17 00:00:00 2001 From: Ron Yishai Date: Mon, 12 Sep 2022 12:45:21 +0300 Subject: [PATCH 6/9] lint --- opentelemetry-distro/src/opentelemetry/distro/__init__.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/opentelemetry-distro/src/opentelemetry/distro/__init__.py b/opentelemetry-distro/src/opentelemetry/distro/__init__.py index 4900f445cd..ad61f01ca7 100644 --- a/opentelemetry-distro/src/opentelemetry/distro/__init__.py +++ b/opentelemetry-distro/src/opentelemetry/distro/__init__.py @@ -18,9 +18,9 @@ OTEL_METRICS_EXPORTER, OTEL_TRACES_EXPORTER, ) -from opentelemetry.sdk.environment_variables import OTEL_EXPORTER_OTLP_PROTOCOL from opentelemetry.instrumentation.distro import BaseDistro from opentelemetry.sdk._configuration import _OTelSDKConfigurator +from opentelemetry.sdk.environment_variables import OTEL_EXPORTER_OTLP_PROTOCOL class OpenTelemetryConfigurator(_OTelSDKConfigurator): From 7c9b7247d2ea0769692f02439060325337df801e Mon Sep 17 00:00:00 2001 From: Ron Yishai Date: Mon, 12 Sep 2022 19:43:04 +0300 Subject: [PATCH 7/9] Updating changelog --- CHANGELOG.md | 3 +++ 1 file changed, 3 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 10d6d27c21..96db29add2 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -13,6 +13,9 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ### Fixed +- `opentelemetry-distro` Deprecate `otlp_proto_grpc` and `otlp_proto_http` in favor of using + `OTEL_EXPORTER_OTLP_TRACES_PROTOCOL` as according to specifications + ([#1250](https://github.com/open-telemetry/opentelemetry-python-contrib/pull/1250)) - `opentelemetry-instrumentation-boto3sqs` Make propagation compatible with other SQS instrumentations, add 'messaging.url' span attribute, and fix missing package dependencies. ([#1234](https://github.com/open-telemetry/opentelemetry-python-contrib/pull/1234)) - `opentelemetry-instrumentation-pymongo` Change span names to not contain queries but only database name and command name From 1b89f29fa49839d6aa2c12e61790aaf3a650fb61 Mon Sep 17 00:00:00 2001 From: Ron Yishai Date: Tue, 18 Oct 2022 16:49:43 +0300 Subject: [PATCH 8/9] Update CHANGELOG.md --- CHANGELOG.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 13cf5f3d20..4c79dcee35 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -8,6 +8,9 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ## [Unreleased](https://github.com/open-telemetry/opentelemetry-python/compare/v1.13.0-0.34b0...HEAD) - Add metric instrumentation for tornado ([#1252](https://github.com/open-telemetry/opentelemetry-python-contrib/pull/1252)) +- `opentelemetry-distro` Deprecate `otlp_proto_grpc` and `otlp_proto_http` in favor of using + `OTEL_EXPORTER_OTLP_TRACES_PROTOCOL` as according to specifications + ([#1250](https://github.com/open-telemetry/opentelemetry-python-contrib/pull/1250)) ### Added @@ -43,9 +46,6 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ### Fixed -- `opentelemetry-distro` Deprecate `otlp_proto_grpc` and `otlp_proto_http` in favor of using - `OTEL_EXPORTER_OTLP_TRACES_PROTOCOL` as according to specifications - ([#1250](https://github.com/open-telemetry/opentelemetry-python-contrib/pull/1250)) - `opentelemetry-instrumentation-boto3sqs` Make propagation compatible with other SQS instrumentations, add 'messaging.url' span attribute, and fix missing package dependencies. ([#1234](https://github.com/open-telemetry/opentelemetry-python-contrib/pull/1234)) - `opentelemetry-instrumentation-pymongo` Change span names to not contain queries but only database name and command name From 448dff7d0d7bdf6be961e432e4cc20ba48a06097 Mon Sep 17 00:00:00 2001 From: Ron Yishai Date: Thu, 27 Oct 2022 13:25:00 +0300 Subject: [PATCH 9/9] Fixing CHANGELOG.md --- CHANGELOG.md | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index ddbf7d8d2e..377aeb3c6b 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -6,14 +6,13 @@ 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](https://github.com/open-telemetry/opentelemetry-python/compare/v1.13.0-0.34b0...HEAD) -- Add metric instrumentation for tornado - ([#1252](https://github.com/open-telemetry/opentelemetry-python-contrib/pull/1252)) + +### Deprecated + - `opentelemetry-distro` Deprecate `otlp_proto_grpc` and `otlp_proto_http` in favor of using `OTEL_EXPORTER_OTLP_TRACES_PROTOCOL` as according to specifications ([#1250](https://github.com/open-telemetry/opentelemetry-python-contrib/pull/1250)) - - ### Added - Add metric instrumentation for tornado