[
https://issues.apache.org/jira/browse/KAFKA-19398?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17959602#comment-17959602
]
Matthias J. Sax edited comment on KAFKA-19398 at 6/11/25 2:05 AM:
------------------------------------------------------------------
Thanks for filing this ticket. – I am not sure from top of my head, what the
contract is. The JavaDocs don't say anything about it. In general, I would
assume that returning `null` is fine though. Let me ask a few other committers
about it.
One more thought: it seems unlikely that there will be a 3.9.2 release. So for
Micronaut, it might make sense to fix in any case.
was (Author: mjsax):
Thanks for filing this ticket. – I am not sure from top of my head, what the
contract is. The JavaDocs don't say anything about it. In general, I would
assume that returning `null` is fine though. Let me ask a few other committers
about it.
> Error getting oldest-iterator-open-since-ms causes NPE in micrometer
> --------------------------------------------------------------------
>
> Key: KAFKA-19398
> URL: https://issues.apache.org/jira/browse/KAFKA-19398
> Project: Kafka
> Issue Type: Bug
> Components: streams
> Affects Versions: 3.9.1, 4.0.0
> Reporter: Arne Klein
> Priority: Major
>
> After the fix for https://issues.apache.org/jira/browse/KAFKA-17954 was
> applied, Micrometer can now run into a null pointer exception when reading
> the `kafka.stream.state.oldest.iterator.open.since.ms` metric.
> java.lang.NullPointerException: Cannot invoke
> "java.lang.Number.doubleValue()" because the return value of
> "org.apache.kafka.common.Metric.metricValue()" is null
> at
> io.micrometer.core.instrument.binder.kafka.KafkaMetrics.toDouble(KafkaMetrics.java:326)
> ~[micrometer-core-1.14.7]
> at
> io.micrometer.core.instrument.binder.kafka.KafkaMetrics.lambda$toMetricValue$6(KafkaMetrics.java:322)
> ~[micrometer-core-1.14.7]
> While the NPE can also be fixed in
> [Micrometer|https://github.com/micrometer-metrics/micrometer/issues/6324#issuecomment-2960557766],
> I'm unsure if this is the intended behaviour for emitting metrics.
>
>
--
This message was sent by Atlassian Jira
(v8.20.10#820010)