@Override
    public void processGauge(MetricName metricName, Gauge<?> gauge, Context context) {
        if (MetricsUtils.isInterested(metricName)) {
            if (LOG.isTraceEnabled()) {
                LOG.trace("Processing metric {} of type Gauge.", metricName);
            }
            if (!(gauge.value() instanceof Number)) {
                throw new IllegalStateException(String.format("The value of yammer metric %s is %s, which is not a number",
                        metricName, gauge.value()));
            }
            AutoBalancerMetrics ccm = MetricsUtils.toAutoBalancerMetric(context.time(),
                    context.brokerId(),
                    context.brokerRack(),
                    metricName,
                    ((Number) gauge.value()).doubleValue());
            context.merge(ccm);
        }
    }
This class was modified based on Cruise Control: com.linkedin.kafka.cruisecontrol.metricsreporter.metric.YammerMetricProcessor.
core/src/main/java/kafka/autobalancer/metricsreporter/metric/YammerMetricProcessor.java