SpringBoot系列--【如何集成prometheus?】

如何集成prometheus?

1.添加pom依赖


注意:prometheus的版本依赖springboot版本,示例使用的springboot版本的2.3.X.

2.配置文件添加配置

3.主启动类添加如下配置

4.验证端点

SpringBoot项目到这里就配置完成了,启动项目,访问http://localhost:port/actuator/prometheus,如图所示,可以看到一些度量指标。

猜你喜欢

转载自blog.csdn.net/weixin_44988127/article/details/131821706