Elasticsearch Reporter for Dropwizard Metrics

This post describes how to export Dropwizard Metrics to elasticsearch. Instead of using logstash to parse application log files, the metrics can be exported directly within any Java application. This plugin is maintained by elastic.co.

See https://github.com/elastic/elasticsearch-metrics-reporter-java. For the impatient: Add to your pom.xml


Start reporting to elasticsearch cluster e.g. in main()

ElasticsearchReporter reporter = ElasticsearchReporter
    .hosts("elasticsearch-node1:9200", "elasticsearch-node2:9200")
    .indexDateFormat(null) //no date suffix
reporter.start(10, TimeUnit.SECONDS);