<p>I am running kafka on Kubernetes using the Strimzi operator. For monitoring I am using Prometheus and I followed the installation guide as described in Strimzi deployment guide.</p>
<p><a href="https://strimzi.io/docs/operators/master/deploying.html" rel="nofollow noreferrer">https://strimzi.io/docs/operators/master/deploying.html</a></p>
<p>For the Kafka cluster deployment I used the following template from strimzi repository. <a href="https://github.com/strimzi/strimzi-kafka-operator/blob/master/examples/metrics/kafka-metrics.yaml" rel="nofollow noreferrer">https://github.com/strimzi/strimzi-kafka-operator/blob/master/examples/metrics/kafka-metrics.yaml</a>  . The metrics  to be exposed to Prometheus are defined in a configmap in the same file.</p>
<p>My question  is that if I want <strong>Prometheus to scrape all the JMX metrics from Kafka</strong>; Is there any ready JMX configuration file  to pass to the configmap instead of the current one. <em>Please note that I am particularly interested in consumer group metrics (rebalance-latency-avg, rebalance-rate-per-hour, etc…).</em></p>
<p>Does monitoring kafka through JMX/prometheus cause any performance degradation to Kafka?</p>

Mazen Ezzeddine
<p>When you define the JMX Exporter configuration file as empty, for example something like this:</p>
<pre class="lang-yaml prettyprint-override"><code>kind: ConfigMap
apiVersion: v1
metadata:
  name: kafka-metrics
  labels:
    app: strimzi
data:
  kafka-metrics-config.yml: |
    lowercaseOutputName: true
</code></pre>
<p>It will export all metrics in the <em>raw</em> format. This allows you see all of them. However, they will look quite different from what you get with the Strimzi example because they will not have the rules which translate them, extract some parts as labels etc.</p>
<p>So in most cases you will want to add these to the rules =&gt; you have to define <em>pattern</em> to match the metric you are interested in, define what type it should be and how it should translate into the metric name and the labels. This can be just added to the existing rules in the Strimzi example.</p>
