Skip to content

psycopg2/psycopg: Add instrument_connection check for if provided connection already instrumented #3138

Open
@tammy-baylis-swi

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

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions