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
Show file tree
Hide file tree
Changes from 5 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
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -122,11 +123,13 @@ def __init__(
self.collector_endpoint = collector_endpoint or environ.get(
OTEL_EXPORTER_JAEGER_ENDPOINT, DEFAULT_GRPC_COLLECTOR_ENDPOINT
)
self.insecure = insecure or bool(
environ.get(OTEL_EXPORTER_JAEGER_GRPC_INSECURE, None)
)
tonycody marked this conversation as resolved.
Show resolved Hide resolved
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 = (
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@
OTEL_EXPORTER_JAEGER_ENDPOINT,
OTEL_EXPORTER_JAEGER_TIMEOUT,
OTEL_RESOURCE_ATTRIBUTES,
OTEL_EXPORTER_JAEGER_GRPC_INSECURE,
)
from opentelemetry.sdk.resources import SERVICE_NAME, Resource
from opentelemetry.sdk.trace import TracerProvider
Expand Down Expand Up @@ -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",
},
)

Expand All @@ -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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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_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.
"""