Monitoring MySQL Router with mysqlrouter_exporter
#SRG(Service Reliability Group) mainly provides cross-sectional support for the infrastructure of our media services, improving existing services, launching new ones, contributing to OSS, etc.
This article is an introduction to the Prometheus Exporter for MySQL Router used in InnoDB Cluster.
mysqlrouter_exportermysqlrouter-goMetricsIt can also be used to monitor the status of MySQL Router.Grafana DashboardView dashboards by serviceHealth StatusRoute Active ConnectionsRoute Total ConnectionsAll Connections InformationRoute byte from/to serverConclusion
The images below contain service names and IP addresses for the purpose of testing and implementing this service as a personal service that is not related to the organization or company to which I belong.
mysqlrouter_exporter
An exporter that collects metrics from the MySQL Router REST API and outputs them in Prometheus format.
It is released as a container and a binary.
Since it is recommended to have one MySQL Router per app, the container image size of mysqlrouter_exporter is small at 22MB so that it can be easily used as a sidecar.
mysqlrouter-go
This exporter is powered by mysqlrouter-go, an SDK for the MySQL Router REST API.
Metrics
mysqlrouter_exporter captures all metrics exposed by the MySQL Router REST API.
It can also be used to monitor the status of MySQL Router.
mysqlrouter_router_up
0
Grafana Dashboard

We also publish a Grafana dashboard.
View dashboards by service

--service-name
This allows you to see information about the MySQL Router for each service and each container (host).
Health Status

You can see the health status of each Route.
If it is 1, the route is Up, if it is 0, the route is Down.
You can also check the number of nodes in the cluster and the number of hosts that are refused connection.
You can also indirectly check the status of Group Replication.
Route Active Connections

Displays the number of active connections for the destination Route.
Route Total Connections

Displays the total number of connections for the destination route.
All Connections Information

Shows which MySQL instance each route connects to and how much traffic it sends.
Route byte from/to server

Displays the amount of traffic generated by each route and connection.
Conclusion
If you are planning to build or are already using an InnoDB Cluster, try using mysqlrouter_exporter to monitor the MySQL Router.
SRG is looking for people to work with us. If you are interested, please contact us here.
SRG runs a podcast where we chat about the latest hot topics in IT and books. We hope you will enjoy listening to it while you work.