When the APM SQL agent log is set to use DEBUG logging , the agent log will give information about the JDBC class which created the "Unknown SQL" metric. For example:
[DEBUG] [IntroscopeAgent.Agent] Please insert "SkipClass: com.microsoft.sqlserver.jdbc.SQLServerPreparedStatement" in .pbd to suppress "Unknown SQL" metrics.
You can skip this class from the the SQLagent pdb to avoid the creation of new "unknown SQL” metrics
Any existing "Unknown SQL” metrics will be purged when they reached the aging limit for metric data