[ https://issues.apache.org/jira/browse/KAFKA-1800?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14227042#comment-14227042 ]
Guozhang Wang commented on KAFKA-1800: -------------------------------------- There is still a corner case after this patch that the per-topic metrics cannot be recorded because they are not registered: when KafkaProducer's waitOnMetadata throws a TimeoutException because the topic metadata is not available, this error cannot be recorded at the per-topic metrics because they are only registered at the sender level when the produce requests are being sent (in the patch it is changed to when the it is refreshed). To solve this issue, one proposal is that: 1. In Metrics.registerMetric() function, when the metric already exists, treat it as a no-op instead of throwing IllegalArgumentException. 2. Expose a registerSenderMetrics() API of sender in kafka producer, which will be triggered before metadata.awaitUpdate(version, remainingWaitMs) in waitForMetadata. This fix is a little bit hacky though, so I would like to hear opinions from other people? [~jkreps] > KafkaException was not recorded at the per-topic metrics > -------------------------------------------------------- > > Key: KAFKA-1800 > URL: https://issues.apache.org/jira/browse/KAFKA-1800 > Project: Kafka > Issue Type: Bug > Reporter: Guozhang Wang > Assignee: Guozhang Wang > Fix For: 0.9.0 > > Attachments: KAFKA-1800.patch > > > When KafkaException was thrown from producer.send() call, it is not recorded > on the per-topic record-error-rate, but only the global error-rate. > Since users are usually monitoring on the per-topic metrics, loosing all > dropped message counts at this level that are caused by kafka producer thrown > exceptions such as BufferExhaustedException could be very dangerous. -- This message was sent by Atlassian JIRA (v6.3.4#6332)