Want idea for get alert for any query running more than 10 mins in mysql

Is there a way to monitor for Long-running queries on a MySQL database and have a dashboard, so that we can set up alerts if a query is running for more than x minutes on a DB server. Can someone please point me in the right direction, please

Thanks in advance.

Hi Ajithkumar,

You may use metric mysql_global_status_slow_queries for getting amount of slow queries.

e.g.

3 Likes

Look at long_query_time value in order to populate the metric adivinho mentioned.

3 Likes

Thank you @adivinho @igroene

1 Like

hi sir,
pls can u give me a metric query for that dashboard

https://dev.mysql.com/doc/refman/8.0/en/slow-query-log.html