-
Notifications
You must be signed in to change notification settings - Fork 45
Fix creation of resources in _detector #366
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
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