Sentinel 输出到本地的监控指标采集文件中并发线程数一直为0问题 | Concurrency item in metric log

hrysbysz  于 2021-11-29  发布在  Java
关注(0)|答案(1)|浏览(250)

Issue Description

Type: bug report or feature request

Describe what happened (or what feature you want)

想利用输出到本地的监控指标采集文件做指标展示,目前发现该日志文件中concurrency指标数据一直是0。是否有其它好的方式能够获取到实时的资源并发线程数?

Describe what you expected to happen

我们实时采集了该日志文件暴露prometheus,但是发现并发数的指标数据一直是0

How to reproduce it (as minimally and precisely as possible)

目前看了指标文件输出本地的代码,MetricTimerListener中指标数据来源是遍历ClusterBuilderSlot中的ClusterNodeMap,通过node,metrics()构造MetricNode指标数据。而node.metrics()方法中会调用rollingCounterInMinute.details()方法构建每秒的实时数据,这里的滑动窗口中的MetricBucket并没有concurrency指标,因此构建MetricNode时concurrency指标一直为0.是否有好的方式能够获取到实时的资源并发数
1.
2.
3.

Tell us your environment

Anything else we need to know?

krugob8w

krugob8w1#

这里建议以该时长范围内的最大并发数来定义该字段(并发是瞬时值而不是区间段值),欢迎贡献相关实现。

Actually it's reserved for "max concurrency" of this second. Contributions are welcomed.

相关问题