title: Metric collection

BookKeeper enables metrics collection through a variety of stats providers.

For a full listing of available metrics, see the Metrics reference doc.

Stats providers

BookKeeper has stats provider implementations for four five sinks:

ProviderProvider class name
Codahale Metricsorg.apache.bookkeeper.stats.CodahaleMetricsProvider
Prometheusorg.apache.bookkeeper.stats.prometheus.PrometheusMetricsProvider
Finagleorg.apache.bookkeeper.stats.FinagleStatsProvider
Ostrichorg.apache.bookkeeper.stats.OstrichProvider
Twitter Science Providerorg.apache.bookkeeper.stats.TwitterStatsProvider

The [Codahale Metrics]({{ site.github_master }}/bookkeeper-stats-providers/codahale-metrics-provider) stats provider is the default provider.

Enabling stats providers in bookies

There are two stats-related configuration parameters available for bookies:

ParameterDescriptionDefault
enableStatisticsWhether statistics are enabled for the bookiefalse
statsProviderClassThe stats provider class used by the bookieorg.apache.bookkeeper.stats.CodahaleMetricsProvider

To enable stats:

  • set the enableStatistics parameter to true
  • set statsProviderClass to the desired provider (see the table above for a listing of classes)