apache / dubbo-admin

The ops and reference implementation for Apache Dubbo
https://dubbo.apache.org
Apache License 2.0
4k stars 2.17k forks source link

dubbo2.7.3配置dubbo-admin中metrics遇到的问题 #507

Open Armstjoh opened 5 years ago

Armstjoh commented 5 years ago

开发环境:java8,win7,dubbo2.7.3,根据现有文档引入了dubbo-monitor-default包

1.项目dubbo2.7.3配置redis集群做元数据中心,zookeeper需要配置simplified: true才能使用元数据和测试功能。

2.使用统计模块时,发现可以在application.yml中写入 dubbo: metrics: port: 20880 protocol: dubbo provider: filter: metrics group: dubbo

在redis客户端中可以查到元数据包含了metrics的相关信息

但是在dubbo-admin中默认是有group属性,如果在项目中不配置dubbo.provider.group=dubbo则在dubbo-admin的统计无数据(相应的注入注解@Reference(group = "group"))

3.在配置了以上的属性的基础上,统计显示也有问题,第一次调用服务接口后,会有qps和被使用的方法显示,但在继续使用其他功能接口方法之后,统计页面上显示的还是第一次调用服务接口的数据,怀疑是redis集群存储元数据的坑

Armstjoh commented 5 years ago

接着上面第3点问题,有新的进展,统计显示定格是缓存的锅,可以在MetricsCollectController中

private String getOnePortMessage(String group, String ip, String port, String protocol) {
    MetrcisCollectServiceImpl metrcisCollectService = new MetrcisCollectServiceImpl();
    metrcisCollectService.setUrl(protocol + "://" + ip + ":" + port +"?scope=remote&cache=true");
    String res = metrcisCollectService.invoke(group).toString();
    return res;
}

中的cache=true改为false,就可以及时显示出该有的功能操作

4.在上边的统计显示正常的情况下,每次点击搜索按钮才可以显示出下一个状态的图表;这种监控功能难道不是应该点击一次搜索按钮后自动更新图表状态吗?

dmtd78 commented 5 years ago

