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
[mysql] distinguish mysql-python instrumentation #263
Conversation
# MySQL python package is not supported at the moment; | ||
# here we raise an import error so that the external | ||
# loader knows that the integration is not available | ||
raise ImportError('No module named mysql-python') |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The error must be an ImportError
because it's like if we're trying to import a module that is not here. However, the message may be different?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm completely fine with this patch.
Though I'm having a hard time seing why we don't just do import _mysql
and let the python runtime raise for us, instead of using utils.require_module
. Did I miss something?
This change is only temporary and at some point we will have the right instrumentation here (so the Anyway, here we still have 2 different libraries that should not fail fast at the first |
Makes sense. LGTM |
Thanks for the review @MattHauglustaine ! We still have room of improvement here! 👍 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
What it does
The current
mysql
integration supports onlymysql-connector
package. Other libraries such asMySQL-Python
, must be handled differently. However, the current integration loader ( available in themonkey
module) doesn't give the right feedback to developers, and indeed the error output is misleading.Testing the loader
The library
MySQL-Python
is installed in the environment sopatch_all()
should not find this integration.Before the patch
It seems that
mysql
is not installed while it is.After the patch
The integration
mysql
is not available for this package.