Monitoring Client Library for Java


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 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:


Using the library