[{"metric":"dubbo.provider.success_bucket_count","timestamp":1569359160000,"value":0.0,"metricType":"DELTA","tags":{},"metricLevel":"MAJOR","meterName":null,"interval":5,"service":null},{"metric":"dubbo.provider.bucket_count","timestamp":1569359160000,"value":0.0,"metricType":"DELTA","tags":{},"metricLevel":"MAJOR","meterName":null,"interval":5,"service":null},{"metric":"dubbo.provider.bucket_sum","timestamp":1569359160000,"value":0.0,"metricType":"DELTA","tags":{},"metricLevel":"MAJOR","meterName":null,"interval":5,"service":null},{"metric":"dubbo.provider.qps","timestamp":1569359160000,"value":0.0,"metricType":"GAUGE","tags":{},"metricLevel":"MAJOR","meterName":null,"interval":5,"service":null},{"metric":"dubbo.provider.rt","timestamp":1569359160000,"value":0.0,"metricType":"GAUGE","tags":{},"metricLevel":"MAJOR","meterName":null,"interval":5,"service":null},{"metric":"dubbo.provider.success_rate","timestamp":1569359160000,"value":0.0,"metricType":"GAUGE","tags":{},"metricLevel":"MAJOR","meterName":null,"interval":5,"service":null},{"metric":"dubbo.provider.method.success_bucket_count","timestamp":1569359145000,"value":0.0,"metricType":"DELTA","tags":{"method":"DemoDTO test(String)","service":"com.sunwin.dubbozkpdemo.service.DemoService"},"metricLevel":"NORMAL","meterName":null,"interval":15,"service":"com.sunwin.dubbozkpdemo.service.DemoService"},{"metric":"dubbo.provider.method.bucket_count","timestamp":1569359145000,"value":0.0,"metricType":"DELTA","tags":{"method":"DemoDTO test(String)","service":"com.sunwin.dubbozkpdemo.service.DemoService"},"metricLevel":"NORMAL","meterName":null,"interval":15,"service":"com.sunwin.dubbozkpdemo.service.DemoService"},{"metric":"dubbo.provider.method.bucket_sum","timestamp":1569359145000,"value":0.0,"metricType":"DELTA","tags":{"method":"DemoDTO test(String)","service":"com.sunwin.dubbozkpdemo.service.DemoService"},"metricLevel":"NORMAL","meterName":null,"interval":15,"service":"com.sunwin.dubbozkpdemo.service.DemoService"},{"metric":"dubbo.provider.method.qps","timestamp":1569359145000,"value":0.0,"metricType":"GAUGE","tags":{"method":"DemoDTO test(String)","service":"com.sunwin.dubbozkpdemo.service.DemoService"},"metricLevel":"NORMAL","meterName":null,"interval":15,"service":"com.sunwin.dubbozkpdemo.service.DemoService"},{"metric":"dubbo.provider.method.rt","timestamp":1569359145000,"value":0.0,"metricType":"GAUGE","tags":{"method":"DemoDTO test(String)","service":"com.sunwin.dubbozkpdemo.service.DemoService"},"metricLevel":"NORMAL","meterName":null,"interval":15,"service":"com.sunwin.dubbozkpdemo.service.DemoService"},{"metric":"dubbo.provider.method.success_rate","timestamp":1569359145000,"value":0.0,"metricType":"GAUGE","tags":{"method":"DemoDTO test(String)","service":"com.sunwin.dubbozkpdemo.service.DemoService"},"metricLevel":"NORMAL","meterName":null,"interval":15,"service":"com.sunwin.dubbozkpdemo.service.DemoService"},{"metric":"threadPool.active","timestamp":null,"value":1.0,"metricType":null,"tags":{},"metricLevel":"MAJOR","meterName":null,"interval":-1,"service":null},{"metric":"threadPool.core","timestamp":null,"value":200.0,"metricType":null,"tags":{},"metricLevel":"MAJOR","meterName":null,"interval":-1,"service":null},{"metric":"threadPool.max","timestamp":null,"value":200.0,"metricType":null,"tags":{},"metricLevel":"MAJOR","meterName":null,"interval":-1,"service":null},{"metric":"threadPool.current","timestamp":null,"value":9.0,"metricType":null,"tags":{},"metricLevel":"MAJOR","meterName":null,"interval":-1,"service":null}]

返回正常,但是页面不展示是什么原因?

Armstjoh commented 5 years ago

