整合 Spring Boot 与 Prometheus 实现自定义监控指标
我在第二章中有介绍使用koa整合Prometheus自定义指标,这里记录下整合Springboot和Prometheus实现自定义指标 要在Spring Boot中使用Micrometer-registry-prometheus记录QPS和响应时间,可以按照以下步骤操作 Spring-boot-starter-actuatorSpringBoot中的spring-boot-starter-actuator依赖已经集成了对Micrometer的支持,其中的metrics端点的很多功能就是通过Micrometer实现的,prometheus端点默认也是开启支持的,实际上actuator依赖的spring-boot-actuator-autoconfigure中集成了对很多框架的开箱即用的API,其中prometheus包中集成了对Prometheus的支持,使得使用了actuator可以轻易地让项目暴露出prometheus端点,使得应用作为Prometheus收集数据的客户端,Prometheus(服务端软件)可以通过此端点收集应用中Micrometer的度量数据。 整合M...
