Monitoring Client Library for Java

Build
Status

This is not an official Google product.

This library provides an API that is powerful and java idiomatic for configuring and publishing application metrics. A reference implementation using Stackdriver Monitoring API v3 is included, but other monitoring backend implementations can also be used.

Most of other monitoring libraries available are low-level and are tied directly to the backend. This library provides type safety, retry logic and an backend-agnostic approach to Java metrics instrumentation.

Basic concepts

Importing the library

The most recent release is v1.0.5.

The Maven group ID is com.google.monitoring-client. The artifact ID is metrics for the main library, and stackdriver for the stackdriver backend writer. We also provide a contrib library that is useful if you want to make test assertions on certain metric types with Google's truth library.

To add a dependency on the metrics library using Maven:

<dependency>
  <groupId>com.google.monitoring-client</groupId>
  <artifactId>metrics</artifactId>
  <version>1.0.5</version>
</dependency>

Using the library