Add warning when no opentelemetry_configurator entry points found#4543
Open
Manvi2402 wants to merge 2 commits intoopen-telemetry:mainfrom
Open
Add warning when no opentelemetry_configurator entry points found#4543Manvi2402 wants to merge 2 commits intoopen-telemetry:mainfrom
Manvi2402 wants to merge 2 commits intoopen-telemetry:mainfrom
Conversation
737789a to
5da3048
Compare
xrmx
requested changes
May 7, 2026
|
|
||
| def _load_distro() -> BaseDistro: | ||
| distro_name = environ.get(OTEL_PYTHON_DISTRO, None) | ||
| all_distros = list(entry_points(group="opentelemetry_distro")) |
Contributor
There was a problem hiding this comment.
I don't think you need this, this is the case where DefaultDistro is return at the end of the function
| def _load_configurators(): | ||
| configurator_name = environ.get(OTEL_PYTHON_CONFIGURATOR, None) | ||
| configured = None | ||
| all_configurators = list(entry_points(group="opentelemetry_configurator")) |
Contributor
There was a problem hiding this comment.
Same here, this is the path where configured is None at the end of the loop below
Contributor
Author
|
Hi @xrmx , thanks for the review!
Please review the updated changes! |
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
When
opentelemetry-distrois not installed,opentelemetry-instrumentfails silently without any warning or error message. This makes it very
difficult to debug.
This PR adds a warning log message when no
opentelemetry_configuratorentry points are found, clearly telling the user to install
opentelemetry-distro.Fixes open-telemetry/opentelemetry-python#5180
Type of change
Please delete options that are not relevant.
How Has This Been Tested?
test_load_configurators_no_epto assertthat warning is logged when no entry points are found.
Run tests with:
pytest opentelemetry-instrumentation/tests/auto_instrumentation/test_load.py -v
Does This PR Require a Core Repo Change?
Checklist:
See contributing.md for styleguide, changelog guidelines, and more.