[{"metric":"dubbo.provider.success_bucket_count","timestamp":1569359160000,"value":0.0,"metricType":"DELTA","tags":{},"metricLevel":"MAJOR","meterName":null,"interval":5,"service":null},{"metric":"dubbo.provider.bucket_count","timestamp":1569359160000,"value":0.0,"metricType":"DELTA","tags":{},"metricLevel":"MAJOR","meterName":null,"interval":5,"service":null},{"metric":"dubbo.provider.bucket_sum","timestamp":1569359160000,"value":0.0,"metricType":"DELTA","tags":{},"metricLevel":"MAJOR","meterName":null,"interval":5,"service":null},{"metric":"dubbo.provider.qps","timestamp":1569359160000,"value":0.0,"metricType":"GAUGE","tags":{},"metricLevel":"MAJOR","meterName":null,"interval":5,"service":null},{"metric":"dubbo.provider.rt","timestamp":1569359160000,"value":0.0,"metricType":"GAUGE","tags":{},"metricLevel":"MAJOR","meterName":null,"interval":5,"service":null},{"metric":"dubbo.provider.success_rate","timestamp":1569359160000,"value":0.0,"metricType":"GAUGE","tags":{},"metricLevel":"MAJOR","meterName":null,"interval":5,"service":null},{"metric":"dubbo.provider.method.success_bucket_count","timestamp":1569359145000,"value":0.0,"metricType":"DELTA","tags":{"method":"DemoDTO test(String)","service":"com.sunwin.dubbozkpdemo.service.DemoService"},"metricLevel":"NORMAL","meterName":null,"interval":15,"service":"com.sunwin.dubbozkpdemo.service.DemoService"},{"metric":"dubbo.provider.method.bucket_count","timestamp":1569359145000,"value":0.0,"metricType":"DELTA","tags":{"method":"DemoDTO test(String)","service":"com.sunwin.dubbozkpdemo.service.DemoService"},"metricLevel":"NORMAL","meterName":null,"interval":15,"service":"com.sunwin.dubbozkpdemo.service.DemoService"},{"metric":"dubbo.provider.method.bucket_sum","timestamp":1569359145000,"value":0.0,"metricType":"DELTA","tags":{"method":"DemoDTO test(String)","service":"com.sunwin.dubbozkpdemo.service.DemoService"},"metricLevel":"NORMAL","meterName":null,"interval":15,"service":"com.sunwin.dubbozkpdemo.service.DemoService"},{"metric":"dubbo.provider.method.qps","timestamp":1569359145000,"value":0.0,"metricType":"GAUGE","tags":{"method":"DemoDTO test(String)","service":"com.sunwin.dubbozkpdemo.service.DemoService"},"metricLevel":"NORMAL","meterName":null,"interval":15,"service":"com.sunwin.dubbozkpdemo.service.DemoService"},{"metric":"dubbo.provider.method.rt","timestamp":1569359145000,"value":0.0,"metricType":"GAUGE","tags":{"method":"DemoDTO test(String)","service":"com.sunwin.dubbozkpdemo.service.DemoService"},"metricLevel":"NORMAL","meterName":null,"interval":15,"service":"com.sunwin.dubbozkpdemo.service.DemoService"},{"metric":"dubbo.provider.method.success_rate","timestamp":1569359145000,"value":0.0,"metricType":"GAUGE","tags":{"method":"DemoDTO test(String)","service":"com.sunwin.dubbozkpdemo.service.DemoService"},"metricLevel":"NORMAL","meterName":null,"interval":15,"service":"com.sunwin.dubbozkpdemo.service.DemoService"},{"metric":"threadPool.active","timestamp":null,"value":1.0,"metricType":null,"tags":{},"metricLevel":"MAJOR","meterName":null,"interval":-1,"service":null},{"metric":"threadPool.core","timestamp":null,"value":200.0,"metricType":null,"tags":{},"metricLevel":"MAJOR","meterName":null,"interval":-1,"service":null},{"metric":"threadPool.max","timestamp":null,"value":200.0,"metricType":null,"tags":{},"metricLevel":"MAJOR","meterName":null,"interval":-1,"service":null},{"metric":"threadPool.current","timestamp":null,"value":9.0,"metricType":null,"tags":{},"metricLevel":"MAJOR","meterName":null,"interval":-1,"service":null}]

返回正常,但是页面不展示是什么原因?

从你的数据来看,元数据没有读取到,可以检查元数据是否存到了该存的地方,是redis还是zookeeper?再有,这个监控页面只有调用过后才会显示出来;去掉缓存的话,调用过后大约10秒内有数据显示,时间过后无数据。

zhangpanli commented 5 years ago

