-
Feature Request
-
Resolution: Done
-
Critical
-
0.3.2
-
None
We are using debezium mysql connector in our company. We need to have a metric that will say how far "slave(debezium) is behind master".
We could compare master binlog position and file with slave(debezium) position.
Debezium is using https://github.com/shyiko/mysql-binlog-connector-java which have feature Exposing BinaryLogClient through JMX.
Code example:
MBeanServer mBeanServer = ManagementFactory.getPlatformMBeanServer(); BinaryLogClient binaryLogClient = ... ObjectName objectName = new ObjectName("mysql.binlog:type=BinaryLogClient"); mBeanServer.registerMBean(binaryLogClient, objectName); // following bean accumulates various BinaryLogClient stats // (e.g. number of disconnects, skipped events) BinaryLogClientStatistics stats = new BinaryLogClientStatistics(binaryLogClient); ObjectName statsObjectName = new ObjectName("mysql.binlog:type=BinaryLogClientStatistics"); mBeanServer.registerMBean(stats, statsObjectName);
It would be very useful to have this metric for monitoring purposes.