Skip to content

Commit 1d928a8

Browse files
committed
Update Comment why we use thread-id for including in metric registration
1 parent dfc6ab1 commit 1d928a8

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

streams/src/main/java/org/apache/kafka/streams/internals/metrics/StreamsThreadMetricsDelegatingReporter.java

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -58,9 +58,11 @@ public void metricChange(final KafkaMetric metric) {
5858
}
5959
}
6060
/*
61-
The KafkaMetric object is a singleton object shared by all StreamThread instances.
62-
So we need to make sure we only register metrics for the current StreamThread otherwise
63-
Kafka Streams would register multiple metrics for all StreamThread instances.
61+
The KafkaMetric object is a singleton shared by all StreamThread instances.
62+
So we need to make sure we only pass metrics for the current StreamThread that contains this
63+
MetricsReporter instance, which will register metrics with the embedded KafkaConsumer to pass
64+
through the telemetry pipeline.
65+
Otherwise, Kafka Streams would register multiple metrics for all StreamThreads.
6466
*/
6567
private boolean tagMatchStreamOrStateUpdaterThreadId(final KafkaMetric metric) {
6668
final Map<String, String> tags = metric.metricName().tags();

0 commit comments

Comments
 (0)