0

While setting up metric reporting for Apache Kafka to ElasticSearch with jmxtrans, we have written a configuration file that queries about 50 metrics.

The queries are as follows:

{ 
  "obj" : "kafka.server:type=BrokerTopicMetrics,name=TotalFetchRequestsPerSec", 
  "outputWriters" : [ { 
    "@class" : "com.googlecode.jmxtrans.model.output.elastic.ElasticWriter", 
    "connectionUrl": "http://elasticHost:9200" 
  }] 
}

Since there are so many of them all writing to the same destination, is there a way in the config file to shorten this?

Any help is highly appreciated.

user152468
  • 3,202
  • 6
  • 27
  • 57

1 Answers1

0

You can try to be more precise in your MBean path - kafka.server:name=TotalFetchRequestsPerSec,topic=MyCoolTopic,type=BrokerTopicMetrics

Take a look on this one as a great example - jmxtrans supports resultAlias as well.

Here you can find a list of Kafka MBeans which could become handy for you.

Elad Leev
  • 908
  • 7
  • 17