You are viewing a plain text version of this content. The canonical link for it is here.
Posted to jira@kafka.apache.org by "Rens Groothuijsen (Jira)" <ji...@apache.org> on 2022/08/10 00:09:00 UTC

[jira] [Commented] (KAFKA-14081) Cannot get my MetricsReporter implementation to receive meaningful metrics

    [ https://issues.apache.org/jira/browse/KAFKA-14081?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17577677#comment-17577677 ] 

Rens Groothuijsen commented on KAFKA-14081:
-------------------------------------------

I had a look at the source code, and it does appear that {{metricChange()}} is only being called when adding a metric, not when a metric changes. Given that the documentation of {{metricChange()}} says otherwise, I assume this was accidentally removed at some point.

> Cannot get my MetricsReporter implementation to receive meaningful metrics
> --------------------------------------------------------------------------
>
>                 Key: KAFKA-14081
>                 URL: https://issues.apache.org/jira/browse/KAFKA-14081
>             Project: Kafka
>          Issue Type: Bug
>          Components: clients
>    Affects Versions: 3.3.0
>            Reporter: Gian Luca
>            Priority: Minor
>
> I want to extract metrics from KafkaProducer to export them to our company monitoring solution. At first I went for implementing {{MetricsReporter}} and registering my implementation through the "metric.reporters" config property. The class is correctly registered as it receives metric updates through {{metricChange()}} while KafkaProducer is being used. The problem is that all the metric values are stuck at zero (NaN in older versions of Kafka), even the most trivial (e.g. 'record-send-total').
> If instead of using a report I simply poll the {{metrics()}} method of the KafkaProducer, then I see meaningful values: counters increasing over time, etc.



--
This message was sent by Atlassian Jira
(v8.20.10#820010)