File tree Expand file tree Collapse file tree 1 file changed +5
-10
lines changed
instrumentation/opentelemetry-instrumentation-dbapi/src/opentelemetry/instrumentation/dbapi Expand file tree Collapse file tree 1 file changed +5
-10
lines changed Original file line number Diff line number Diff line change @@ -458,21 +458,16 @@ def traced_execution(
458458 "libpq_version" : libpq_version ,
459459 }
460460 )
461-
462- elif self ._db_api_integration .database_system == "mysql" :
463- db_driver = self ._db_api_integration .connect_module .__name__
464-
461+ elif self ._db_api_integration .database_system == "mysql" :
465462 mysqlc_version = ""
466463 if db_driver == "mysql.connector" :
467- # TODO Version of mysql.connector not same as mysql C API
468- mysqlc_version = self ._db_api_integration .connect_module .__version__
469- elif db_driver == "MySQLdb" :
470- # TODO
471- mysqlc_version = "TODO"
464+ mysqlc_version = cursor ._cnx ._cmysql .get_client_info ()
465+ if db_driver == "MySQLdb" :
466+ mysqlc_version = self ._db_api_integration .connect_module ._mysql .get_client_info ()
472467
473468 commenter_data .update (
474469 {
475- "mysqlc_version " : mysqlc_version ,
470+ "mysql_client_version " : mysqlc_version ,
476471 }
477472 )
478473
You can’t perform that action at this time.
0 commit comments