In older versions of Debezium using SQL Server as an example, metrics were available using the following naming strategy:
debezium.sql_server:type=connector-metrics,server=<sqlserver.server.name>,context=<context>
In new release debezium 2.0, the naming strategy now includes a new task component in the JMX MBean name:
debezium.sql_server:type=connector-metrics,server=<sqlserver.server.name>,task=<task.id>,context=<context>
I have created the objectName as per new naming strategy of debezium and passed to the JmxAttributeGauge. The values are not getting populated and null is coming on getValue()
objectName = new ObjectName("debezium.sql_server:type=connector-metrics,server=serverName,task=0,context=snapshot");
JmxAttributeGauge isSnapshotRunningJmx = new JmxAttributeGauge(objectName, "attribute_value");
System.out.println(isSnapshotRunningJmx.getValue()); // It returns null
I have already verified the objectName from the Jconsole. It is correct.