client_java
GitHubToggle Dark/Light/Auto modeToggle Dark/Light/Auto modeToggle Dark/Light/Auto modeBack to homepage

client_java

This is the documentation for the Prometheus Java client library version 1.0.0 and higher.

The main new features of the 1.0.0 release are:

  • Prometheus native histograms: Support for the new Prometheus histogram type.
  • OpenTelemetry Exporter: Push metrics in OTLP format to an OpenTelemetry endpoint.
  • Runtime configuration: Configure metrics, exporters, and more at runtime using a properties file or system properties.

Documentation and Examples

In addition to this documentation page we created an examples/ directory with end-to-end scenarios (Docker compose) illustrating new features.

Performance Benchmarks

Initial performance benchmarks are looking great: All core metric types (including native histograms) allow concurrent updates, so if you instrument a performance critical Web service that utilizes all processor cores in parallel the metrics library will not introduce additional synchronization. See Javadoc comments in benchmarks/ for benchmark results.

More Info

The Grafana Labs Blog has a post Introducing the Prometheus Java Client 1.0.0 with a good overview of the release.

There will also be a presentation at the PromCon conference on 29 Sep 2023. Tune in to the live stream on https://promcon.io or watch the recording on YouTube.

For users of the 0.16.0 version and older

Updating to the 1.0.0 version is a breaking change. However, there’s a prometheus-metrics-simpleclient-bridge module available that allows you to use your existing simpleclient 0.16.0 metrics with the new 1.0.0 PrometheusRegistry. So you don’t need to upgrade your instrumentation code, you can keep using your existing metrics. See the compatibility > simpleclient in the menu on the left.

The pre 1.0.0 code is now maintained on the simpleclient feature branch.

Not all simpleclient modules from 0.16.0 are included in the initial 1.0.0 release. Over the next couple of weeks we will work on porting the remaining modules, starting with pushgateway and the Servlet filter.