Emergency

How to add alerts for mysql server uptime/restart/shutdown

Collapse
X
  • Filter
  • Time
  • Show
Clear All
new posts

  • How to add alerts for mysql server uptime/restart/shutdown

    Hi,

    I am adding alerts for mysql instance using followed article https://www.percona.com/blog/2017/02...ed-dashboards/ . I am seeing alert tab for mysql connection/ thread cache and for all other alerts, but not for MySQL uptime. Is there any way to add alert for MySQL uptime?

  • #2
    Hi ivishnu7 , I haven't done this specific type of graph, but Prometheus allows for a metric called 'up', which is tracking whether mysqld_exporter is up. Perhaps you could create a graph using:
    Code:
    up{instance="ps57",job="mysql"}
    mysqld_exporter-up.PNG

    Comment


    • #3
      also mysql_global_status_uptime metric exists, it is possible to create graph with this metric and add alert on it.

      Comment


      • #4
        Thanks Michael and Mykola for update.

        Notes from Grafana: Currently only the graph panel supports alert rules but this will be added to the Single stat and Table panels as well in a future release.

        So as of now, we can't use Grafana for server uptime/restart/shutdown alerts unless they add alerts for Single stats.

        I am familiar with Grafana alerts set up but not with Prometheus alerts. So I am just going through how to add alerts using Prometheus. It would be great if share any useful documents regarding prometheus alerts set up. Thanks!

        Comment


        • #5
          prometheus alerting is not user-friendly, you can read more in official documentation https://prometheus.io/docs/alerting/overview/

          Alerts in Grafana simpler (if you have graph for needed metric):
          https://www.percona.com/blog/2017/01...m-and-grafana/
          https://www.percona.com/blog/2017/02...ed-dashboards/

          Comment

          Working...
          X