Skip to content

Commit

Permalink
DbApi instrument_connection accepts optional connect_module
Browse files Browse the repository at this point in the history
  • Loading branch information
tammy-baylis-swi committed Nov 20, 2024
1 parent 23f67eb commit bd6be9c
Showing 1 changed file with 3 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -190,6 +190,7 @@ def instrument_connection(
capture_parameters: bool = False,
enable_commenter: bool = False,
commenter_options: dict = None,
connect_module: typing.Callable[..., typing.Any] = None,
):
"""Enable instrumentation in a database connection.
Expand All @@ -204,6 +205,7 @@ def instrument_connection(
capture_parameters: Configure if db.statement.parameters should be captured.
enable_commenter: Flag to enable/disable sqlcommenter.
commenter_options: Configurations for tags to be appended at the sql query.
connect_module: Module name where connect method is available.
Returns:
An instrumented connection.
Expand All @@ -221,6 +223,7 @@ def instrument_connection(
capture_parameters=capture_parameters,
enable_commenter=enable_commenter,
commenter_options=commenter_options,
connect_module=connect_module,
)
db_integration.get_connection_attributes(connection)
return get_traced_connection_proxy(connection, db_integration)
Expand Down

0 comments on commit bd6be9c

Please sign in to comment.