Skip to content

autoinstrumentation: catch ModuleNotFoundError when the library is not installed #3423

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

Merged
merged 5 commits into from
Apr 15, 2025

Conversation

emdneto
Copy link
Member

@emdneto emdneto commented Apr 14, 2025

Description

Fixes #3421
Altough ModuleNotFoundError is a subclass of ImportError, we are catching ModuleNotFoundError and logging a debug message instead of an exception to keep the behaviour before #3202

emdneto added 2 commits April 14, 2025 13:45
…nt exception from bubbling up

Signed-off-by: emdneto <9735060+emdneto@users.noreply.github.com>
Signed-off-by: emdneto <9735060+emdneto@users.noreply.github.com>
@emdneto emdneto requested a review from a team as a code owner April 14, 2025 16:47
@emdneto emdneto changed the title catch ModuleNotFoundError when the library is not installed autoinstrumentation: catch ModuleNotFoundError when the library is not installed Apr 14, 2025
emdneto added 2 commits April 14, 2025 13:54
Signed-off-by: emdneto <9735060+emdneto@users.noreply.github.com>
Copy link
Contributor

@rjduffner rjduffner left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I left one comment, feel free to take it or leave it. Overall, I like it. I think its a good compromise.

@xrmx xrmx merged commit 9c969f3 into open-telemetry:main Apr 15, 2025
720 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

opentelemetry-instrument 0.53b0 ModuleNotFoundError 'tortoise'
5 participants