Skip to content

Commit

Permalink
fix(pep0249): Use the wrapped value in CTX instead of unwrapped
Browse files Browse the repository at this point in the history
Signed-off-by: Ferenc Géczi <ferenc.geczi@ibm.com>
  • Loading branch information
Ferenc- committed Aug 28, 2023
1 parent 9407d3e commit af596a9
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions instana/instrumentation/pep0249.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,9 @@ def _collect_kvs(self, span, sql):
logger.debug(e)
return span

def __enter__(self):
return self

def execute(self, sql, params=None):
active_tracer = get_active_tracer()

Expand Down Expand Up @@ -103,6 +106,9 @@ def __init__(self, connection, module_name, connect_params):
self._module_name = module_name
self._connect_params = connect_params

def __enter__(self):
return self

def cursor(self, *args, **kwargs):
return CursorWrapper(
cursor=self.__wrapped__.cursor(*args, **kwargs),
Expand Down

0 comments on commit af596a9

Please sign in to comment.