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

Expose mysql binlog position via JMX

    XMLWordPrintable

Details

    • Feature Request
    • Status: Closed (View Workflow)
    • Critical
    • Resolution: Done
    • 0.3.2
    • 0.3.4, 0.4
    • mysql-connector
    • 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.

      Attachments

        Activity

          People

            rhauch Randall Hauch
            vhorodchuk Vitalii Horodchuk (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: