I have a dropwizard application which emits yammer metrics and can be monitored via a URL like http://localhost:8081/admin/metrics which gives the result in form of jsons.
I want to send these monitor these metrics in riemann and I have no idea on how to start. I went through the riemann-java-client which has a RiemannReporter class for yammer metrics but I do not how to use this in my application.
How to integrate this client into my application or how to capture jsons from the url and send these as events to riemann server?
The RiemanReporter Builder in the Java Client Library takes the dropwizard metrics registry into the constructor. It supports tagging the events and it will convert the rates into Riemann events. You can set the polling interval on the start method with a TimeUnit
Riemann riemann = new Riemann("YOUR_RIEMANN_HOST", 5555);
ArrayList<String> tags = new ArrayList<String>();
tags.add("YOUR_APPLICATION_TAG");
RiemannReporter.Builder builder = RiemannReporter.forRegistry(environment.metrics()).tags(tags);
RiemannReporter riemannReporter = builder.build(riemann);
riemannReporter.start(1, TimeUnit.SECONDS);
Riemann config to trap this output and write to the Riemann log:
(streams (where (tag "YOUR_APPLICATION_TAG") #(info %)))
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With