ableegoldman commented on code in PR #12235: URL: https://github.com/apache/kafka/pull/12235#discussion_r888672094
########## streams/src/main/java/org/apache/kafka/streams/processor/internals/RecordCollectorImpl.java: ########## @@ -199,6 +201,7 @@ public <K, V> void send(final String topic, log.trace("Failed record: (key {} value {} timestamp {}) topic=[{}] partition=[{}]", key, value, timestamp, topic, partition); } }); + return recordSizeInBytes(keyBytes == null ? 0 : keyBytes.length, valBytes == null ? 0 : valBytes.length, topic, headers); Review Comment: Yes that's a good point -- I fixed this up by moving the sensors to the `RecordCollectorImpl` class and recording the metric in the callback of the Producer's `send` method only upon success. Thanks for clarifying -- 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