File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 2929from opentelemetry .sdk .resources import (
3030 _DEFAULT_RESOURCE ,
3131 SERVICE_NAME ,
32- HostResourceDetector ,
32+ _HostResourceDetector ,
3333 ProcessResourceDetector ,
3434 Resource ,
3535)
@@ -152,7 +152,7 @@ def _run_detectors(
152152 same key.
153153 """
154154 if detector_config .host is not None :
155- detected_attrs .update (HostResourceDetector ().detect ().attributes )
155+ detected_attrs .update (_HostResourceDetector ().detect ().attributes )
156156 if detector_config .process is not None :
157157 detected_attrs .update (ProcessResourceDetector ().detect ().attributes )
158158
Original file line number Diff line number Diff line change @@ -490,8 +490,10 @@ def detect(self) -> "Resource":
490490 )
491491
492492
493- class HostResourceDetector (ResourceDetector ):
494- """Detects host.name (hostname) and host.arch (CPU architecture)."""
493+ class _HostResourceDetector (ResourceDetector ): # type: ignore[reportUnusedClass]
494+ """
495+ The HostResourceDetector detects the hostname and architecture attributes.
496+ """
495497
496498 def detect (self ) -> "Resource" :
497499 return Resource (
Original file line number Diff line number Diff line change 4949 TELEMETRY_SDK_LANGUAGE ,
5050 TELEMETRY_SDK_NAME ,
5151 TELEMETRY_SDK_VERSION ,
52- HostResourceDetector ,
52+ _HostResourceDetector ,
5353 OsResourceDetector ,
5454 OTELResourceDetector ,
5555 ProcessResourceDetector ,
@@ -813,7 +813,7 @@ class TestHostResourceDetector(unittest.TestCase):
813813 @patch ("platform.machine" , lambda : "AMD64" )
814814 def test_host_resource_detector (self ):
815815 resource = get_aggregated_resources (
816- [HostResourceDetector ()],
816+ [_HostResourceDetector ()],
817817 Resource ({}),
818818 )
819819 self .assertEqual (resource .attributes [HOST_NAME ], "foo" )
You can’t perform that action at this time.
0 commit comments