Reputation: 509
I am looking for a way to decouple Prometheus from applications by putting a Kafka in between to achieve something like this:
+-------------+ +----------+ +--------------+
| Application +--metrics--->+ Kafka +------>+ Prometheus |
+-------------+ +----------+ +--------------+
In order to solve this problem I have two questions:
Any comments or suggestions are welcome.
Upvotes: 0
Views: 1159
Reputation: 191743
Are there any Java libraries that abstract metrics representation so my app will not depend on Prometheus in any ways?
Yes - StatsD (I've used Datadog's dogstatsd
), which is push-based.
Related - Which StatsD client should I use for a java/grails project?
Then you can use StatsD as a relay to Prometheus - https://github.com/prometheus/statsd_exporter
Or use something else that supports remote reads
Upvotes: 0
Reputation: 34122
The Prometheus Java client library is designed so that you can used it with other monitoring systems, and indeed many open source and commercial monitoring systems do so as the Prometheus text format is becoming a defacto-standard.
Prometheus is a pull based system and it is not at all recommended to try and convert it to push, you're making your life harder for no real reason. It is recommended to have Prometheus scrape the application directly.
Upvotes: 2