Detect and report slow database queries
When monitoring applications, an important and key aspect is often how the database is performing. Typically this can be one of the most common causes of latency, and being able to determine a poorly performing query can save significant time in the troubleshooting process.
Further if we can detect these prior to production, perhaps through the use of load testing (https://gitlab.com/gitlab-org/gitlab-ee/issues/3016) we can help companies avoid potential issues before they occur.
We should look at ways of detecting these queries for MySQL and PG databases.