Uploaded image for project: 'Debezium'
  1. Debezium
  2. DBZ-134

Expose mysql binlog position via JMX

    Details

    • Type: Feature Request
    • Status: Resolved (View Workflow)
    • Priority: Critical
    • Resolution: Done
    • Affects Version/s: 0.3.2
    • Fix Version/s: 0.3.4, 0.4
    • Component/s: mysql-connector
    • Labels:
      None

      Description

      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.

        Gliffy Diagrams

          Attachments

            Activity

              People

              • Assignee:
                rhauch Randall Hauch
                Reporter:
                vhorodchuk Vitalii Horodchuk
              • Votes:
                0 Vote for this issue
                Watchers:
                2 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: