willbarrett commented on a change in pull request #13223:
URL: https://github.com/apache/superset/pull/13223#discussion_r580654643



##########
File path: superset/databases/api.py
##########
@@ -607,6 +612,11 @@ def test_connection(  # pylint: 
disable=too-many-return-statements
             TestConnectionDatabaseCommand(g.user, item).run()
             return self.response(200, message="OK")
         except DatabaseTestConnectionFailedError as ex:
+            engine = item["sqlalchemy_uri"].split("://")[0]
+            self.incr_stats(
+                f"db_test_connection_failed.{engine}.{ex.__class__.__name__}",

Review comment:
       `ex.__class__.__name__` will always be recorded as 
`DatabaseTestConnectionFailedError` if I understand this correctly. To capture 
the exception surfaced by the engine, you'd need to alter the command to 
surface that class name as part of the error object or move this logging into 
the command.




----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
[email protected]



---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to