psycopg2/psycopg: Add instrument_connection check for if provided connection already instrumented #3138
Open
Description
What problem do you want to solve?
In working on a fix for #2522, we decided to temporarily remove the check for if the psycopg2 connection provided to instrument_connection
was already Otel-instrumented -- see PR comment. The logic originally introduced doesn't seem viable (AttributeError) but would still be good to have this feature.
Describe the solution you'd like
Add instrument_connection
check for if provided connection already instrumented by psycopg2/psycopg Otel instrumentors. Don't instrument the connection again, and just return it.
Describe alternatives you've considered
No response
Additional Context
No response
Would you like to implement a fix?
None