Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit ff13570

Browse files
committed
2 parents 4f012ac + cc51928 commit ff13570

File tree

3 files changed

+16
-3
lines changed

3 files changed

+16
-3
lines changed

CHANGELOG.md

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,11 +7,15 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
77
## [Unreleased](https://github.com/open-telemetry/opentelemetry-python/compare/v1.1.0...HEAD)
88

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

13+
### Changed
14+
- Fixed OTLP gRPC exporter silently failing if scheme is not specified in endpoint.
15+
([#1806](https://github.com/open-telemetry/opentelemetry-python/pull/1806))
16+
1317
### Removed
14-
- Moved `opentelemetry-instrumentation` to contrib repository
18+
- Moved `opentelemetry-instrumentation` to contrib repository.
1519
([#1797](https://github.com/open-telemetry/opentelemetry-python/pull/1797))
1620

1721
### Changed

exporter/opentelemetry-exporter-otlp-proto-grpc/src/opentelemetry/exporter/otlp/proto/grpc/exporter.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -225,7 +225,8 @@ def __init__(
225225
else:
226226
insecure = True
227227

228-
endpoint = parsed_url.netloc
228+
if parsed_url.netloc:
229+
endpoint = parsed_url.netloc
229230

230231
self._headers = headers or environ.get(OTEL_EXPORTER_OTLP_HEADERS)
231232
if isinstance(self._headers, str):

exporter/opentelemetry-exporter-otlp-proto-grpc/tests/test_otlp_trace_exporter.py

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -244,6 +244,7 @@ def test_otlp_headers_from_env(self, mock_ssl_channel, mock_secure):
244244
@patch("opentelemetry.exporter.otlp.proto.grpc.exporter.secure_channel")
245245
def test_otlp_exporter_endpoint(self, mock_secure, mock_insecure):
246246
"""Just OTEL_EXPORTER_OTLP_COMPRESSION should work"""
247+
expected_endpoint = "localhost:4317"
247248
endpoints = [
248249
(
249250
"http://localhost:4317",
@@ -280,6 +281,13 @@ def test_otlp_exporter_endpoint(self, mock_secure, mock_insecure):
280281
mock_method, endpoint, insecure
281282
),
282283
)
284+
self.assertEqual(
285+
expected_endpoint,
286+
mock_method.call_args[0][0],
287+
"expected {} got {} {}".format(
288+
expected_endpoint, mock_method.call_args[0][0], endpoint
289+
),
290+
)
283291
mock_method.reset_mock()
284292

285293
# pylint: disable=no-self-use

0 commit comments

Comments
 (0)