[{"metric":"dubbo.provider.success_bucket_count","timestamp":1569359160000,"value":0.0,"metricType":"DELTA","tags":{},"metricLevel":"MAJOR","meterName":null,"interval":5,"service":null},{"metric":"dubbo.provider.bucket_count","timestamp":1569359160000,"value":0.0,"metricType":"DELTA","tags":{},"metricLevel":"MAJOR","meterName":null,"interval":5,"service":null},{"metric":"dubbo.provider.bucket_sum","timestamp":1569359160000,"value":0.0,"metricType":"DELTA","tags":{},"metricLevel":"MAJOR","meterName":null,"interval":5,"service":null},{"metric":"dubbo.provider.qps","timestamp":1569359160000,"value":0.0,"metricType":"GAUGE","tags":{},"metricLevel":"MAJOR","meterName":null,"interval":5,"service":null},{"metric":"dubbo.provider.rt","timestamp":1569359160000,"value":0.0,"metricType":"GAUGE","tags":{},"metricLevel":"MAJOR","meterName":null,"interval":5,"service":null},{"metric":"dubbo.provider.success_rate","timestamp":1569359160000,"value":0.0,"metricType":"GAUGE","tags":{},"metricLevel":"MAJOR","meterName":null,"interval":5,"service":null},{"metric":"dubbo.provider.method.success_bucket_count","timestamp":1569359145000,"value":0.0,"metricType":"DELTA","tags":{"method":"DemoDTO test(String)","service":"com.sunwin.dubbozkpdemo.service.DemoService"},"metricLevel":"NORMAL","meterName":null,"interval":15,"service":"com.sunwin.dubbozkpdemo.service.DemoService"},{"metric":"dubbo.provider.method.bucket_count","timestamp":1569359145000,"value":0.0,"metricType":"DELTA","tags":{"method":"DemoDTO test(String)","service":"com.sunwin.dubbozkpdemo.service.DemoService"},"metricLevel":"NORMAL","meterName":null,"interval":15,"service":"com.sunwin.dubbozkpdemo.service.DemoService"},{"metric":"dubbo.provider.method.bucket_sum","timestamp":1569359145000,"value":0.0,"metricType":"DELTA","tags":{"method":"DemoDTO test(String)","service":"com.sunwin.dubbozkpdemo.service.DemoService"},"metricLevel":"NORMAL","meterName":null,"interval":15,"service":"com.sunwin.dubbozkpdemo.service.DemoService"},{"metric":"dubbo.provider.method.qps","timestamp":1569359145000,"value":0.0,"metricType":"GAUGE","tags":{"method":"DemoDTO test(String)","service":"com.sunwin.dubbozkpdemo.service.DemoService"},"metricLevel":"NORMAL","meterName":null,"interval":15,"service":"com.sunwin.dubbozkpdemo.service.DemoService"},{"metric":"dubbo.provider.method.rt","timestamp":1569359145000,"value":0.0,"metricType":"GAUGE","tags":{"method":"DemoDTO test(String)","service":"com.sunwin.dubbozkpdemo.service.DemoService"},"metricLevel":"NORMAL","meterName":null,"interval":15,"service":"com.sunwin.dubbozkpdemo.service.DemoService"},{"metric":"dubbo.provider.method.success_rate","timestamp":1569359145000,"value":0.0,"metricType":"GAUGE","tags":{"method":"DemoDTO test(String)","service":"com.sunwin.dubbozkpdemo.service.DemoService"},"metricLevel":"NORMAL","meterName":null,"interval":15,"service":"com.sunwin.dubbozkpdemo.service.DemoService"},{"metric":"threadPool.active","timestamp":null,"value":1.0,"metricType":null,"tags":{},"metricLevel":"MAJOR","meterName":null,"interval":-1,"service":null},{"metric":"threadPool.core","timestamp":null,"value":200.0,"metricType":null,"tags":{},"metricLevel":"MAJOR","meterName":null,"interval":-1,"service":null},{"metric":"threadPool.max","timestamp":null,"value":200.0,"metricType":null,"tags":{},"metricLevel":"MAJOR","meterName":null,"interval":-1,"service":null},{"metric":"threadPool.current","timestamp":null,"value":9.0,"metricType":null,"tags":{},"metricLevel":"MAJOR","meterName":null,"interval":-1,"service":null}]

返回正常,但是页面不展示是什么原因?

不知道你有没有解决,我后来发现是因为点击搜索后,跳转的url未配置路径,我把ServiceMetrics.vue中的调用this.searchByIp(this.filter, true)时把第二个参数改为false就能显示了

dmtd78 commented 5 years ago

