Skip to content

Commit 83f8e67

Browse files
Add docstring
1 parent 7fabfcf commit 83f8e67

File tree

1 file changed

+19
-0
lines changed
  • instrumentation/opentelemetry-instrumentation-dbapi/src/opentelemetry/instrumentation/dbapi

1 file changed

+19
-0
lines changed

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

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,16 @@
1919

2020

2121
class BaseTracedConnectionProxy(ABC, wrapt.ObjectProxy):
22+
"""ABC for traced database client connection proxy.
23+
24+
Child classes are used to wrap Connection objects and
25+
generate telemetry based on provided integration settings.
26+
27+
Child classes must implement cursor(), which should return
28+
a traced database client cursor proxy depending on database
29+
driver needs.
30+
"""
31+
2232
# pylint: disable=unused-argument
2333
def __init__(self, connection, *args, **kwargs):
2434
wrapt.ObjectProxy.__init__(self, connection)
@@ -45,6 +55,15 @@ def __exit__(self, *args, **kwargs):
4555

4656
# pylint: disable=abstract-method
4757
class BaseTracedCursorProxy(ABC, wrapt.ObjectProxy):
58+
"""ABC for traced database client cursor proxy.
59+
60+
Child classes are used to wrap Cursor objects and
61+
generate telemetry based on provided integration settings.
62+
63+
Child classes must implement __init__(), which should set
64+
a CursorTracer depending on database driver needs.
65+
"""
66+
4867
# pylint: disable=unused-argument
4968
@abstractmethod
5069
def __init__(self, cursor, *args, **kwargs):

0 commit comments

Comments
 (0)