Skip to content

Latest commit

 

History

History
48 lines (34 loc) · 1.21 KB

File metadata and controls

48 lines (34 loc) · 1.21 KB

avaje-metrics-ebean

Supplies Ebean database metrics to avaje-metrics via DatabaseMetricSupplier.

Maven dependency

<dependency>
  <groupId>io.avaje</groupId>
  <artifactId>avaje-metrics-ebean</artifactId>
  <version>${version}</version>
</dependency>

If the application uses module-info.java, also add:

requires io.avaje.metrics.ebean;

Basic usage

import io.avaje.metrics.Metrics;
import io.avaje.metrics.ebean.DatabaseMetricSupplier;

Metrics.addSupplier(new DatabaseMetricSupplier(database));

Once added, normal registry collection and export paths will see the database metrics:

var metrics = Metrics.collectMetrics();

Notes

  • DatabaseMetricSupplier supports both delta and cumulative collection modes.
  • This module is useful with registry-driven export paths such as manual collection or avaje-metrics-otel-producer.
  • If you are using avaje-metrics-statsd or avaje-metrics-graphite, those modules also provide direct .database(...) convenience methods on their reporter builders.

More docs