SpringBoot 2.x 监控中心:Actuator

转载请标明出处:http://blog.csdn.net/zhaoyanjun6/article/details/80762234
本文出自【赵彦军的博客】

简介

Actuatorspring boot项目中非常强大一个功能,有助于对应用程序进行监视和管理,通过 restful api请求来监管、审计、收集应用的运行情况,针对微服务而言它是必不可少的一个环节。

依赖集成

buildscript {
    ext {
        springBootVersion = '2.0.2.RELEASE'
    }
    repositories {
        mavenCentral()
    }
    dependencies {
        classpath("org.springframework.boot:spring-boot-gradle-plugin:${springBootVersion}")
    }
}

apply plugin: 'java'
apply plugin: 'eclipse'
apply plugin: 'org.springframework.boot'
apply plugin: 'io.spring.dependency-management'

group = 'com.yanjun'
version = '0.0.1-SNAPSHOT'
sourceCompatibility = 1.8

repositories {
    mavenCentral()
}


dependencies {
    compile('org.springframework.boot:spring-boot-starter',
            'org.springframework.boot:spring-boot-starter-web',
            'org.springframework.boot:spring-boot-starter-actuator'  //监控中心
    )
}

application.yml 里填写配置信息

management:
  server:
    port: 8083  #自定义actuator端口
  endpoints:
    web:
      exposure:
        include: "*"  #监控所有的接口

server:
  port: 8080  #自定义spring服务端口

内置Endpoints

名字作用
beans显示应用Spring Beans的完整列表
health显示应用的健康信息(未认证只显示status,认证显示全部信息详情)
info显示自定义的应用信息(在资源文件写info.xxx即可)
mappings显示所有 @RequestMapping 路径集列表
scheduledtasks显示应用程序中的计划任务
threaddump显示线程dump
httptrace示HTTP跟踪信息(默认显示最后100个HTTP请求 - 响应交换)
conditions显示所有 @ConfigurationProperties 列表
caches显示可用缓存信息

个人微信号:zhaoyanjun125 , 欢迎关注

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值