Skip to content

Commit bd6be9c

Browse files
DbApi instrument_connection accepts optional connect_module
1 parent 23f67eb commit bd6be9c

File tree

1 file changed

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

1 file changed

+3
-0
lines changed

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

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -190,6 +190,7 @@ def instrument_connection(
190190
capture_parameters: bool = False,
191191
enable_commenter: bool = False,
192192
commenter_options: dict = None,
193+
connect_module: typing.Callable[..., typing.Any] = None,
193194
):
194195
"""Enable instrumentation in a database connection.
195196
@@ -204,6 +205,7 @@ def instrument_connection(
204205
capture_parameters: Configure if db.statement.parameters should be captured.
205206
enable_commenter: Flag to enable/disable sqlcommenter.
206207
commenter_options: Configurations for tags to be appended at the sql query.
208+
connect_module: Module name where connect method is available.
207209
208210
Returns:
209211
An instrumented connection.
@@ -221,6 +223,7 @@ def instrument_connection(
221223
capture_parameters=capture_parameters,
222224
enable_commenter=enable_commenter,
223225
commenter_options=commenter_options,
226+
connect_module=connect_module,
224227
)
225228
db_integration.get_connection_attributes(connection)
226229
return get_traced_connection_proxy(connection, db_integration)

0 commit comments

Comments
 (0)