[英]Adding 'mean', 'min' or 'percentiles' to Spring Boot 2 metrics?
I am using the new MicroMeter metrics in Spring Boot 2 version 2.0.0-RELEASE
.我在Spring Boot 2版本
2.0.0-RELEASE
中使用新的MicroMeter指标。
When publishing metrics over the /actuator/metrics/{metric.name}
endpoint, i get the following:通过
/actuator/metrics/{metric.name}
端点发布指标时,我得到以下信息:
For a DistributionSummary
:对于
DistributionSummary
:
"name": "sources.ingestion.rate",
"measurements": [
{
"statistic": "COUNT",
"value": 5
},
{
"statistic": "TOTAL",
"value": 72169.44162067816
},
{
"statistic": "MAX",
"value": 17870.68010661754
}
],
"availableTags": []
}
For a Timer
:对于
Timer
:
{
"name": "sources.ingestion",
"measurements": [
{
"statistic": "COUNT",
"value": 5
},
{
"statistic": "TOTAL_TIME",
"value": 65.700878648
},
{
"statistic": "MAX",
"value": 22.661545322
}
],
"availableTags": []
}
Is it possible to enrich the measurements to add measures like mean , min , or percentiles ?是否可以丰富测量以添加诸如mean 、 min或percentiles之类的度量?
For percentiles i tried using .publishPercentiles(0.5, 0.95)
, but that doesn't reflect on the actuator endpoint.对于百分位数,我尝试使用
.publishPercentiles(0.5, 0.95)
,但这并没有反映在执行器端点上。
After discussions on Github, this is not currently implemented in Micrometer.在 Github 上进行讨论后,目前尚未在 Micrometer 中实现。 More details directly on the Github Issues:
直接在 Github Issues 上获取更多详细信息:
https://github.com/micrometer-metrics/micrometer/issues/488#issuecomment-373249656 https://github.com/micrometer-metrics/micrometer/issues/488#issuecomment-373249656
https://github.com/spring-projects/spring-boot/issues/12433 https://github.com/spring-projects/spring-boot/issues/12433
https://github.com/micrometer-metrics/micrometer/issues/457 https://github.com/micrometer-metrics/micrometer/issues/457
Now you can implement percentiles-histogram like this:现在你可以像这样实现百分位数直方图:
metrics:
distribution:
percentiles-histogram:
http.server.requests: true
Then you can see histogram data in /actuator/prometheus, but can not see in /metrics.那么在/actuator/prometheus中可以看到直方图数据,在/metrics中看不到。 Because it Weill generate only for endpoint which supports histogram.
因为它 Weill 只为支持直方图的端点生成。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.