@Configuration public class MetricRepositoryAutoConfiguration extends Object
Auto-configurationfor metrics services. Creates user-facing
CounterServiceinstances, and also back end repositories to catch the data pumped into them.
In general, even if metric data needs to be stored and analysed remotely, it is
recommended to use in-memory storage to buffer metric updates locally as is done by the
InMemoryMetricRepository (Java 7) or
GaugeBuffers (Java 8). The values can be exported (e.g. on a periodic basis)
Exporter, most implementations of which have optimizations for sending
data to remote repositories.
If Spring Messaging is on the classpath and a
"metricsChannel" is also available, all metric update events are published additionally
as messages on that channel. Additional analysis or actions can be taken by clients
subscribing to that channel.
In addition if Dropwizard's metrics library is on the classpath a
MetricRegistry will be created and the default counter and gauge services will
switch to using it instead of the default repository. Users can create "special"
Dropwizard metrics by prefixing their metric names with the appropriate type (e.g.
"histogram.*", "meter.*". "timer.*") and sending them to the
By default all metric updates go to all
MetricWriter instances in the
application context via a
MetricCopyExporter firing every 5 seconds (disable
this by setting
Copyright © 2019 Pivotal Software, Inc.. All rights reserved.