Skip to content

Commit 1160c32

Browse files
committed
Fix creation of resources in _detector
We should create a Resource instance and not use Resource.create because if we set OTEL_EXPERIMENTAL_RESOURCE_DETECTORS we will go into an infinite loop trying to load and instantiate all the resources detectors. Fix #363
1 parent 495e4c5 commit 1160c32

File tree

1 file changed

+1
-1
lines changed
  • opentelemetry-resourcedetector-gcp/src/opentelemetry/resourcedetector/gcp_resource_detector

1 file changed

+1
-1
lines changed

opentelemetry-resourcedetector-gcp/src/opentelemetry/resourcedetector/gcp_resource_detector/_detector.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -129,7 +129,7 @@ def _gae_resource() -> Resource:
129129

130130

131131
def _make_resource(attrs: Mapping[str, AttributeValue]) -> Resource:
132-
return Resource.create(
132+
return Resource(
133133
{
134134
ResourceAttributes.CLOUD_PROVIDER: "gcp",
135135
ResourceAttributes.CLOUD_ACCOUNT_ID: _metadata.get_metadata()[

0 commit comments

Comments
 (0)