Skip to content

Commit 56cc06b

Browse files
committed
More precise instructions
1 parent ba82816 commit 56cc06b

File tree

1 file changed

+2
-1
lines changed
  • opentelemetry-sdk/src/opentelemetry/sdk/resources

1 file changed

+2
-1
lines changed

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

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -176,7 +176,7 @@ def create(
176176
) -> "Resource":
177177
"""Creates a new `Resource` from attributes.
178178
179-
This is supposed to be called by the SDK and not by `ResourceDetector` instances.
179+
`ResourceDetector` instances should not call this method.
180180
181181
Args:
182182
attributes: Optional zero or more key-value pairs.
@@ -319,6 +319,7 @@ def __init__(self, raise_on_error: bool = False) -> None:
319319

320320
@abc.abstractmethod
321321
def detect(self) -> "Resource":
322+
"""Don't call `Resource.create` here to avoid an infinite loop, instead instantiate `Resource` directly"""
322323
raise NotImplementedError()
323324

324325

0 commit comments

Comments
 (0)