Change the type of metrics(dubbo.provider.requests.xxx) to counter.
Describe the proposal
En: Currently in the beta version of 3.2, the metric name (dubbo.provider.requests.total, dubbo.provider.requests.succeed, dubbo.provider.requests.failed) are all counter type, but they are displayed in the metrics panel The type of is: gauge, in order to prevent ambiguity, it needs to be changed to counter type.
中文:目前在3.2的beta版本中存在的监控指标埋点 (dubbo.provider.requests.total, dubbo.provider.requests.succeed, dubbo.provider.requests.failed) 均为 counter 类型,但是在 metrics 指标面板中显示的类型为:gauge,为了防止有歧义,需要修改为 counter 类型。
尝试新增一个 CounterMetricSample,然后修改类 AbstractMetricsReporter#scheduleMetricsCollectorSyncJob() 方法时,发现 COUNTER 类型无法设置值进去,因为 io.micrometer.core.instrument.Counter 并没有直接设置值的方法,只有 increment() 方法,即默认官方认为 Counter 是一个计数器,并非给你设置值使用的。