You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@kafka.apache.org by Diego Alvarez Zuluaga <di...@gmail.com> on 2015/11/27 01:54:14 UTC

How to tell if producer is producing messages to server?

Hi

Using 0.8.2

I'm making a service status check and I want to include a kafka producer
check.

I was trying to use the kafka producer metrics
https://github.com/apache/kafka/blob/0.8.2/clients/src/main/java/org/apache/kafka/clients/producer/KafkaProducer.java#L74
and I was planning to schedule a message every 3-5 min to het the producer
metrics and look for metric *record-error-rate* to see if it's > 0.

During my tests, I'm blocking (iptables) producer from server, but every
time the value that I get is *0*, the only think that I'm seeing different
from the metrics is the *requests-in-flight* that moves from 0 to 5, but I
don't know if that's a good measure to know if the producer can talk to the
server.

After some minutes of producer cant talk to the server, I started receiving
this messages in the log:
```
2015-11-26 23:18:29,302 DEBUG [o.apache.kafka.clients.NetworkClient] [] -
Trying to send metadata request to node 2
```
but now the metric  *requests-in-flight *returned 0.

So, how can I tell from the producer side if it's sending messages to kafka
producer? is there any exposed API for that? is there any other metric?

Thank you.