Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,9 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

### Added

- `opentelemetry-instrumentation`: Add warning when no `opentelemetry_configurator`
entry points are found, suggesting to install `opentelemetry-distro`.
([#4543](https://github.com/open-telemetry/opentelemetry-python-contrib/pull/4543))
- Bump `pylint` to `4.0.5`
([#4244](https://github.com/open-telemetry/opentelemetry-python-contrib/pull/4244))
- `opentelemetry-instrumentation-sqlite3`: Add uninstrument, error status, suppress, and no-op tests
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -187,3 +187,10 @@ def _load_configurators():
except Exception as exc: # pylint: disable=broad-except
_logger.exception("Configuration of %s failed", entry_point.name)
raise exc

if configured is None:
_logger.warning(
"No configurator found. Make sure 'opentelemetry-distro' is "
"installed if you are using automatic instrumentation. "
"See https://opentelemetry.io/docs/zero-code/python/ for details."
)
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,14 @@ def test_load_configurators(self, iter_mock): # pylint: disable=no-self-use
)
def test_load_configurators_no_ep(self, iter_mock): # pylint: disable=no-self-use
iter_mock.return_value = ()
with self.assertLogs(
"opentelemetry.instrumentation.auto_instrumentation._load",
level="WARNING",
) as cm:
_load._load_configurators()
self.assertTrue(
any("opentelemetry-distro" in msg for msg in cm.output)
)
# Confirm method does not crash if not entry points exist.
_load._load_configurators()

Expand Down