disabled metrics gathering because currently method makeState(Map conf, IMetricsContext context, int partitionIndex, int numPartitions) is not called inside prepare(), than registerMetrics() is not called too, so all CountMetric variables stay un-initialized. Unitll this is resolved, it is better just to turn off those metrics. Alternative would be to initialize them during declaration with empty constructor.