2

I have metric data from collectD being written into Kafka topic continously in json format. I have to fetch that data and write the same into prometheus as metric for visualisation.

I was able to fetch the data from kafka, but not sure how to write the same as metrics in prometheus. Please share some insights on how can this be done.

Able to read messages from kafka, in json format.

OneCricketeer
  • 179,855
  • 19
  • 132
  • 245
  • Did you check this [link](https://stackoverflow.com/a/50517848/6663016) – KiraAG Jan 09 '19 at 05:32
  • Hi @KiraAG, It's part of my requirement and I am writing Java exporter code, if you have any suggestions for the same please help me with it.. Thanks – varun yadav Jan 10 '19 at 13:06
  • Prometheus is **pull** based so you would not **push** data from Kafka with it. The JMX exporter already exists is all that you can do with a Java client. – OneCricketeer Jan 13 '19 at 22:26
  • You can do it with the prometheus java client ; but as said, prometheus will pull the data, so the metrics will be kept in memory by your app via the java client and exposed to the prometheus scraper. See https://github.com/prometheus/client_java – Joel Jan 13 '19 at 22:34

0 Answers0