I am trying to expose the Kafka producer data to actuator/Prometheus but unfortunately not working with spring boot 2.2.6 and Kafka 2.3.7(auto-configured).
Relevant code:
@Autowired
private KafkaTemplate<String, String> kafkaTemplate;
public <T> void publish(String data, String topicName) {
kafkaTemplate.send(topicName, data);
}
applicaiton.properties
spring.jmx.enabled=true
management.endpoint.health.show-details=always
management.endpoint.metrics.enabled=true
management.endpoint.prometheus.enabled=true
management.endpoints.web.exposure.include=*
management.metrics.distribution.percentiles-histogram.http.server.requests=tr
somewhere I read for spring 2.2 we have to enable jmx, but even after enabling it kafka producer data is not visible in Prometheus.