You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
While using opentracing-python-instrumentation for Postgres connection I noticed that the calls made inside the python with resources block are not being traced.
The DB calls made in the following code block is properly traced:
conn = get_connection() // <--- this method returns the connection object already created at initialization
cur = conn.cursor()
cur.execute("SELECT 1")
cur.close()
However, if written with with resources the calls are not being traced:
with get_connection() as conn:
with conn.cursor() as cur:
cur.execute("SELECT 1")
or even the following does not work :
conn = get_connection()
with conn.cursor() as cur:
cur.execute("SELECT 1")
Based on my debugging, I see that the call to ConnectionWrapper.cursor (in file _dbapi2.py) is not made when the cursor is called from within the with resources block, and then the subsequent calls to 'execute' hook (in psycopg2.py) are never made.
The text was updated successfully, but these errors were encountered:
While using
opentracing-python-instrumentation
for Postgres connection I noticed that the calls made inside the pythonwith resources
block are not being traced.The DB calls made in the following code block is properly traced:
However, if written with
with resources
the calls are not being traced:or even the following does not work :
Based on my debugging, I see that the call to
ConnectionWrapper.cursor
(in file _dbapi2.py) is not made when the cursor is called from within thewith resources
block, and then the subsequent calls to 'execute' hook (in psycopg2.py) are never made.The text was updated successfully, but these errors were encountered: