hudeqi commented on code in PR #13924:
URL: https://github.com/apache/kafka/pull/13924#discussion_r1247947464


##########
core/src/main/scala/kafka/log/LogCleanerManager.scala:
##########
@@ -88,17 +88,21 @@ private[log] class LogCleanerManager(val logDirs: Seq[File],
   /* for coordinating the pausing and the cleaning of a partition */
   private val pausedCleaningCond = lock.newCondition()
 
+  // Avoid adding legacy tags for a metric when initializing 
`LogCleanerManager`
+  GaugeMetricNameWithTag.clear()
   /* gauges for tracking the number of partitions marked as uncleanable for 
each log directory */
   for (dir <- logDirs) {
-    metricsGroup.newGauge("uncleanable-partitions-count",
+    metricsGroup.newGauge(UncleanablePartitionsCountMetricName,
       () => inLock(lock) { 
uncleanablePartitions.get(dir.getAbsolutePath).map(_.size).getOrElse(0) },
       Map("logDirectory" -> dir.getAbsolutePath).asJava
     )
+    
GaugeMetricNameWithTag.computeIfAbsent(UncleanablePartitionsCountMetricName, k 
=> new java.util.ArrayList[java.util.Map[String, String]]())
+      .add(Map("logDirectory" -> dir.getAbsolutePath).asJava)

Review Comment:
   committed the update.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: jira-unsubscr...@kafka.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org

Reply via email to