prometheus的指标

##prometheus中便签类型
prometheus中Histogram和Summary类型的:

- (1)在prometheus client中区分Histogram和Summary,分别表示两个类,可以依次创建指标
 Histogram
Histogram 由 _bucket{le=""},_bucket{le="+Inf"}, _sum,_count 组成,主要用于表示一段时间范围内对数据进行采样(通常是请求持续时间或响应大小),并能够对其指定区间以及总数进行统计,通常它采集的数据展示为直方图。
例如 Prometheus server 中 prometheus_local_storage_series_chunks_persisted, 表示 Prometheus 中每个时序需要存储的 chunks 数量,我们可以用它计算待持久化的数据的分位数。
Summary
Summary 和 Histogram 类似,由 {quantile="<φ>"},_sum,_count 组成,主要用于表示一段时间内数据采样结果(通常是请求持续时间或响应大小),它直接存储了 quantile 数据,而不是根据统计区间计算出来的。
例如 Prometheus server 中 prometheus_target_interval_length_seconds。
Histogram vs Summary
都包含 _sum,_count
Histogram 需要通过 _bucket 计算 quantile, 而 Summary 直接存储了 quantile 的值。
- (2)在Micrometer中,两者统称之分布概要(Distribution summary)用来记录事件的分布情况,
分布概要(Distribution summary)用来记录事件的分布情况。计时器本质上也是一种分布概要。表示分布概要的类 DistributionSummary 可以从注册表中创建,也可以使用 DistributionSummary.builder() 提供的构建器来创建。分布概要根据每个事件所对应的值,把事件分配到对应的桶(bucket)中。Micrometer 默认的桶的值从 1 到最大的 long 值。可以通过 minimumExpectedValue 和 maximumExpectedValue 来控制值的范围。如果事件所对应的值较小,可以通过 scale 来设置一个值来对数值进行放大。与分布概要密切相关的是直方图和百分比(percentile)。大多数时候,我们并不关注具体的数值,而是数值的分布区间。比如在查看 HTTP 服务响应时间的性能指标时,通常关注是的几个重要的百分比,如 50%,75%和 90%等。所关注的是对于这些百分比数量的请求都在多少时间内完成。Micrometer 提供了两种不同的方式来处理百分比。

 

详细参考:

如何区分prometheus中Histogram和Summary类型的metrics?  https://www.cnblogs.com/aguncn/p/9920545.html

使用 Micrometer 记录 Java 应用性能指标 https://www.ibm.com/developerworks/cn/java/j-using-micrometer-to-record-java-metric/index.html

基于Prometheus搭建SpringCloud全方位立体监控体系 https://www.jianshu.com/p/2e2e28656dd5

JVM应用度量框架Micrometer实战 http://throwable.coding.me/2018/11/17/jvm-micrometer-prometheus/#Meters

 

 

你可能感兴趣的:(prometheus)