1.pom.xml

 <!--springBoot Actuator -->
        <dependency>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-starter-actuator</artifactId>
        </dependency>
        <!--springBoot Actuator 更安全,不对外暴露接口-->
        <dependency>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-starter-security</artifactId>
        </dependency>

 

2.application.properties

#自定义actuator端口
management.server.port=8083
#修改访问路径  2.0之前默认是/   2.0默认是 /actuator  可以通过这个属性值修改
management.endpoints.web.base-path=/monitor
#开放所有页面节点  默认只开启了health、info两个节点
management.endpoints.web.exposure.include=*
#显示健康具体信息  默认不会显示详细信息
management.endpoint.health.show-details=always
#登录账号
spring.security.user.name=admin
#登录密码
spring.security.user.password=123456

3.监控的资源

SpringBoot 2.0配置Atuator

相关文章:

  • 2022-12-23
  • 2022-12-23
  • 2021-08-27
  • 2022-12-23
  • 2021-09-18
  • 2022-12-23
  • 2021-08-22
  • 2021-12-07
猜你喜欢
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-11-10
  • 2021-10-25
  • 2022-12-23
  • 2021-10-09
相关资源
相似解决方案