Skip to content

Commit ee794de

Browse files
Use * instead of all
1 parent edb9972 commit ee794de

File tree

3 files changed

+4
-3
lines changed

3 files changed

+4
-3
lines changed

CHANGELOG.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
1212

1313
## Unreleased
1414

15-
- Allow loading all resource detectors by setting `OTEL_EXPERIMENTAL_RESOURCE_DETECTORS` to `all`
15+
- Allow loading all resource detectors by setting `OTEL_EXPERIMENTAL_RESOURCE_DETECTORS` to `*`
1616
([#4819](https://github.com/open-telemetry/opentelemetry-python/pull/4819))
1717
- docs: Added sqlcommenter example
1818
([#4734](https://github.com/open-telemetry/opentelemetry-python/pull/4734))

opentelemetry-sdk/src/opentelemetry/sdk/resources/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -207,7 +207,7 @@ def create(
207207

208208
resource_detectors: List[ResourceDetector] = []
209209

210-
if "all" in otel_experimental_resource_detectors:
210+
if "*" in otel_experimental_resource_detectors:
211211
otel_experimental_resource_detectors = entry_points(
212212
group="opentelemetry_resource_detector"
213213
).names

opentelemetry-sdk/tests/resources/test_resources.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -474,6 +474,7 @@ def test_service_name_env(self):
474474
self.assertEqual(resource.attributes["service.name"], "from-code")
475475

476476

477+
# pylint: disable=too-many-public-methods
477478
class TestOTELResourceDetector(unittest.TestCase):
478479
def setUp(self) -> None:
479480
environ[OTEL_RESOURCE_ATTRIBUTES] = ""
@@ -698,7 +699,7 @@ def test_resource_detector_entry_points_os(self):
698699
self.assertIn(OS_VERSION, resource.attributes)
699700

700701
@patch.dict(
701-
environ, {OTEL_EXPERIMENTAL_RESOURCE_DETECTORS: "all"}, clear=True
702+
environ, {OTEL_EXPERIMENTAL_RESOURCE_DETECTORS: "*"}, clear=True
702703
)
703704
def test_resource_detector_entry_points_all(self):
704705
resource = Resource({}).create()

0 commit comments

Comments
 (0)