rodesai commented on a change in pull request #11149: URL: https://github.com/apache/kafka/pull/11149#discussion_r688242729
########## 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: not sure I follow the question here - we are using `threadLevelMetrics` to track the metrics for each thread so they can be cleaned up later on when the thread exits. What's wrong with using the thread id for that? -- 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