类 MetricRepositoryAutoConfiguration
- java.lang.Object
- org.springframework.boot.actuate.autoconfigure.MetricRepositoryAutoConfiguration
@Configuration public class MetricRepositoryAutoConfiguration extends Object
Auto-configuration
for metrics services. Creates user-facingGaugeService
andCounterService
instances, 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 default
InMemoryMetricRepository
(Java 7) orCounterBuffers
andGaugeBuffers
(Java 8). The values can be exported (e.g. on a periodic basis) using anExporter
, most implementations of which have optimizations for sending data to remote repositories.If Spring Messaging is on the classpath and a
MessageChannel
called "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 theGaugeService
orCounterService
.By default all metric updates go to all
MetricWriter
instances in the application context via aMetricCopyExporter
firing every 5 seconds (disable this by settingspring.metrics.export.enabled=false
).
构造器详细资料
MetricRepositoryAutoConfiguration
public MetricRepositoryAutoConfiguration()