kafka-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Rajkumar Natarajan <raj.cs....@gmail.com>
Subject What is the node-id tag in kafka producer MetricName ?
Date Tue, 03 Dec 2019 21:36:52 GMT
I've have kafka producer running same code from 3 different linux servers
sending messages to same kafka cluster topic. Below is the sample code -

    KafkaProducer<?, byte[]> producer = new KafkaProducer<?, byte[]>(props);
    Map<MetricName, ? extends Metric> metrics =  producer.metrics();
    System.out.println(metrics.keySet());

The sample of the MetricName produced by the above code  from one of the
server -

MetricName [name=request-rate, group=producer-node-metrics, description=The
number of requests sent per second, tags={client-id=ImpLog,
node-id=node--3}],

MetricName [name=request-rate, group=producer-node-metrics, description=The
number of requests sent per second, tags={client-id=ImpLog,
node-id=node--2}],

MetricName [name=request-rate, group=producer-node-metrics, description=The
number of requests sent per second, tags={client-id=ImpLog,
node-id=node--1}],

MetricName [name=request-total, group=producer-node-metrics,
description=The total number of requests sent, tags={client-id=ImpLog,
node-id=node--1}],

So my question is what is node-id=node--3 tag of the kafka producer
MetricName. Is it identifies the kafka producer metircs to one of the kafka
broker instance?


I've asked this question in SO
https://stackoverflow.com/questions/59132349/what-is-the-node-id-tag-in-kafka-producer-metricname-for-and-how-can-i-get-it-fr

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message