Tolerate exceptions among experimental resource detectors#4373
Merged
aabmass merged 16 commits intoopen-telemetry:mainfrom Feb 5, 2025
Merged
Conversation
OTEL resource creation will proceed even if one of the resource detector entry points indicated by the `OTEL_EXPERIMENTAL_RESOURCE_DETECTORS` env var fails to load. In fact, subsequent resource detector entry points will continue to be processed as well.
|
|
xrmx
reviewed
Dec 30, 2024
Emulates auto-instrumentation log emitted when an instrumentor fails to load https://github.com/open-telemetry/opentelemetry-python-contrib/blob/v0.50b0/opentelemetry-instrumentation/src/opentelemetry/instrumentation/auto_instrumentation/_load.py#L128
Contributor
Author
|
@xrmx this one is ready for final review |
aabmass
approved these changes
Jan 21, 2025
emdneto
requested changes
Jan 22, 2025
emdneto
reviewed
Jan 23, 2025
Member
emdneto
left a comment
There was a problem hiding this comment.
Almost there. You should run tox -e ruff and commit the changes. Please refer to CONTRIBUTING.md
emdneto
approved these changes
Feb 4, 2025
aabmass
approved these changes
Feb 5, 2025
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
OTEL resource creation will proceed even if one of the resource detector entry points indicated by the
OTEL_EXPERIMENTAL_RESOURCE_DETECTORSenv var fails to load. Subsequent resource detector entry points will continue to be processed as well.Fixes #4268
Type of change
Please delete options that are not relevant.
How Has This Been Tested?
Please describe the tests that you ran to verify your changes. Provide instructions so we can reproduce. Please also list any relevant details for your test configuration
test_resource_detector_entry_points_tolerate_missing_detector): Defines two resource detectors inOTEL_EXPERIMENTAL_RESOURCE_DETECTORS; the first ("doesnotexist") does not exist, the second ("host") does exist. Verifies that resource attributes are resolved from the second resource detector.Does This PR Require a Contrib Repo Change?
Checklist: