項目之前一直使用的SpringBoot 1.5.10 (SpringCloud Dalston.RELEASE),prometheus監控的依賴micrometer-registry-prometheus 1.0.3;監控數據一切正常。
但是在發現Spring-cloud-netflix 1.4.x存在嚴重bug以后,升級了版本到SpringBoot 1.5.22 (SpringCloud Edgware.SR6),然后就出現了詭異的問題,有些服務Tomcat線程監控項顯示為0,有些服務卻正常,通過debug獲取Tomcat線程,這些顯示為0的服務,只是顯示異常,實際線程配置已經生效。
tomcat_threads_config_max{application="micrometer-gateway",name="http-nio-8080",} 0.0
tomcat_threads_busy{application="micrometer-gateway",name="http-nio-8080",} 0.0
tomcat_threads_current{application="micrometer-gateway",name="http-nio-8080",} 0.0
總結最近遇到的一些靈異問題,好多都是版本原因導致,想著把prometheus監控的依賴版本升級試試,在Apache中央倉庫查了下,發現此版本最高是micrometer-registry-prometheus 1.0.11,果斷把micrometer-spring-legacy和micrometer-registry-prometheus升級到了1.011,測試顯示就正常了。


