title: Spring Boot Kafka - Kafka metrics not available in /actuator/prometheus
body: <p>I would like to monitor Kafka metrics but unfortunately nothing related to Kafka is present under /actuator/prometheus endpoint. Is anything missing in my setup?</p>
  <p><strong>Application dependencies</strong>: Kotlin 1.4.31, Spring Boot 2.3.9, Spring Kafka 2.6.7, Reactor Kafka 1.2.5, Kafka Clients 2.5.1</p>
  <p><strong>Application config</strong>:</p>
  <pre class="lang-yaml prettyprint-override"><code>    management:   
        server:
          port: 8081   
        endpoints:
          web:
            exposure:
              include: health,info,metrics,prometheus
      
      spring:
        jmx:
          enabled: true
        kafka:
          bootstrap-servers: ...
          consumer:
            group-id: my-service
            key-deserializer: org.apache.kafka.common.serialization.StringDeserializer
          listener:
            ack-mode: manual
          ssl:
            key-store-location: ...
            key-store-password: ...
          security:
            protocol: SSL
  </code></pre>
  <p><strong>My receivers look like</strong>:</p>
  <pre class="lang-kotlin prettyprint-override"><code>    @Bean
      fun someEventReceiver(): SomeEventReceiver =
          KafkaReceiver.create(
              ReceiverOptions.create&lt;String, SomeEvent&gt;(kafkaProperties.buildConsumerProperties())
                  .withValueDeserializer(SomeEvenDeserializer())
                  .subscription(listOf(serviceProperties.kafka.topics.someevent))
          )
  </code></pre>
  <p><strong>And listener</strong>:</p>
  <pre class="lang-kotlin prettyprint-override"><code>    @EventListener(ApplicationStartedEvent::class)
      fun onSomeEvent() {
          someEventReceiver
              .receive()
              .groupBy { it.receiverOffset().topicPartition() }
              .publishOn(Schedulers.boundedElastic())
              .flatMap { someEvent -&gt;
                  someEvent
                      .publishOn(Schedulers.boundedElastic())
                      .delayUntil(::handleEvent)
                      .doOnNext { it.receiverOffset().acknowledge() }
                      .retryWhen(Retry.backoff(10, Duration.ofMillis(100)))
              }
              .retryWhen(Retry.indefinitely())
              .subscribe()
      }
  </code></pre>