From 8d7e24ff154a0fb1dcc07151d97cab78d8bfe7c8 Mon Sep 17 00:00:00 2001 From: tonycody Date: Tue, 17 May 2022 18:40:40 +0800 Subject: [PATCH] feat:: Added `--insecure` of CLI argument --- .../opentelemetry/exporter/jaeger/proto/grpc/__init__.py | 4 ++++ .../src/opentelemetry/sdk/environment_variables.py | 7 +++++++ 2 files changed, 11 insertions(+) diff --git a/exporter/opentelemetry-exporter-jaeger-proto-grpc/src/opentelemetry/exporter/jaeger/proto/grpc/__init__.py b/exporter/opentelemetry-exporter-jaeger-proto-grpc/src/opentelemetry/exporter/jaeger/proto/grpc/__init__.py index ab751b0fb93..71010704521 100644 --- a/exporter/opentelemetry-exporter-jaeger-proto-grpc/src/opentelemetry/exporter/jaeger/proto/grpc/__init__.py +++ b/exporter/opentelemetry-exporter-jaeger-proto-grpc/src/opentelemetry/exporter/jaeger/proto/grpc/__init__.py @@ -87,6 +87,7 @@ from opentelemetry.sdk.environment_variables import ( OTEL_EXPORTER_JAEGER_ENDPOINT, OTEL_EXPORTER_JAEGER_TIMEOUT, + OTEL_PYTHON_INSECURE, ) from opentelemetry.sdk.resources import SERVICE_NAME, Resource from opentelemetry.sdk.trace.export import SpanExporter, SpanExportResult @@ -122,6 +123,9 @@ def __init__( self.collector_endpoint = collector_endpoint or environ.get( OTEL_EXPORTER_JAEGER_ENDPOINT, DEFAULT_GRPC_COLLECTOR_ENDPOINT ) + self.insecure = insecure or bool( + OTEL_PYTHON_INSECURE, None + ) self._timeout = timeout or int( environ.get(OTEL_EXPORTER_JAEGER_TIMEOUT, DEFAULT_EXPORT_TIMEOUT) ) diff --git a/opentelemetry-sdk/src/opentelemetry/sdk/environment_variables.py b/opentelemetry-sdk/src/opentelemetry/sdk/environment_variables.py index 145489a683e..d335467e459 100644 --- a/opentelemetry-sdk/src/opentelemetry/sdk/environment_variables.py +++ b/opentelemetry-sdk/src/opentelemetry/sdk/environment_variables.py @@ -421,3 +421,10 @@ ``DELTA``: Choose ``DELTA`` aggregation temporality for ``Counter``, ``Asynchronous Counter`` and ``Histogram``. Choose ``CUMULATIVE`` aggregation temporality for ``UpDownCounter`` and ``Asynchronous UpDownCounter``. """ + +OTEL_PYTHON_INSECURE = "OTEL_PYTHON_INSECURE" +""" +.. envvar:: OTEL_PYTHON_INSECURE + +The :envvar:`OTEL_PYTHON_INSECURE` is a boolean flag to True if collector has no encryption or authentication. +""" \ No newline at end of file