[{"metric":"dubbo.provider.success_bucket_count","timestamp":1569359160000,"value":0.0,"metricType":"DELTA","tags":{},"metricLevel":"MAJOR","meterName":null,"interval":5,"service":null},{"metric":"dubbo.provider.bucket_count","timestamp":1569359160000,"value":0.0,"metricType":"DELTA","tags":{},"metricLevel":"MAJOR","meterName":null,"interval":5,"service":null},{"metric":"dubbo.provider.bucket_sum","timestamp":1569359160000,"value":0.0,"metricType":"DELTA","tags":{},"metricLevel":"MAJOR","meterName":null,"interval":5,"service":null},{"metric":"dubbo.provider.qps","timestamp":1569359160000,"value":0.0,"metricType":"GAUGE","tags":{},"metricLevel":"MAJOR","meterName":null,"interval":5,"service":null},{"metric":"dubbo.provider.rt","timestamp":1569359160000,"value":0.0,"metricType":"GAUGE","tags":{},"metricLevel":"MAJOR","meterName":null,"interval":5,"service":null},{"metric":"dubbo.provider.success_rate","timestamp":1569359160000,"value":0.0,"metricType":"GAUGE","tags":{},"metricLevel":"MAJOR","meterName":null,"interval":5,"service":null},{"metric":"dubbo.provider.method.success_bucket_count","timestamp":1569359145000,"value":0.0,"metricType":"DELTA","tags":{"method":"DemoDTO test(String)","service":"com.sunwin.dubbozkpdemo.service.DemoService"},"metricLevel":"NORMAL","meterName":null,"interval":15,"service":"com.sunwin.dubbozkpdemo.service.DemoService"},{"metric":"dubbo.provider.method.bucket_count","timestamp":1569359145000,"value":0.0,"metricType":"DELTA","tags":{"method":"DemoDTO test(String)","service":"com.sunwin.dubbozkpdemo.service.DemoService"},"metricLevel":"NORMAL","meterName":null,"interval":15,"service":"com.sunwin.dubbozkpdemo.service.DemoService"},{"metric":"dubbo.provider.method.bucket_sum","timestamp":1569359145000,"value":0.0,"metricType":"DELTA","tags":{"method":"DemoDTO test(String)","service":"com.sunwin.dubbozkpdemo.service.DemoService"},"metricLevel":"NORMAL","meterName":null,"interval":15,"service":"com.sunwin.dubbozkpdemo.service.DemoService"},{"metric":"dubbo.provider.method.qps","timestamp":1569359145000,"value":0.0,"metricType":"GAUGE","tags":{"method":"DemoDTO test(String)","service":"com.sunwin.dubbozkpdemo.service.DemoService"},"metricLevel":"NORMAL","meterName":null,"interval":15,"service":"com.sunwin.dubbozkpdemo.service.DemoService"},{"metric":"dubbo.provider.method.rt","timestamp":1569359145000,"value":0.0,"metricType":"GAUGE","tags":{"method":"DemoDTO test(String)","service":"com.sunwin.dubbozkpdemo.service.DemoService"},"metricLevel":"NORMAL","meterName":null,"interval":15,"service":"com.sunwin.dubbozkpdemo.service.DemoService"},{"metric":"dubbo.provider.method.success_rate","timestamp":1569359145000,"value":0.0,"metricType":"GAUGE","tags":{"method":"DemoDTO test(String)","service":"com.sunwin.dubbozkpdemo.service.DemoService"},"metricLevel":"NORMAL","meterName":null,"interval":15,"service":"com.sunwin.dubbozkpdemo.service.DemoService"},{"metric":"threadPool.active","timestamp":null,"value":1.0,"metricType":null,"tags":{},"metricLevel":"MAJOR","meterName":null,"interval":-1,"service":null},{"metric":"threadPool.core","timestamp":null,"value":200.0,"metricType":null,"tags":{},"metricLevel":"MAJOR","meterName":null,"interval":-1,"service":null},{"metric":"threadPool.max","timestamp":null,"value":200.0,"metricType":null,"tags":{},"metricLevel":"MAJOR","meterName":null,"interval":-1,"service":null},{"metric":"threadPool.current","timestamp":null,"value":9.0,"metricType":null,"tags":{},"metricLevel":"MAJOR","meterName":null,"interval":-1,"service":null}] 返回正常,但是页面不展示是什么原因?

不知道你有没有解决,我后来发现是因为点击搜索后,跳转的url未配置路径,我把ServiceMetrics.vue中的调用this.searchByIp(this.filter, true)时把第二个参数改为false就能显示了

谢谢,我试试吧!

meteorice commented 4 years ago

image 我只有消费者数据,提供者和线程池以及下面的 服务方法统计 都没数据了

meteorice commented 4 years ago

这个还不能完全能用哟

jackbauer123 commented 4 years ago

image 我只有消费者数据,提供者和线程池以及下面的 服务方法统计 都没数据了

![Uploading image.png…]()

Leme34 commented 8 months ago

我用的Dubbo是2.7.18,对应最高可用dubbo-amin版本为0.3.0,摸着源码自己改好了,有完整的本地运行demo,供大家参考,详见https://github.com/Leme34/dubbo-spi-demo/tree/master/dubbo-admin 1708596086266