You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@kafka.apache.org by Rajkumar Natarajan <ra...@gmail.com> on 2019/12/03 21:36:52 UTC
What is the node-id tag in kafka producer MetricName ?
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
Re: What is the node-id tag in kafka producer MetricName ?
Posted by Eric Azama <ea...@gmail.com>.
Nodes with a negative id refer to the bootstrap servers you configured the
client with.
There are also metrics that report for nodes with an extremely large node
id. These are usually Integer.MAX_VALUE - (coordinator node id)
On Tue, Dec 3, 2019 at 1:37 PM Rajkumar Natarajan <ra...@gmail.com>
wrote:
> 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
>
Re: What is the node-id tag in kafka producer MetricName ?
Posted by Eric Azama <ea...@gmail.com>.
Nodes with a negative id refer to the bootstrap servers you configured the
client with.
There are also metrics that report for nodes with an extremely large node
id. These are usually Integer.MAX_VALUE - (coordinator node id)
On Tue, Dec 3, 2019 at 1:37 PM Rajkumar Natarajan <ra...@gmail.com>
wrote:
> 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
>