-
Notifications
You must be signed in to change notification settings - Fork 636
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
Psycopg2Instrumentor().instrument_connection
raises AttributeError: 'psycopg2.extensions.connection' object has no attribute '_is_instrumented_by_opentelemetry'
#2522
Comments
@alexmojaki would be great if you can open a PR |
@xrmx regarding this issue, shall I reference mysql/sqlite3 to fix this issue? Tested this approach locally, the instrument works and the trace can be displayed. |
@qiuge615 If you have already some code open a PR so we can discuss looking at it :) Thanks! |
@xrmx Appreciate your quick reply, I will create a PR with the changes, thank you! |
@xrmx Created PR with the fix, please review, thanks. |
I've also created a PR. Please see its OP for rationale: #3043 Please let me know what you think! I'm fine with whichever approach. |
Describe your environment
Steps to reproduce
Use
Psycopg2Instrumentor().instrument_connection
. For example:and run a database with:
What is the actual behavior?
Additional context
Here's where the error happens:
opentelemetry-python-contrib/instrumentation/opentelemetry-instrumentation-psycopg2/src/opentelemetry/instrumentation/psycopg2/__init__.py
Line 164 in 46d2ce6
The code seems tested here:
opentelemetry-python-contrib/instrumentation/opentelemetry-instrumentation-psycopg2/tests/test_psycopg2_integration.py
Line 210 in 46d2ce6
but it doesn't get the error because it's a mock connection.
The text was updated successfully, but these errors were encountered: