Build Real‑Time MySQL Monitoring & Alerting with Prometheus on Alibaba Cloud
This guide explains why MySQL monitoring is critical, defines five key metric dimensions, shows how to collect them with Prometheus and the MySQL Exporter, provides ready‑to‑use alert rules, and walks through the full setup and dashboard creation on Alibaba Cloud.
Why Monitor MySQL?
MySQL is one of the most widely used relational databases, and its performance directly impacts the availability of applications. Monitoring key MySQL metrics helps operations teams detect anomalies early, improve system reliability, and enhance user experience.
Key Metric Dimensions
The guide adopts Google’s four golden signals (Latency, Traffic, Saturation, Errors) and refines them for MySQL into five dimensions: availability, connections, queries, traffic, and files.
Choosing the Monitoring Stack
Prometheus is recommended for cloud‑native environments because it is open‑source, avoids vendor lock‑in, and integrates with the community‑maintained mysqld_exporter. Alibaba Cloud offers a one‑click Prometheus integration that deploys the exporter and provides ready‑made dashboards.
Pre‑built Alert Rules
MySQL Down : mysql_up{${instance}} != 1 Instance Uptime (alert if running less than 30 minutes): mysql_global_status_uptime{${instance}} < 1800 Slow Queries :
rate(mysql_global_status_slow_queries{${instance}}[5m]) > 0Connection Errors :
rate(mysql_global_status_connection_errors_total{${instance}}[5m]) > 0Connection Usage (alert if > 90 %):
100 * mysql_global_status_threads_connected{${instance}} / mysql_global_variables_max_connections{${instance}} > 90Open Files Limit :
mysql_global_variables_open_files_limit - mysql_global_variables_innodb_open_filesInnoDB Log Wait Time :
rate(mysql_global_status_innodb_log_waits{${instance}}[5m])Setup Steps
Enable Alibaba Cloud Prometheus service.
Deploy Prometheus (for containers or ECS) and the MySQL Exporter.
Provide MySQL connection details (host, port, user, password) in the integration center.
Verify connectivity with the built‑in connection test.
After installation, view the auto‑generated dashboards, metrics, and targets.
Configuring Alerts
In the Prometheus console, navigate to MySQL Integration → Alerts → Create Alert Rule , then specify the alert name, group, metric, and threshold using the expressions above.
Monitoring Dashboards
The service provides a ready‑made dashboard showing availability, QPS, connections, query performance, traffic, memory usage, and file metrics.
About Alibaba Cloud Prometheus
Alibaba Cloud Prometheus is a fully managed, cloud‑native observability service built on the open‑source Prometheus project. It integrates with common cloud services, supports Grafana dashboards, intelligent alerts, and provides high‑performance probes. The platform enables rapid, one‑stop metric collection, storage, and analysis for databases, applications, and infrastructure.
Signed-in readers can open the original source through BestHub's protected redirect.
This article has been distilled and summarized from source material, then republished for learning and reference. If you believe it infringes your rights, please contactand we will review it promptly.
Alibaba Cloud Native
We publish cloud-native tech news, curate in-depth content, host regular events and live streams, and share Alibaba product and user case studies. Join us to explore and share the cloud-native insights you need.
How this landed with the community
Was this worth your time?
0 Comments
Thoughtful readers leave field notes, pushback, and hard-won operational detail here.
