Fix creation of resources in _detector#366
Conversation
|
We have discourage using the constructor. If we only call the constructor, there is no way to get these attributes https://github.com/open-telemetry/opentelemetry-python/blob/b48223561acfdffd1411ed7d015ddabe6f6eb801/opentelemetry-sdk/src/opentelemetry/sdk/resources/__init__.py#L217-L227 or I think we might need to fix it this in the SDK or at least update the documentation to say that detectors MUST call the constructor. It seems a bit fragile overall, wdyt? |
|
/gcbrun |
Opened a pr to update the docs |
|
/gcbrun |
|
@xrmx to fix the tests, can you regenerate the snapshots by running? That will highlight the difference in behavior too |
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 GoogleCloudPlatform#363
6e6a165 to
b0ff830
Compare
Updated the snapshosts, thanks for the hint |
|
/gcbrun |
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.
See Resource.create implementation
Fix #363