For reporting metrics, we have a package that provides APIs for both Metrics1 and Metrics2. It provides the flexibility to use client libraries and different modules from within an application.
This package provides sub-packages to do the specified task:
org.apache.hadoop.metrics.spi
The abstract Server Provider Interface package. Those wishing to integrate the metrics API with a particular metrics client library should extend this package:
org.apache.hadoop.metrics.file
An implementation package that writes the metric data to a file or sends it to the standard output stream:
org.apache.hadoop.metrics.ganglia
An implementation package that sends metrics data to Ganglia.
The new Metrics2 provides a lot more packages for the implementation.