stevenschlansker commented on code in PR #20328:
URL: https://github.com/apache/kafka/pull/20328#discussion_r2409407367


##########
clients/src/main/java/org/apache/kafka/common/metrics/Metrics.java:
##########
@@ -192,9 +193,13 @@ public Metrics(MetricConfig defaultConfig, 
List<MetricsReporter> reporters, Time
      * @param tags        additional key/value attributes of the metric
      */
     public MetricName metricName(String name, String group, String 
description, Map<String, String> tags) {
-        Map<String, String> combinedTag = new LinkedHashMap<>(config.tags());
-        combinedTag.putAll(tags);
-        return new MetricName(name, group, description, combinedTag);
+        Map<String, String> combinedTag = new LinkedHashMap<>();
+        BiConsumer<String, String> combine = (k, v) -> {
+            combinedTag.put(k.intern(), v.intern());
+        };
+        config.tags().forEach(combine);
+        tags.forEach(combine);

Review Comment:
   Thanks for taking a look. Makes sense, I removed this change.



-- 
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: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to