Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat:: Added --insecure of CLI argument #2696

Merged
merged 21 commits into from
Jul 26, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -15,6 +15,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
([#2781](https://github.com/open-telemetry/opentelemetry-python/pull/2781))
- Fix tracing decorator with late configuration
([#2754](https://github.com/open-telemetry/opentelemetry-python/pull/2754))
- Fix --insecure of CLI argument
([#2696](https://github.com/open-telemetry/opentelemetry-python/pull/2696))

## [1.12.0rc2-0.32b0](https://github.com/open-telemetry/opentelemetry-python/releases/tag/v1.12.0rc2) - 2022-07-04

Original file line number Diff line number Diff line change
@@ -87,6 +87,7 @@
from opentelemetry.sdk.environment_variables import (
OTEL_EXPORTER_JAEGER_ENDPOINT,
OTEL_EXPORTER_JAEGER_TIMEOUT,
OTEL_EXPORTER_JAEGER_GRPC_INSECURE,
)
from opentelemetry.sdk.resources import SERVICE_NAME, Resource
from opentelemetry.sdk.trace.export import SpanExporter, SpanExportResult
@@ -122,11 +123,17 @@ def __init__(
self.collector_endpoint = collector_endpoint or environ.get(
OTEL_EXPORTER_JAEGER_ENDPOINT, DEFAULT_GRPC_COLLECTOR_ENDPOINT
)
self.insecure = (
insecure
or environ.get(OTEL_EXPORTER_JAEGER_GRPC_INSECURE, "")
.strip()
.lower()
== "true"
)
tonycody marked this conversation as resolved.
Show resolved Hide resolved
self._timeout = timeout or int(
environ.get(OTEL_EXPORTER_JAEGER_TIMEOUT, DEFAULT_EXPORT_TIMEOUT)
)
self._grpc_client = None
self.insecure = insecure
self.credentials = util._get_credentials(credentials)
tracer_provider = trace.get_tracer_provider()
self.service_name = (
Original file line number Diff line number Diff line change
@@ -35,6 +35,7 @@
from opentelemetry.sdk.environment_variables import (
OTEL_EXPORTER_JAEGER_CERTIFICATE,
OTEL_EXPORTER_JAEGER_ENDPOINT,
OTEL_EXPORTER_JAEGER_GRPC_INSECURE,
OTEL_EXPORTER_JAEGER_TIMEOUT,
OTEL_RESOURCE_ATTRIBUTES,
)
@@ -87,6 +88,7 @@ def test_constructor_by_environment_variables(self):
+ "/certs/cred.cert",
OTEL_RESOURCE_ATTRIBUTES: "service.name=my-opentelemetry-jaeger",
OTEL_EXPORTER_JAEGER_TIMEOUT: "5",
OTEL_EXPORTER_JAEGER_GRPC_INSECURE: "False",
},
)

@@ -99,6 +101,7 @@ def test_constructor_by_environment_variables(self):
self.assertEqual(exporter.collector_endpoint, collector_endpoint)
self.assertEqual(exporter._timeout, 5)
self.assertIsNotNone(exporter.credentials)
self.assertEqual(exporter.insecure, False)
env_patch.stop()

# pylint: disable=too-many-locals,too-many-statements
Original file line number Diff line number Diff line change
@@ -435,3 +435,10 @@
``DELTA``: Choose ``DELTA`` aggregation temporality for ``Counter``, ``Asynchronous Counter`` and ``Histogram``.
Choose ``CUMULATIVE`` aggregation temporality for ``UpDownCounter`` and ``Asynchronous UpDownCounter``.
"""

OTEL_EXPORTER_JAEGER_GRPC_INSECURE = "OTEL_EXPORTER_JAEGER_GRPC_INSECURE"
"""
.. envvar:: OTEL_EXPORTER_JAEGER_GRPC_INSECURE

The :envvar:`OTEL_EXPORTER_JAEGER_GRPC_INSECURE` is a boolean flag to True if collector has no encryption or authentication.
"""