SpringBoot服务监控

2021-07-12 07:05

阅读:656

标签:需要   info   text   manage   依赖   信息   ati   png   pre   

SpringBoot服务监控分为客户端和服务端,即服务端是监控方,客户端为被监控方。

例如需要对线上的SpringBoot服务project-A进行监控,则project-A 为客户端。而监控的服务project-B则为服务端。客户端将被监控的数据信息发送到服务端进行UI展示。

客户端project-A依赖的jar:     

     
        org.springframework.boot
            spring-boot-starter-actuator
        de.codecentric
            spring-boot-admin-starter-client
            1.5.6

 在配置文件中添加配置:

spring.application.name=project-A
server.port=5566
#将该服务的各指标监控信息在app-monitor服务上展示
spring.boot.admin.url=http://xxxx.xxxx.xxx.com:8056/app-monitor
#关闭安全校验
management.security.enabled=false

 

服务端project-B依赖的jar:

      org.springframework.boot
            spring-boot-starter-actuator
        de.codecentric
            spring-boot-admin-server
            1.5.6de.codecentric
            spring-boot-admin-server-ui
            1.5.6

 配置文件的配置:

spring.application.name=app-monitor
server.port=8056
server.context-path=/app-monitor

  然后启动这两个服务,打开project-B服务的url 

http://xxxx.xxxx.xxx.com:8056/app-monitor
看到如下的界面:

 技术分享图片

技术分享图片

 

                                                                                                                                     

SpringBoot服务监控

标签:需要   info   text   manage   依赖   信息   ati   png   pre   

原文地址:https://www.cnblogs.com/wrong5566/p/9548731.html


评论


亲,登录后才可以留言!