Skip to content

Commit b0a9efd

Browse files
Add PyMySQL dbapi commenter case
1 parent 881f4af commit b0a9efd

File tree

1 file changed

+5
-1
lines changed
  • instrumentation/opentelemetry-instrumentation-dbapi/src/opentelemetry/instrumentation/dbapi

1 file changed

+5
-1
lines changed

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

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -410,7 +410,7 @@ def get_statement(self, cursor, args): # pylint: disable=no-self-use
410410
return statement.decode("utf8", "replace")
411411
return statement
412412

413-
def traced_execution(
413+
def traced_execution( # pylint: disable=too-many-branches
414414
self,
415415
cursor,
416416
query_method: typing.Callable[..., typing.Any],
@@ -479,6 +479,10 @@ def traced_execution(
479479
mysqlc_version = (
480480
self._db_api_integration.connect_module._mysql.get_client_info()
481481
)
482+
if db_driver == "pymysql":
483+
mysqlc_version = (
484+
self._db_api_integration.connect_module.get_client_info()
485+
)
482486

483487
commenter_data.update(
484488
{

0 commit comments

Comments
 (0)