https://github.com/dhatim/dropwizard-prometheus
Dropwizard bundle and reporter for Prometheus
https://github.com/dhatim/dropwizard-prometheus
dropwizard metrics prometheus pushgateway
Last synced: 5 months ago
JSON representation
Dropwizard bundle and reporter for Prometheus
- Host: GitHub
- URL: https://github.com/dhatim/dropwizard-prometheus
- Owner: dhatim
- License: apache-2.0
- Created: 2017-06-12T18:29:41.000Z (almost 9 years ago)
- Default Branch: master
- Last Pushed: 2025-12-15T16:45:29.000Z (6 months ago)
- Last Synced: 2025-12-18T22:52:03.178Z (6 months ago)
- Topics: dropwizard, metrics, prometheus, pushgateway
- Language: Java
- Size: 71.3 KB
- Stars: 27
- Watchers: 3
- Forks: 10
- Open Issues: 7
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
Dropwizard Prometheus module
=======
[](https://github.com/dhatim/dropwizard-prometheus/actions)
[](https://maven-badges.herokuapp.com/maven-central/org.dhatim/dropwizard-prometheus)
[](https://www.javadoc.io/doc/org.dhatim/dropwizard-prometheus)
Dropwizard bundle and reporter for [Prometheus](https://prometheus.io)
## Reporting to Prometheus Pushgateway
This module provides `PrometheusReporter`, which allows your application to constantly stream metric values to a [Prometheus Pushway](https://prometheus.io/docs/instrumenting/pushing/) 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](https://prometheus.io) server.
@Override
public void initialize(Bootstrap bootstrap) {
bootstrap.addBundle(new PrometheusBundle());
}
After the Dropwizard application server start, a new endpoint `/prometheus-metrics` will be accessible with `admin` endpoint.