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
  • mysqlrouter_exporter: responsible for MySQL Router REST API 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

Independent exporter deployment entries:

cd /usr/local/dbbot/mysql_ansible/playbooks
ansible-playbook node_exporter_install.yml
ansible-playbook mysqld_exporter_install.yml

Router exporter deployment entry:

cd /usr/local/dbbot/mysql_ansible/playbooks
ansible-playbook router_exporter_install.yml
  1. Prometheus monitoring MySQL quick start
  2. node_exporter related
  3. mysqld_exporter related
  4. mysqlrouter_exporter and Router Registration
  5. 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.
  • node_exporter, mysqld_exporter, and mysqlrouter_exporter are now separate playbooks and can be combined as needed.
  • node_exporter is no longer installed implicitly with mysqld_exporter; if you already have host monitoring, you can skip it entirely.
  • mysqld_exporter_port uses auto by default and will be automatically derived according to the MySQL port, suitable for multi-instance scenarios.
  • Router metrics normally come from mysqlrouter_exporter, which depends on the Router REST API.
  • dbbotctl exporter register / exporterregistrar is used to update Prometheus file_sd targets and avoid manual YAML edits.

Validation entry

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