Skip to content

Commit c034dc8

Browse files
committed
tweak how config is initialized
1 parent 118f63a commit c034dc8

File tree

2 files changed

+1
-3
lines changed

2 files changed

+1
-3
lines changed

instrumentation/opentelemetry-instrumentation-system-metrics/src/opentelemetry/instrumentation/system_metrics/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -182,7 +182,7 @@ def __init__(
182182
config: dict[str, list[str] | None] | None = None,
183183
):
184184
super().__init__()
185-
self._config = config or _build_default_config()
185+
self._config = _build_default_config() if config is None else config
186186
self._labels = {} if labels is None else labels
187187
self._meter = None
188188
self._python_implementation = python_implementation().lower()

instrumentation/opentelemetry-instrumentation-system-metrics/tests/test_system_metrics.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1098,7 +1098,6 @@ def test_that_correct_config_is_read(self):
10981098

10991099
class TestBuildDefaultConfig(unittest.TestCase):
11001100
def setUp(self):
1101-
# Store original environment to restore after each test
11021101
self.env_patcher = mock.patch.dict("os.environ", {}, clear=False)
11031102
self.env_patcher.start()
11041103

@@ -1107,7 +1106,6 @@ def tearDown(self):
11071106
os.environ.pop(OTEL_PYTHON_SYSTEM_METRICS_EXCLUDED_METRICS, None)
11081107

11091108
def test_default_config_without_exclusions(self):
1110-
"""Test that _DEFAULT_CONFIG is returned when no exclusions are specified."""
11111109
test_cases = [
11121110
{
11131111
"name": "no_env_var_set",

0 commit comments

Comments
 (0)