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

fix otlp grpc exporter bug when no scheme is passed in #1806

Merged
merged 2 commits into from
May 4, 2021
Merged
Show file tree
Hide file tree
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
8 changes: 6 additions & 2 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,15 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
## [Unreleased](https://github.com/open-telemetry/opentelemetry-python/compare/v1.1.0...HEAD)

### Added
- Added example for running Django with auto instrumentation
- Added example for running Django with auto instrumentation.
([#1803](https://github.com/open-telemetry/opentelemetry-python/pull/1803))

### Changed
- Fixed OTLP gRPC exporter silently failing if scheme is not specified in endpoint.
([#1806](https://github.com/open-telemetry/opentelemetry-python/pull/1806))

### Removed
- Moved `opentelemetry-instrumentation` to contrib repository
- Moved `opentelemetry-instrumentation` to contrib repository.
([#1797](https://github.com/open-telemetry/opentelemetry-python/pull/1797))

## [1.1.0](https://github.com/open-telemetry/opentelemetry-python/releases/tag/v1.1.0) - 2021-04-20
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -207,7 +207,8 @@ def __init__(
else:
insecure = True

endpoint = parsed_url.netloc
if parsed_url.netloc:
endpoint = parsed_url.netloc

self._headers = headers or environ.get(OTEL_EXPORTER_OTLP_HEADERS)
if isinstance(self._headers, str):
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -239,6 +239,7 @@ def test_otlp_headers_from_env(self, mock_ssl_channel, mock_secure):
@patch("opentelemetry.exporter.otlp.proto.grpc.exporter.secure_channel")
def test_otlp_exporter_endpoint(self, mock_secure, mock_insecure):
"""Just OTEL_EXPORTER_OTLP_COMPRESSION should work"""
expected_endpoint = "localhost:4317"
endpoints = [
(
"http://localhost:4317",
Expand Down Expand Up @@ -275,6 +276,13 @@ def test_otlp_exporter_endpoint(self, mock_secure, mock_insecure):
mock_method, endpoint, insecure
),
)
self.assertEqual(
expected_endpoint,
mock_method.call_args[0][0],
"expected {} got {} {}".format(
expected_endpoint, mock_method.call_args[0][0], endpoint
),
)
mock_method.reset_mock()

# pylint: disable=no-self-use
Expand Down