# Extend Kafka Metricbeat module to add mbean missing

**URL:** <https://discuss.elastic.co/t/extend-kafka-metricbeat-module-to-add-mbean-missing/249779>\
**Category:** Beats\
**Tags:** metricbeat\
**Created:** [September 24, 2020, 9:00am UTC](https://discuss.elastic.co/t/extend-kafka-metricbeat-module-to-add-mbean-missing/249779 "2020-09-24T09:00:15Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![stevizik](https://avatars.discourse-cdn.com/v4/letter/s/65b543/32.png) [@stevizik](https://discuss.elastic.co/u/stevizik)\
**Post date:** [September 24, 2020, 9:00am UTC](https://discuss.elastic.co/t/extend-kafka-metricbeat-module-to-add-mbean-missing/249779/1 "2020-09-24T09:00:15Z")

</div>

Hi community,

i am using Kafka metricbeat module to get metrics from a Kafka cluster. Furthermore i have enabled Jolokia (JMX - HTTP Connector) to fetch metrics also from broker, consumer and producer.

The solution works as expected but i am missing some critical metrics e.g. `kafka.server:type=ReplicaManager,name=UnderReplicatedPartitions`

In manifest.yml file ([https://github.com/elastic/beats/blob/master/metricbeat/module/kafka/broker/manifest.yml](https://github.com/elastic/beats/blob/master/metricbeat/module/kafka/broker/manifest.yml)) i can see that there is a way to add more mbean and attach them to fields but i don't know if that is the correct place to look and how i can move on and make the module working with updated metricset.

Thanks!

---

<div class="post-metadata">

**Author:** ![jsoriano](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/jsoriano/32/27920_2.png) [@jsoriano](https://discuss.elastic.co/u/jsoriano)\
**Post date:** [September 28, 2020, 11:56am UTC](https://discuss.elastic.co/t/extend-kafka-metricbeat-module-to-add-mbean-missing/249779/2 "2020-09-28T11:56:08Z")

</div>

Hey @stevizik,

This `manifest.yml` is not intended to be modified (but you can do it 🙂 You will find it in your installation of Metricbeat, only problem is that it will be overwritten on upgrades).

One thing you can try is to override the `jmx.mappings` settings from your kafka module configuration. For that, copy these settings from the manifest to the config and there modify or add the metrics you need.

It could be for example something like this in your configuration (not tested):

```auto
- module: kafka
  metricsets:
    - broker
  period: 10s
  hosts: ["localhost:8779"]
  jmx.mappings:
        - mbean: 'kafka.network:type=RequestChannel,name=RequestQueueSize'
          attributes:
          - attr: Value
            field: request.channel.queue.size
        ...
        - mbean: 'kafka.server:type=ReplicaManager,name=UnderReplicatedPartitions'
          attributes:
          - attr: Value
            field: replication.under_replicated_partitions

```

Longer term, it'd be interesting if you could open a pull request in Beats to add this metric to this manifest in the Kafka module, or [open an issue](https://github.com/elastic/beats/issues/new?template=feature-request.md) requesting to add the fields you are missing 🙂

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/elastic/original/3X/1/a/1ac57faf039f6b580b3f104ef42a2a89e41014de.png) [@system](https://discuss.elastic.co/u/system)\
**Post date:** [October 26, 2020, 1:56pm UTC](https://discuss.elastic.co/t/extend-kafka-metricbeat-module-to-add-mbean-missing/249779/3 "2020-10-26T13:56:12Z")

</div>

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.
