spring_reference/V. Spring Boot Actuator/44.7. Dropwizard Metrics.md

6 lines
608 B
Markdown
Raw Blame History

This file contains ambiguous Unicode characters!

This file contains ambiguous Unicode characters that may be confused with others in your current locale. If your use case is intentional and legitimate, you can safely ignore this warning. Use the Escape button to highlight these characters.

### 44.7. Dropwizard指标
[Dropwizard Metrics](https://dropwizard.github.io/metrics/)的用户会发现Spring Boot指标被发布到了`com.codahale.metrics.MetricRegistry`。当你声明对`io.dropwizard.metrics:metrics-core`库的依赖时会创建一个默认的`com.codahale.metrics.MetricRegistry` Spring bean如果需要自定义你可以注册自己的@Bean实例。来自于`MetricRegistry`的指标也是自动通过`/metrics`端点暴露的。
用户可以通过使用合适类型的指标名称作为前缀来创建Dropwizard指标比如`histogram.*`, `meter.*`)。