zoukankan      html  css  js  c++  java
  • Spring Boot Actuator 监控实践

    Actuator是Spring Boot提供的对应用系统的自省和监控的集成功能,可以查看应用配置的详细信息,例如自动化配置信息、创建的Spring beans以及一些环境属性等。

    1、创建Spring Boot工程,pom.xml的配置如下

        <parent>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-starter-parent</artifactId>
            <version>2.2.6.RELEASE</version>
            <relativePath/> 
        </parent>
    
        <dependencies>
            <dependency>
                <groupId>javax.servlet</groupId>
                <artifactId>javax.servlet-api</artifactId>
                <version>3.1.0</version>
                <scope>provided</scope>
            </dependency>
    
            <dependency>
                <groupId>org.springframework.boot</groupId>
                <artifactId>spring-boot-starter-web</artifactId>
            </dependency>
    
            <dependency>
                <groupId>org.springframework.boot</groupId>
                <artifactId>spring-boot-starter</artifactId>
            </dependency>
    
            <dependency>
                <groupId>org.springframework.boot</groupId>
                <artifactId>spring-boot-starter-actuator</artifactId>
            </dependency>
    
            
        </dependencies>
    

      

    2、applicatoin.yml 配置如下

    #定义监控访问的端口
    management:
      server:
        port: 9090
      # 默认Actuator只暴露了health和info端点,在SpringBoot的application.yml配置文件中加入这句话暴露所有端点
      endpoints:
        web:
          exposure:
            include: "*"
    

      

    3、访问。

    返回的是actuator返回提供的接口

    4、提供的接口介绍



  • 相关阅读:
    5.Docker服务进程关系
    朴素贝叶斯知识点概括
    k近邻法(KNN)知识点概括
    机器学习的应用实例
    HNU 10111 0-1矩阵
    CSU 1421 Necklace
    Poj 3469 Dual Core CPU
    Poj 2135 Farm Tour
    Poj 3180 The Cow Prom
    HDU 1004 Let the Balloon Rise
  • 原文地址:https://www.cnblogs.com/linlf03/p/12692158.html
Copyright © 2011-2022 走看看