You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@kafka.apache.org by Vladimir Tretyakov <vl...@sematext.com> on 2014/06/02 14:12:07 UTC

MetricId can be EMPTY in ProducerRequestMetrics

Hello everyone,

We are adding Kafka 0.8.x monitoring support to SPM
<http://sematext.com/spm/> here at Sematex and I have one question about
JMX Kafka beans:

In Jconsole for my local setup I see:

"kafka.producer:type=ProducerRequestMetrics,name=-
host_localhost-port_9092-ProducerRequestRateAndTimeMs"

Look at '-' before host -- something is clearly missing there, right?  In
Kafka code I see:

class ProducerRequestMetrics(metricId: ClientIdAndBroker) extends
KafkaMetricsGroup {

 val requestTimer = new KafkaTimer(newTimer(metricId +
"-ProducerRequestRateAndTimeMs", TimeUnit.MILLISECONDS, TimeUnit.SECONDS))

 val requestSizeHist = newHistogram(metricId + "-ProducerRequestSize")

}

For some reason metricId is EMPTY in my case, I don't know, maybe it is
common behavior, can I be sure it will not change with time? Maybe there
must be some value I don't see locally?

Thx and best regards from Sematext.

Re: MetricId can be EMPTY in ProducerRequestMetrics

Posted by Vladimir Tretyakov <vl...@sematext.com>.
Aha, I see, thx a lot.


On Mon, Jun 2, 2014 at 7:51 PM, Jun Rao <ju...@gmail.com> wrote:

> You will need to set the client.id property in the producer.
>
> Thanks,
>
> Jun
>
>
> On Mon, Jun 2, 2014 at 5:12 AM, Vladimir Tretyakov <
> vladimir.tretyakov@sematext.com> wrote:
>
> > Hello everyone,
> >
> > We are adding Kafka 0.8.x monitoring support to SPM
> > <http://sematext.com/spm/> here at Sematex and I have one question about
> > JMX Kafka beans:
> >
> > In Jconsole for my local setup I see:
> >
> > "kafka.producer:type=ProducerRequestMetrics,name=-
> > host_localhost-port_9092-ProducerRequestRateAndTimeMs"
> >
> > Look at '-' before host -- something is clearly missing there, right?  In
> > Kafka code I see:
> >
> > class ProducerRequestMetrics(metricId: ClientIdAndBroker) extends
> > KafkaMetricsGroup {
> >
> >  val requestTimer = new KafkaTimer(newTimer(metricId +
> > "-ProducerRequestRateAndTimeMs", TimeUnit.MILLISECONDS,
> TimeUnit.SECONDS))
> >
> >  val requestSizeHist = newHistogram(metricId + "-ProducerRequestSize")
> >
> > }
> >
> > For some reason metricId is EMPTY in my case, I don't know, maybe it is
> > common behavior, can I be sure it will not change with time? Maybe there
> > must be some value I don't see locally?
> >
> > Thx and best regards from Sematext.
> >
>

Re: MetricId can be EMPTY in ProducerRequestMetrics

Posted by Jun Rao <ju...@gmail.com>.
You will need to set the client.id property in the producer.

Thanks,

Jun


On Mon, Jun 2, 2014 at 5:12 AM, Vladimir Tretyakov <
vladimir.tretyakov@sematext.com> wrote:

> Hello everyone,
>
> We are adding Kafka 0.8.x monitoring support to SPM
> <http://sematext.com/spm/> here at Sematex and I have one question about
> JMX Kafka beans:
>
> In Jconsole for my local setup I see:
>
> "kafka.producer:type=ProducerRequestMetrics,name=-
> host_localhost-port_9092-ProducerRequestRateAndTimeMs"
>
> Look at '-' before host -- something is clearly missing there, right?  In
> Kafka code I see:
>
> class ProducerRequestMetrics(metricId: ClientIdAndBroker) extends
> KafkaMetricsGroup {
>
>  val requestTimer = new KafkaTimer(newTimer(metricId +
> "-ProducerRequestRateAndTimeMs", TimeUnit.MILLISECONDS, TimeUnit.SECONDS))
>
>  val requestSizeHist = newHistogram(metricId + "-ProducerRequestSize")
>
> }
>
> For some reason metricId is EMPTY in my case, I don't know, maybe it is
> common behavior, can I be sure it will not change with time? Maybe there
> must be some value I don't see locally?
>
> Thx and best regards from Sematext.
>