如何集成prometheus?
1.添加pom依赖
注意:prometheus的版本依赖springboot版本,示例使用的springboot版本的2.3.X.
2.配置文件添加配置
3.主启动类添加如下配置
4.验证端点
SpringBoot项目到这里就配置完成了,启动项目,访问http://localhost:port/actuator/prometheus,如图所示,可以看到一些度量指标。
注意:prometheus的版本依赖springboot版本,示例使用的springboot版本的2.3.X.
SpringBoot项目到这里就配置完成了,启动项目,访问http://localhost:port/actuator/prometheus,如图所示,可以看到一些度量指标。