diff --git a/instrumentation/opentelemetry-instrumentation-dbapi/src/opentelemetry/instrumentation/dbapi/__init__.py b/instrumentation/opentelemetry-instrumentation-dbapi/src/opentelemetry/instrumentation/dbapi/__init__.py index fc3911f744..992068d570 100644 --- a/instrumentation/opentelemetry-instrumentation-dbapi/src/opentelemetry/instrumentation/dbapi/__init__.py +++ b/instrumentation/opentelemetry-instrumentation-dbapi/src/opentelemetry/instrumentation/dbapi/__init__.py @@ -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. @@ -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. @@ -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)