pixel
pixel

Reputation: 26473

Micrometer KafkaConsumerMetrics present when running locally but not when deployed

When I run locally I can see that kafka.consumer. are being collected. While when I deploy my service - I see that those metrics are not present.

I use kafka version 1.11.0, java 11 and Spring Boot 2.2.

How I can determine what is missing?

Upvotes: 1

Views: 634

Answers (1)

pixel
pixel

Reputation: 26473

In case anyone has this issue. I've had to explicitly add:

spring.jmx.enabled=true

It is needed since Kafka publishes data to jmx, and Micrometer reads it from there. By default jmx is disabled starting from Spring Boot 2.2.

It worked locally because IDEA added spring.jmx.enabled=true flag under the covers.

Upvotes: 5

Related Questions