When creating database custom query metrics, if the queries are complex, they may return a timeout error message in the Database Agent logs.
For example from DB2 database:
Caused by: com.ibm.db2.jcc.am.SqlTimeoutException: DB2 SQL Error: SQLCODE=-952, SQLSTATE=57014, SQLERRMC=null, DRIVER=4.16.53
As a solution, a user can increase the timeout parameter by adding the following property in the DB Agent startup file, or as a system argument if DB Agent is started through a command prompt or terminal.
-Ddbagent.custommetric.query.timeout.seconds=<time_in_second>
Example:
-Ddbagent.custommetric.query.timeout.seconds=120