Repository: open-telemetry/opentelemetry-python

Issue:
TypeError: pop() takes no arguments (1 given) with otlp exporter 0.18b0
**Describe your environment** 
opentelemetry-sdk==1.0.0rc1
opentelemetry-exporter-otlp==1.0.0rc1
opentelemetry-exporter-jaeger==1.0.0rc1
opentelemetry-propagator-b3==1.0.0rc1
opentelemetry-distro==0.18b0
opentelemetry-instrumentation==0.18b0
opentelemetry-instrumentation-grpc==0.18b0
opentelemetry-instrumentation-jinja2==0.18b0

export OTEL_TRACES_EXPORTER="otlp"
export OTEL_EXPORTER_OTLP_INSECURE=true
export OTEL_EXPORTER_OTLP_ENDPOINT="markf-0398:4317"
export OTEL_RESOURCE_ATTRIBUTES="service.name=emailservice, environment=hipster_shop"

**Steps to reproduce**
I'm using this app, but I don't believe it makes any difference, given the error.
https://github.com/markfink-splunk/microservices-demo/tree/master/src/emailservice

**What is the expected behavior?**
otlp should initialize and export traces.

**What is the actual behavior?**
I get this error immediately upon executing "opentelemetry-instrument python email_server.py".

Configuration of configurator failed
Traceback (most recent call last):
  File "/usr/local/lib/python3.7/site-packages/opentelemetry/instrumentation/auto_instrumentation/sitecustomize.py", line 74, in _load_configurators
    entry_point.load()().configure()  # type: ignore
  File "/usr/local/lib/python3.7/site-packages/opentelemetry/instrumentation/configurator.py", line 50, in configure
    self._configure(**kwargs)
  File "/usr/local/lib/python3.7/site-packages/opentelemetry/distro/__init__.py", line 168, in _configure
    _initialize_components()
  File "/usr/local/lib/python3.7/site-packages/opentelemetry/distro/__init__.py", line 159, in _initialize_components
    exporter_names = _get_exporter_names()
  File "/usr/local/lib/python3.7/site-packages/opentelemetry/distro/__init__.py", line 73, in _get_exporter_names
    exporters.pop(EXPORTER_OTLP)
TypeError: pop() takes no arguments (1 given)
Failed to auto initialize opentelemetry
Traceback (most recent call last):
  File "/usr/local/lib/python3.7/site-packages/opentelemetry/instrumentation/auto_instrumentation/sitecustomize.py", line 84, in initialize
    _load_configurators()
  File "/usr/local/lib/python3.7/site-packages/opentelemetry/instrumentation/auto_instrumentation/sitecustomize.py", line 78, in _load_configurators
    raise exc
  File "/usr/local/lib/python3.7/site-packages/opentelemetry/instrumentation/auto_instrumentation/sitecustomize.py", line 74, in _load_configurators
    entry_point.load()().configure()  # type: ignore
  File "/usr/local/lib/python3.7/site-packages/opentelemetry/instrumentation/configurator.py", line 50, in configure
    self._configure(**kwargs)
  File "/usr/local/lib/python3.7/site-packages/opentelemetry/distro/__init__.py", line 168, in _configure
    _initialize_components()
  File "/usr/local/lib/python3.7/site-packages/opentelemetry/distro/__init__.py", line 159, in _initialize_components
    exporter_names = _get_exporter_names()
  File "/usr/local/lib/python3.7/site-packages/opentelemetry/distro/__init__.py", line 73, in _get_exporter_names
    exporters.pop(EXPORTER_OTLP)
TypeError: pop() takes no arguments (1 given)



Discussion:

Resolving patch:
diff --git a/opentelemetry-distro/src/opentelemetry/distro/__init__.py b/opentelemetry-distro/src/opentelemetry/distro/__init__.py
--- a/opentelemetry-distro/src/opentelemetry/distro/__init__.py
+++ b/opentelemetry-distro/src/opentelemetry/distro/__init__.py
@@ -67,7 +67,7 @@ def _get_exporter_names() -> Sequence[str]:
         )
 
     if EXPORTER_OTLP in exporters:
-        exporters.pop(EXPORTER_OTLP)
+        exporters.remove(EXPORTER_OTLP)
         exporters.add(EXPORTER_OTLP_SPAN)
 
     return list(exporters)


Test patch:
diff --git a/opentelemetry-distro/tests/test_configurator.py b/opentelemetry-distro/tests/test_configurator.py
--- a/opentelemetry-distro/tests/test_configurator.py
+++ b/opentelemetry-distro/tests/test_configurator.py
@@ -18,6 +18,9 @@
 from unittest.mock import patch
 
 from opentelemetry.distro import (
+    EXPORTER_OTLP,
+    EXPORTER_OTLP_SPAN,
+    _get_exporter_names,
     _get_id_generator,
     _import_id_generator,
     _init_tracing,
@@ -25,6 +28,7 @@
 from opentelemetry.environment_variables import (
     OTEL_PYTHON_ID_GENERATOR,
     OTEL_PYTHON_SERVICE_NAME,
+    OTEL_TRACES_EXPORTER,
 )
 from opentelemetry.sdk.resources import Resource
 from opentelemetry.sdk.trace.id_generator import IdGenerator, RandomIdGenerator
@@ -143,3 +147,14 @@ def test_trace_init_custom_id_generator(self, mock_iter_entry_points):
         _init_tracing({}, id_generator)
         provider = self.set_provider_mock.call_args[0][0]
         self.assertIsInstance(provider.id_generator, CustomIdGenerator)
+
+
+class TestExporterNames(TestCase):
+    def test_otlp_exporter_overwrite(self):
+        for exporter in [EXPORTER_OTLP, EXPORTER_OTLP_SPAN]:
+            with patch.dict(environ, {OTEL_TRACES_EXPORTER: exporter}):
+                self.assertEqual(_get_exporter_names(), [EXPORTER_OTLP_SPAN])
+
+    @patch.dict(environ, {OTEL_TRACES_EXPORTER: "jaeger,zipkin"})
+    def test_multiple_exporters(self):
+        self.assertEqual(sorted(_get_exporter_names()), ["jaeger", "zipkin"])