Dropwizard Prometheus bridge

Dropwizard bundle and reporter for Prometheus.

License

License

Categories

Categories

DropWizard Container Microservices Prometheus Application Testing & Monitoring Monitoring
GroupId

GroupId

org.dhatim
ArtifactId

ArtifactId

dropwizard-prometheus
Last Version

Last Version

3.1.4
Release Date

Release Date

Type

Type

jar
Description

Description

Dropwizard Prometheus bridge
Dropwizard bundle and reporter for Prometheus.
Project URL

Project URL

https://github.com/dhatim/dropwizard-prometheus
Source Code Management

Source Code Management

https://github.com/dhatim/dropwizard-prometheus

Download dropwizard-prometheus

How to add to project

<!-- https://jarcasting.com/artifacts/org.dhatim/dropwizard-prometheus/ -->
<dependency>
    <groupId>org.dhatim</groupId>
    <artifactId>dropwizard-prometheus</artifactId>
    <version>3.1.4</version>
</dependency>
// https://jarcasting.com/artifacts/org.dhatim/dropwizard-prometheus/
implementation 'org.dhatim:dropwizard-prometheus:3.1.4'
// https://jarcasting.com/artifacts/org.dhatim/dropwizard-prometheus/
implementation ("org.dhatim:dropwizard-prometheus:3.1.4")
'org.dhatim:dropwizard-prometheus:jar:3.1.4'
<dependency org="org.dhatim" name="dropwizard-prometheus" rev="3.1.4">
  <artifact name="dropwizard-prometheus" type="jar" />
</dependency>
@Grapes(
@Grab(group='org.dhatim', module='dropwizard-prometheus', version='3.1.4')
)
libraryDependencies += "org.dhatim" % "dropwizard-prometheus" % "3.1.4"
[org.dhatim/dropwizard-prometheus "3.1.4"]

Dependencies

compile (1)

Group / Artifact Type Version
io.dropwizard : dropwizard-core jar

test (2)

Group / Artifact Type Version
junit : junit jar 4.13.2
org.assertj : assertj-core jar 3.19.0

Project Modules

There are no modules declared in this project.

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.

org.dhatim

Dhatim

Versions

Version
3.1.4
3.0.2
2.2.0
2.1.2
2.1.1
2.1.0
2.0.1
2.0.0
1.0.2
1.0.1
1.0.0