Skip to content

Commit 569e811

Browse files
Use class attr in Base to fix sqlite3 integration
1 parent 83f8e67 commit 569e811

File tree

1 file changed

+4
-2
lines changed
  • instrumentation/opentelemetry-instrumentation-dbapi/src/opentelemetry/instrumentation/dbapi

1 file changed

+4
-2
lines changed

instrumentation/opentelemetry-instrumentation-dbapi/src/opentelemetry/instrumentation/dbapi/proxy.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -61,15 +61,17 @@ class BaseTracedCursorProxy(ABC, wrapt.ObjectProxy):
6161
generate telemetry based on provided integration settings.
6262
6363
Child classes must implement __init__(), which should set
64-
a CursorTracer depending on database driver needs.
64+
class variable _cursor_tracer as a CursorTracer depending
65+
on database driver needs.
6566
"""
6667

68+
_cursor_tracer = None
69+
6770
# pylint: disable=unused-argument
6871
@abstractmethod
6972
def __init__(self, cursor, *args, **kwargs):
7073
"""Wrap db client cursor for tracing"""
7174
wrapt.ObjectProxy.__init__(self, cursor)
72-
self._cursor_tracer = None
7375

7476
def callproc(self, *args, **kwargs):
7577
return self._cursor_tracer.traced_execution(

0 commit comments

Comments
 (0)