mysqld_exporter icon indicating copy to clipboard operation
mysqld_exporter copied to clipboard

Slave monitoring for alerting purpose

Open Shubham1406220 opened this issue 1 year ago • 0 comments

we have setup the exporter for monitoring master and slave. We are scraping only master nodes of mysql. What query to set foe getting the slave status and whether replication is working fine or not.

systemd file:

[Unit]
Description=Mysqld Exporter
After=network.target

[Service]
Type=simple
User=mysqld_exporter
Group=mysqld_exporter
Restart=on-failure
ExecStart=/usr/local/bin/mysqld_exporter --config.my-cnf="/etc/mysqld_exporter/mysql.cnf" --collect.slave_hosts --collect.info_schema.processlist --collect.info_schema.replica_host --collect.info_schema.tables.databases="*"  --collect.perf_schema.memory_events --collect.perf_schema.tableiowaits --collect.slave_status

[Install]

  - job_name: mysql 
    static_configs:
      - targets:
        - x.x.x.x3306
    relabel_configs:
      - source_labels: [__address__]
        target_label: __param_target
      - source_labels: [__param_target]
        target_label: instance
      - target_label: __address__
        replacement: localhost:9104

Shubham1406220 avatar Feb 16 '24 09:02 Shubham1406220