MySQL MGR / Group Replication Monitoring & Troubleshooting - V2.1 RC10062026
Multi-cluster MySQL 8.0 Group Replication dashboard for Grafana. V2.1 RC9 clean-line refinement: workload panels use zero area fill, 2px lines, no points, linear interpolation, sorted multi-series tooltips, four dedicated DML panels, separate Connections and Threads Running panels, and dual-axis TPS vs MGR queue correlation.
#Grafana version :Grafana v12.0.1 (80658a73c5) #operating system :Ubuntu 22.04.3 LTS
MySQL MGR / Group Replication Monitoring & Troubleshooting
Production-oriented Grafana dashboard for monitoring multiple MySQL 8.0 Group Replication (MGR) single-primary clusters with Prometheus and mysqld_exporter.
Dashboard coverage
- Fleet health and healthy-cluster summary
- ONLINE member and PRIMARY counts
- Member role/state overview
- MGR member inventory
- Certification queue and responsible database node
- Remote applier queue and responsible database node
- Certification conflict rate and responsible database node
- Local rollback rate and responsible database node
- Certification/applier queue trends
- Conflict/rollback trends
- Group Replication transaction throughput
- Multi-cluster filtering by
job,regionand exporterinstance
Requirements
- Grafana with a Prometheus datasource
- Prometheus
- mysqld_exporter
- MySQL 8.0 Group Replication
Required mysqld_exporter collectors
The deployment used to validate this dashboard enables:
--collect.global_status
--collect.info_schema.innodb_metrics
--collect.engine_innodb_status
--collect.perf_schema.tablelocks
--collect.perf_schema.eventsstatements
--collect.perf_schema.eventsstatementssum
--collect.perf_schema.eventswaits
--collect.perf_schema.replication_group_members
--collect.perf_schema.replication_group_member_stats
--collect.slave_status
For the MGR-specific panels, these two collectors are essential:
--collect.perf_schema.replication_group_members
--collect.perf_schema.replication_group_member_stats
The first supplies MGR member topology/state/role. The second supplies certification queue, remote applier queue, conflict, rollback and Group Replication transaction metrics.
systemd example
Example file:
/etc/systemd/system/mysqld_exporter.service
[Unit]
Description=MySQL Exporter
After=network.target
Wants=network.target
[Service]
Type=simple
User=mysql
Group=mysql
WorkingDirectory=/opt/mysqld_exporter
ExecStart=/opt/mysqld_exporter/mysqld_exporter
–config.my-cnf=/opt/mysqld_exporter/.my.cnf
–collect.global_status
–collect.info_schema.innodb_metrics
–collect.engine_innodb_status
–collect.perf_schema.tablelocks
–collect.perf_schema.eventsstatements
–collect.perf_schema.eventsstatementssum
–collect.perf_schema.eventswaits
–collect.perf_schema.replication_group_members
–collect.perf_schema.replication_group_member_stats
–collect.slave_status
–web.listen-address=:9104
Restart=always
RestartSec=3
StandardOutput=syslog
StandardError=syslog
SyslogIdentifier=mysqld_exporter
[Install]
WantedBy=multi-user.target
After creating or changing the unit:
systemctl daemon-reload
systemctl restart mysqld_exporter
systemctl status mysqld_exporter
Confirm metrics are exposed on port 9104 before importing the dashboard.
Prometheus file_sd labels
This dashboard supports a region label and uses a role label as the
human-readable database node name.
Example:
[
{
"targets": ["103.214.126.156:9104"],
"labels": {
"region": "AB",
"role": "AB-mgr-01"
}
},
{
"targets": ["147.131.144.112:9104"],
"labels": {
"region": "AB",
"role": "AB-mgr-02"
}
}
]
Using role allows Grafana to display readable node names such as:
Remote Applied · AB-mgr-01
Local Proposed ·AB-mgr-02
instead of exporter endpoints such as 103.214.126.156:9104.
Queue / conflict summary behavior
The four troubleshooting summary panels identify the database node associated with the highest current non-zero value:
- Certification Queue
- Remote Applier Queue
- Conflict Rate
- Local Rollback Rate
Example:
1
AB-mgr-01
When every selected node reports zero, the panels show CLEAR,
NO CONFLICTS, or NO ROLLBACKS without assigning the healthy value to an
arbitrary host.
Import
- Open Grafana.
- Go to Dashboards → New → Import.
- Upload
mysql-mgr-group-replication-monitoring-v1.0.0.json. - Select the Prometheus datasource.
- Import the dashboard.
- Select the required
job,region, andinstancefilters.
Notes
The fleet-health logic in this release is designed for 3-node, single-primary MGR clusters: one ONLINE PRIMARY and three ONLINE members per cluster.
Queue trend is generally more important than a brief non-zero spike. A certification or applier queue that continues to grow should be investigated.
Release
v1.0.0 — initial community release. v2.0.0 — Added performance monitoring metrics such as TPS and OPS. v1.0.0 — 1,Optimized the statistical method for "Online Members. 2.Add a column at the top labeled "Affected MGR Members." This means displaying the hosts flagged as anomalous in "Fleet Health" within the "Affected MGR Members" column.
Author
Created and maintained by diagdba@gmail.com;
Database Administrator / DevOps Engineer focused on MySQL, MySQL Group Replication, Oracle, PostgreSQL, TiDB, MySQL database reliability, performance tuning and automation.
For bug reports, feature requests and contributions, please use the project's GitHub repository.
Contributing
Issues, suggestions and pull requests are welcome.
If you are using this dashboard with a different MGR topology, mysqld_exporter version, or Prometheus labeling strategy, feedback and compatibility reports are especially welcome.
Data source config
Collector config:
Upload an updated version of an exported dashboard.json file from Grafana
| Revision | Description | Created | |
|---|---|---|---|
| Download |
MySQL
Monitor MySQL with Grafana. Easily monitor your MySQL deployment with Grafana Cloud's out-of-the-box monitoring solution.
Learn more