actuator端点监控

actuator 配置端点检查

订单服务


    org.springframework.boot
    spring-boot-starter-actuator

management.endpoints.enabled-by-default=true
management.endpoints.web.base-path=/actuator
#management.endpoints.web.exposure.exclude 排除的端点
management.endpoints.web.exposure.include=*
management.endpoint.health.show-details=always

启动项目,发现有许多mapper注入,/actuator/env、/actuator/info、/actuator/health、actuator/beans等

[main] INFO  o.s.b.a.e.web.EndpointLinksResolver 87 - Exposing 0 endpoint(s) beneath base path '/actuator'

访问http://127.0.0.1:9230/actuator/

Spring Boot Admin

Spring Boot Admin 是一个管理和监控Spring Boot 应用程序的开源软件,它针对spring-

boot的actuator接口进行UI美化封装

(1)创建yww-admin-server项目

        
            org.springframework.boot
            spring-boot-starter-web
        
        
            de.codecentric
            spring-boot-admin-starter-server
        
        
            de.codecentric
            spring-boot-admin-starter-server-ui
        
spring.pplication.name=admin-server
server.port=9990

启动类@EnableAdminServer

(2)配置客户端

        
            de.codecentric
            spring-boot-admin-starter-client
            2.1.0
        
spring.boot.admin.url=http://127.0.0.1:9990

访问http://localhost:9990

你可能感兴趣的:(actuator端点监控)