Skip to content

Commit

Permalink
sdk: Make the robots happy
Browse files Browse the repository at this point in the history
  • Loading branch information
Zirak committed Jul 14, 2024
1 parent 3689a5f commit 777dd99
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 10 deletions.
18 changes: 8 additions & 10 deletions opentelemetry-sdk/src/opentelemetry/sdk/resources/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -176,15 +176,13 @@ def create(
attributes = {}

otel_experimental_resource_detectors = {"otel", "os"}.union(
set(
[
otel_experimental_resource_detector.strip()
for otel_experimental_resource_detector in environ.get(
"OTEL_EXPERIMENTAL_RESOURCE_DETECTORS", ""
).split(",")
if otel_experimental_resource_detector
]
)
{
otel_experimental_resource_detector.strip()
for otel_experimental_resource_detector in environ.get(
OTEL_EXPERIMENTAL_RESOURCE_DETECTORS, ""
).split(",")
if otel_experimental_resource_detector
}
)

resource_detectors = []
Expand Down Expand Up @@ -376,7 +374,7 @@ def detect(self) -> "Resource":


class OsResourceDetector(ResourceDetector):
"""Detect os resources based on `Operating System conventions <https://opentelemetry.io/docs/specs/semconv/resource/os/`_."""
"""Detect os resources based on `Operating System conventions <https://opentelemetry.io/docs/specs/semconv/resource/os/>`_."""

def detect(self) -> "Resource":
"""Returns a resource with with `os.type` and `os.version`. Example of
Expand Down
1 change: 1 addition & 0 deletions opentelemetry-sdk/tests/resources/test_resources.py
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,7 @@ def get_mock_uname():

return platform.uname_result(**kwargs)


@patch(
"platform.uname",
get_mock_uname,
Expand Down

0 comments on commit 777dd99

Please sign in to comment.