Hi, Spring community!
Sorry if I created this issue in the wrong place.
During the update process to spring-boot 2.2.2.RELEASE version, the Actuator Kafka consumer metrics were turned off, and they were not reachable with http://localhost:8080/actuator/metrics endpoint.
The metrics are working if I explicitly specify the versions of the Actuator and Spring Boot to 2.1.9.RELEASE.
I would appreciate if someone will have a look at the problem.
Kafka metrics should work the same with 2.2 as they did with 2.1. To help us to investigate why that is apparently not the case, can you please provide a small sample application that reproduces the problem?
Of course, I am using the following dependencies:
So I have just created a simple Kafka Stream API application.
And when I am accessing http://localhost:8080/actuator/metrics in the metrics list I can not see Kafka one. But when I used spring-boot-starter-parent 2.1.9.RELEASE (all other dependencies were auto-configured) in the metrics list were Kafka consumer metrics.
Thanks. Can you please turn that information into a small sample application that we can run? You can share it with us by zipping it up and attaching it to this issue or by pushing it to a separate repository on GitHub.
Sorry to hijack this. Isn't that caused by JMX not being enabled by default anymore in 2.2? KafkaMetricsAutoConfiguration is checking for an MBeanServer that isn't available when JMX is turned off. @IvanIschenko Can you try adding spring.jmx.enabled=true as a configuration property?
Ah, yes, thanks @dreis2211. That'll be what it is. I'd overlooked the side-effect of JMX now being disabled by default.
@IvanIschenko If this doesn't help, please provide the sample that I asked for above and we can re-open the issue and take another look.
Thanks @dreis2211 @wilkinsona for your help! Now it works
Most helpful comment
Sorry to hijack this. Isn't that caused by JMX not being enabled by default anymore in 2.2?
KafkaMetricsAutoConfigurationis checking for anMBeanServerthat isn't available when JMX is turned off. @IvanIschenko Can you try addingspring.jmx.enabled=trueas a configuration property?