From b0a9efd4acc6170cec7ce1f9396ba71218b40e86 Mon Sep 17 00:00:00 2001 From: tammy-baylis-swi Date: Wed, 9 Oct 2024 16:22:10 -0700 Subject: [PATCH] Add PyMySQL dbapi commenter case --- .../src/opentelemetry/instrumentation/dbapi/__init__.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) 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 0c256bc69d..4f72a03a85 100644 --- a/instrumentation/opentelemetry-instrumentation-dbapi/src/opentelemetry/instrumentation/dbapi/__init__.py +++ b/instrumentation/opentelemetry-instrumentation-dbapi/src/opentelemetry/instrumentation/dbapi/__init__.py @@ -410,7 +410,7 @@ def get_statement(self, cursor, args): # pylint: disable=no-self-use return statement.decode("utf8", "replace") return statement - def traced_execution( + def traced_execution( # pylint: disable=too-many-branches self, cursor, query_method: typing.Callable[..., typing.Any], @@ -479,6 +479,10 @@ def traced_execution( mysqlc_version = ( self._db_api_integration.connect_module._mysql.get_client_info() ) + if db_driver == "pymysql": + mysqlc_version = ( + self._db_api_integration.connect_module.get_client_info() + ) commenter_data.update( {