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 get exporter names condition #1707

Merged
merged 9 commits into from
Mar 22, 2021
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
@@ -68,6 +68,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
([#1695](https://github.com/open-telemetry/opentelemetry-python/pull/1695))
- Change Jaeger exporters to obtain service.name from span
([#1703](https://github.com/open-telemetry/opentelemetry-python/pull/1703))
- Fixed an unset `OTEL_TRACES_EXPORTER` resulting in an error
([#1707](https://github.com/open-telemetry/opentelemetry-python/pull/1707))

### Removed
- Removed unused `get_hexadecimal_trace_id` and `get_hexadecimal_span_id` methods.
5 changes: 1 addition & 4 deletions opentelemetry-distro/src/opentelemetry/distro/__init__.py
Original file line number Diff line number Diff line change
@@ -50,10 +50,7 @@ def _get_exporter_names() -> Sequence[str]:

exporters = set()

if (
trace_exporters is not None
or trace_exporters.lower().strip() != "none"
):
if trace_exporters and trace_exporters.lower().strip() != "none":
exporters.update(
{
trace_exporter.strip()
12 changes: 12 additions & 0 deletions opentelemetry-distro/tests/test_configurator.py
Original file line number Diff line number Diff line change
@@ -167,3 +167,15 @@ def test_otlp_exporter_overwrite(self):
@patch.dict(environ, {OTEL_TRACES_EXPORTER: "jaeger,zipkin"})
def test_multiple_exporters(self):
self.assertEqual(sorted(_get_exporter_names()), ["jaeger", "zipkin"])

@patch.dict(environ, {OTEL_TRACES_EXPORTER: "none"})
def test_none_exporters(self):
self.assertEqual(sorted(_get_exporter_names()), [])

@patch.dict(environ, {}, clear=True)
def test_no_exporters(self):
self.assertEqual(sorted(_get_exporter_names()), [])

@patch.dict(environ, {OTEL_TRACES_EXPORTER: ""})
def test_empty_exporters(self):
self.assertEqual(sorted(_get_exporter_names()), [])