springboot 提供了对项目的监控功能。

1.首先添加依赖包

<!-- https://mvnrepository.com/artifact/org.springframework.boot/spring-boot-starter-actuator -->
<dependency>
     <groupId>org.springframework.boot</groupId>
    <artifactId>spring-boot-starter-actuator</artifactId>
   <version>2.1.3.RELEASE</version>
</dependency>

2.浏览器访问

http://127.0.0.1:8080/actuator/health  访问项目监控需要加前缀 /actuator

 

因为actuator默认只支持端点 /health、/info 所以访问 /env 会出现404页面。

3.配置端点

在application.properties中配置端点,

暴露部分端点

management.endpoints.web.exposure.include=info,health,beans,env

暴露所有端点

management.endpoints.web.exposure.include=*

不暴露beans端点

management.endpoints.web.exposure.exclude=beans

在上述配置中,首先使用 management.endpoints.web.exposure.include 暴露所有的端点,接着使用management.endpoints .web.exposure.exclud 排除 en 端点,这样就能够暴露除 env 外的所有 ctuator
端点了。

4.端点说明

5.端点其他配置

# Actuator 管理端口
management.server.port=8000
#暴露 有端
management.endpoints.web.exposure.include =女
#默认情况下 有端点都不启用,此时需要按需启用端点
management.endpoints.enabled-by-default=false
#启用端点 info
management.endpoint.info.enabled=true
#启用端点 beans
management.endpoint.beans.enabled=true
#启用端点 configprops
management.endpoint.configprops.enabled=true
#启用端点 env
management.endpont.env.enabled=true
#启用端点 health
management.endpoint.health.enabled=true
#启用端点 mappings
management.endpont.mappings.enabed=true
#启用端点 shutdown
management.endpoint.shutdown.enabled=true
# Actuator 端点前缀
management.endpoints.web.base -path=/manage
#将原来的 mappings 端点的请求路径修改为 urlMappings
management.endpoints.web.path-mapping.mappings=request_mappings
# Spring MVC 视图解析器配置
spring.mvc.view.prefix=/WEB-INF/jsp/
spring.mvc.view.suffix=.Jsp

springboot 监控 Actuator的更多相关文章

  1. SpringBoot系列: Actuator监控

    Sprng Boot 2 actuator变动加大, 网上很多资料都都已经过期. ============================配置项============================ ...

  2. 【spring cloud】【spring boot】网管服务-->配置文件添加endpoints.enabled = false,SpringBoot应用监控Actuator使用的安全隐患

    转载:https://xz.aliyun.com/t/2233 ==================================================================== ...

  3. SpringBoot集成Actuator监控管理

    1.说明 本文详细介绍Spring Boot集成Actuator监控管理的方法, 基于已经创建好的Spring Boot工程, 然后引入Actuator依赖, 介绍监控管理相关功能的使用. Sprin ...

  4. springboot集成Actuator

    Actuator监控端点,主要用来监控与管理. 原生端点主要分为三大类:应用配置类.度量指标类.操作控制类. 应用配置类:获取应用程序中加载的配置.环境变量.自动化配置报告等与SpringBoot应用 ...

  5. SpringBoot 之Actuator.

    一.Actuator 介绍 Actuator 是 SpringBoot 项目中一个非常强大一个功能,有助于对应用程序进行监视和管理,通过 restful api 请求来监管.审计.收集应用的运行情况. ...

  6. Springboot监控之二:Spring Boot Admin对Springboot服务进行监控

    概述 Spring Boot 监控核心是 spring-boot-starter-actuator 依赖,增加依赖后, Spring Boot 会默认配置一些通用的监控,比如 jvm 监控.类加载.健 ...

  7. SpringBoot 开启 Actuator

    在生产环境中,需要实时或定期监控服务的可用性.spring-boot 的actuator(监控)功能提供了很多监控所需的接口.简单的配置和使用如下: 1.引入依赖: <dependency> ...

  8. SpringBoot集成actuator模块的基本使用

    © 版权声明:本文为博主原创文章,转载请注明出处 1. 版本 SpringBoot:2.0.0.RELEASE 2. 集成 SpringBoot集成actuator模块非常简单,只需要引入actuat ...

  9. SpringBoot入门教程(十)应用监控Actuator

    Actuator可能大家非常熟悉,它是springboot提供对应用自身监控,以及对应用系统配置查看等功能.spring-boot-starter-actuator模块的实现对于实施微服务的中小团队来 ...

随机推荐

  1. UIAlertControllerStyleActionSheet 崩溃。

    即使Devices 设置为iPhone模式,在审核时还是运行在iPad的小屏模式下.因此必须 UIActivityViewController UIAlertControllerStyleAction ...

  2. requests应用

    一.简介 什么是requests模块: requests模块是python中原生的基于网络请求的模块,其主要作用是用来模拟浏览器发起请求.功能强大,用法简洁高效.在爬虫领域中占据着半壁江山的地位. 为 ...

  3. Dot & cross product

    https://www.khanacademy.org/math/linear-algebra/vectors-and-spaces/dot-cross-products/v/vector-dot-p ...

  4. ie被hao.360劫持的解决方法

    概述 之前无意中发现ie被hao.360劫持了,只要打开网址就会跳到hao.360,然后显示网络错误.网上试了几种解决方法,都不行,最后被我用重置ie浏览器的方法解决了.我总结了一下,把各种方案都记下 ...

  5. Sequelize 学习笔记(11)- Migrations 迁移

    一.作用 类似 git 管理源代码 一样,维护你的 DB. 二.安装 npm install --save sequelize-cli 三.使用 1.构建项目时 node_modules/.bin/s ...

  6. Maven - 实例-6-聚合与继承

    创建项目 xxx - 继承自testDep.PPP <project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi= ...

  7. PHP使用Zend Opcache之优化加速和缓存清理总结

    简介 字节码缓存不是php的新特性,有很多独立性的扩展可以实现缓存,比如PHP Cache(APC),eAccelerator,ionCube和XCache等等.但是到目前为止,这些独立的扩展并没有集 ...

  8. Comparable接口和Comparator接口的不同用法

    两者都可用来在定义比较方法,然后用在排序中. Comparable是类本身继承的接口 Comparator实在类外定义一个排序的类 比较而言,觉得Comparator更灵活一些,但是Comparabl ...

  9. 关于JS的一些东西

    1.声明Js代码域    1.在head标签中使用script声明js代码域    <head>        ....        <!--声明js代码域-->       ...

  10. Spring Boot + Spring Cloud 构建微服务系统(八):分布式链路追踪(Sleuth、Zipkin)

    技术背景 在微服务架构中,随着业务发展,系统拆分导致系统调用链路愈发复杂,一个看似简单的前端请求可能最终需要调用很多次后端服务才能完成,那么当整个请求出现问题时,我们很难得知到底是哪个服务出了问题导致 ...