prometheus / client_java

Prometheus instrumentation library for JVM applications
http://prometheus.github.io/client_java/
Apache License 2.0
2.16k stars 783 forks source link

Dropwizard support for 1.0.0 #867

Open jmachalica opened 9 months ago

jmachalica commented 9 months ago

Is it possible to integrate this client version with dropwizard? I would like to expose its metrics for prometheus scraping. Should I use an archived simple client?

fstab commented 9 months ago

Hi @jmachalica, the simpleclient_dropwizard module didn't make it into the 1.0.0 release, it's still on version 0.16.0. We are planning to port it over, but it will take some time. You have three options:

  1. Keep using 0.16.0 until a 1.x version of simpleclient_dropwizard is available. There's nothing wrong with 0.16.0.
  2. If you want to use prometheus-metrics-core 1.0.0 for new metrics but keep using simpleclient_dropwizard 0.16.0 for Dropwizard metrics, you can use both versions in parallel. Use the prometheus-metrics-simpleclient-bridge module as described here: https://prometheus.github.io/client_java/migration/simpleclient/.
  3. We are looking for volunteers to help us port the remaining 0.16.0 modules over to 1.0.0. So if you want to speed things up, feel free to create a PR. All you need is a MultiCollector for Dropwizard metrics that produces snapshots as defined in prometheus-metrics-model, see https://prometheus.github.io/client_java/internals/model/. I'm happy to help.
bmeier-pros commented 2 months ago

Can we split this into metrics 4 and metrics 5 tickets? The change merged only supports metrics 5, we need metrics 4 for Dropwizard 3 and 4 support.