微服务 指标监控SpringBoot Actuator

微服务 指标监控SpringBoot Actuator

一、简介

未来每一个微服务在云上部署以后,我们都需要对其进行监控、追踪、审计、控制等。SpringBoot就抽取了Actuator场景,使得我们每个微服务快速引用即可获得生产级别的应用监控、审计等功能

二、使用

1、引入依赖

        <dependency>
            <groupId>org.springframework.bootgroupId>
            <artifactId>spring-boot-starter-actuatorartifactId>
        dependency>

2、配置开启端点

management:
  endpoints:
    enabled-by-default: true #暴露所有端点信息
    web:
      exposure:
        include: '*'  #以web方式暴露

访问地址
http://localhost:8080/actuator/**
http://localhost:8080/actuator/beans
http://localhost:8080/actuator/configprops
http://localhost:8080/actuator/metrics
http://localhost:8080/actuator/metrics/jvm.gc.pause
http://localhost:8080/actuator/endpointName/detailPath

可视化
https://github.com/codecentric/spring-boot-admin

详细信息官网有介绍:
https://docs.spring.io/spring-boot/docs/current/reference/html/production-ready-features.html#production-ready

微服务 指标监控SpringBoot Actuator_第1张图片

你可能感兴趣的:(服务架构,spring,spring,boot,Actuator,监控)