Prometheus

dbbot provides a set of monitoring deployment and access solutions for the MySQL ecosystem, including:

  • Prometheus: responsible for collection and rule calculation
  • Grafana: Responsible for dashboard display
  • Alertmanager: Responsible for alarm notification
  • node_exporter: responsible for Linux host metrics
  • mysqld_exporter: responsible for MySQL instance metrics
  • exporterregistrar: Responsible for registering the exporter endpoint to the Prometheus file_sd target file

Applicable scenarios

  • Monitor a single instance of MySQL
  • Monitor one master and multiple replicas replication
  • Monitor MGR/InnoDB Cluster
  • Monitor multiple MySQL instances on the same server

Deployment components

Default deployment entry:

cd /usr/local/dbbot/monitoring_prometheus_ansible/playbooks
ansible-playbook monitoring_prometheus_deployment.yml

Default exporter deployment entry:

cd /usr/local/dbbot/mysql_ansible/playbooks
ansible-playbook exporter_install.yml
  1. Prometheus monitoring MySQL quick start
  2. mysqld_exporter related
  3. Official test supported software versions and download links

Key points for use

  • Prometheus, Grafana, and Alertmanager are recommended to be deployed independently on monitoring nodes.
  • It is recommended that the exporter be deployed on the same host as the MySQL instance.
  • mysqld_exporter_port uses auto by default and will be automatically derived according to the MySQL port, suitable for multi-instance scenarios.
  • exporterregistrar is used to update Prometheus’ file_sd target list to avoid manual editing of YAML.

Validation entry

  • Prometheus:http://<monitor_ip>:9090
  • Grafana:http://<monitor_ip>:3000
  • Alertmanager:http://<monitor_ip>:9093