Details
-
Improvement
-
Status: Open
-
Major
-
Resolution: Unresolved
-
None
-
None
-
None
Description
When we added client metrics we had to move the StreamsMetricsImpl object to the client level. That means that now instead of having one StreamsMetricsImpl object per thread, we have now one per client. That also means that we cannot store the thread ID in the StreamsMetricsImpl anymore. Currently, we get the thread ID from Thread.currentThread().getName() when we need to create a sensor. However, that is not robust against code refactoring because we need to ensure that the thread that creates the sensor is also the one that records the metrics. To be more flexible, we should expose the ID of the thread that executes a processor in the InternalProcessorContext like it already exposes the task ID.