- With the Admin Web up and running, we are now ready to start adding various metrics to our BookPub application. Let's expose the same information about our data repositories as we did in HealthIndicators, but this time, we will expose the counts data as a metric. We will continue to add code to our db-count-starter subproject. So, let's create a new file named DbCountMetrics.java in the db-count-starter/src/main/java/com/example/bookpubstarter/dbcount directory at the root of our project with the following content:
public class DbCountMetrics implements MeterBinder {
private Collection<CrudRepository> repositories;
public DbCountMetrics(Collection<CrudRepository> repositories) { this.repositories = repositories; } @Override ...