Skip to content

nheitz/dropwizard-prometheus

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

31 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Dropwizard Prometheus module

Build Status Coverage Status Codacy Badge Maven Central Javadocs

Dropwizard bundle and reporter for Prometheus

Reporting to Prometheus Pushgateway

This module provides PrometheusReporter, which allows your application to constantly stream metric values to a Prometheus Pushway server:

final Pushgateway pushgateway = new Pushgateway("localhost", 9091));
final PrometheusReporter reporter = PrometheusReporter.forRegistry(registry)
                                              .prefixedWith("web1.example.com")
                                              .filter(MetricFilter.ALL)
                                              .build(pushgateway);
reporter.start(1, TimeUnit.MINUTES);

Prometheus servlet

You can also use PrometheusBundle, which starts a new admin servlet exposing metric values to a Prometheus server.

@Override
public void initialize(Bootstrap<DsnConfiguration> bootstrap) {
    bootstrap.addBundle(new PrometheusBundle());
}

After the Dropwizard application server start, a new endpoint /prometheus-metrics will be accessible with admin endpoint.

About

Dropwizard bundle and reporter for Prometheus

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • Java 97.4%
  • Shell 2.6%