guozhangwang commented on a change in pull request #11149:
URL: https://github.com/apache/kafka/pull/11149#discussion_r693539139



##########
File path: 
streams/src/main/java/org/apache/kafka/streams/processor/internals/metrics/StreamsMetricsImpl.java
##########
@@ -200,6 +201,30 @@ public RocksDBMetricsRecordingTrigger 
rocksDBMetricsRecordingTrigger() {
         }
     }
 
+    public <T> void addThreadLevelImmutableMetric(final String name,
+        final String description,
+        final String threadId,
+        final T value) {
+        final MetricName metricName = metrics.metricName(
+            name, THREAD_LEVEL_GROUP, description, 
threadLevelTagMap(threadId));
+        synchronized (threadLevelMetrics) {

Review comment:
       Yes, I'm only suggesting this as to keep things consistent, not really a 
correctness issue.
   
   As for `external` metrics, when users create their own metrics I think they 
are responsible for e.g. de-registering them upon closure, not Streams itself.




-- 
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