springboot监控
springboot版本
<parent>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-parent</artifactId>
<version>1.5.8.RELEASE</version>
<relativePath/> <!-- lookup parent from repository -->
</parent>
监控类型
1.以json串的格式返回监控信息(spring-boot-starter-actuator)
2.以图形化界面的方式返回监控内容(spring-boot-admin-starter-server、spring-boot-admin-starter-client)
监控内容
spring-boot-starter-actuator(支持自定义)

如果使用springMVC还可以监控以下内容

spring-boot-admin

spring-boot-starter-actuator配置
pom.xml
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-actuator</artifactId>
</dependency>
<!-- 安全方面,可选配置 -->
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-security</artifactId>
</dependency>
application.yml
management:
# 是否启用认证
security:
enabled: false
# 监控端口
port: 8088
# 监控上下文路径
context-path: /monitor
# 启用shutdown,实现springboot项目优雅停机,要考虑安全问题,默认不启用
endpoints:
shutdown:
enabled: true
# 认证账号、密码,需要spring-boot-starter-security支持,可选配置
#security:
# user:
# name: wly
# password: wly
# role=SUPERUSER
# spring boot信息,可选配置
info:
app:
name: spring-boot-actuator-wly
version: 1.0.0
访问监控URL
http://localhost:8088/monitor/env
效果

spring-boot-admin配置
spring-boot-admin-starter-server配置,需要单独建立一个监控的项目
pom.xml
<dependency>
<groupId>de.codecentric</groupId>
<artifactId>spring-boot-admin-server</artifactId>
<version>1.5.6</version>
</dependency>
<dependency>
<groupId>de.codecentric</groupId>
<artifactId>spring-boot-admin-server-ui</artifactId>
<version>1.5.6</version>
</dependency>
application.yml
server.port=8085
启动类(添加@EnableAdminServer注解)
package com.example.springbootadmin; import de.codecentric.boot.admin.config.EnableAdminServer;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication; @SpringBootApplication
@EnableAdminServer
public class SpringbootadminApplication { public static void main(String[] args) {
SpringApplication.run(SpringbootadminApplication.class, args);
}
}
配置完成启动项目即可~
spring-boot-admin-starter-client配置
pom.xml
<dependency>
<groupId>de.codecentric</groupId>
<artifactId>spring-boot-admin-starter-client</artifactId>
<version>1.5.6</version>
</dependency>
application.yml
# 配置spring-boot-admin-starter-server的监控地址
spring:
boot:
admin:
url: http://localhost:8085
server:
port: 8080
management:
# 是否启用认证
security:
enabled: false
配置完成启动服务即可~
效果
访问spring-boot-admin-starter-server地址(localhost:8085)


springboot监控的更多相关文章
- springboot 监控 Actuator
springboot 提供了对项目的监控功能. 1.首先添加依赖包 <!-- https://mvnrepository.com/artifact/org.springframework.boo ...
- Springboot监控之二:Spring Boot Admin对Springboot服务进行监控
概述 Spring Boot 监控核心是 spring-boot-starter-actuator 依赖,增加依赖后, Spring Boot 会默认配置一些通用的监控,比如 jvm 监控.类加载.健 ...
- springboot 监控
一.什么是spring-boot-starter-actuator(doc) springboot项目如何检查配置与运行状态呢?官方提供了一些接口可以查看springboot项目运行情况,只需要导入s ...
- Springboot监控之一:SpringBoot四大神器之Actuator之3-springBoot的监控和管理--指标说明
Spring Boot包含很多其他的特性,它们可以帮你监控和管理发布到生产环境的应用.你可以选择使用HTTP端点,JMX或远程shell(SSH或Telnet)来管理和监控应用.审计(Auditing ...
- Springboot监控之一:SpringBoot四大神器之Actuator
介绍 Spring Boot有四大神器,分别是auto-configuration.starters.cli.actuator,本文主要讲actuator.actuator是spring boot提供 ...
- Grafana+Prometheus打造springboot监控平台
1. 环境 springboot 1.5.10.RELEASE Grafana 5.4.2 Prometheus 2.6.0 jdk 1.8 2.通过micrometer与springboot应用和p ...
- SpringBoot 监控管理模块actuator没有权限的问题
SpringBoot 1.5.9 版本加入actuator依赖后, 访问/beans 等敏感的信息时候报错,如下 Tue Mar 07 21:18:57 GMT+08:00 2017 There wa ...
- Springboot监控之一:SpringBoot四大神器之Actuator之2--springboot健康检查
Health 信息是从 ApplicationContext 中所有的 HealthIndicator 的 Bean 中收集的, Spring Boot 内置了一些 HealthIndicator. ...
- Springboot监控之一:SpringBoot四大神器之Actuator之2--覆盖修改spring cloud的默认的consul健康检查规则
微服务网关是socket长连接与支付公司对接,该网关需要提供http接口给内部系统调用,当socket没有建立连接时(网关服务的高可用是haProxy搭建的,有些服务的socket可能未连上支付公司) ...
随机推荐
- mysql只能本机访问
众所周知的是,mysql默认是listen 0.0.0.0:3306. 大网站的数据库服务器一般都在内网没有外网ip,用默认配置比较省事.但是如果只有一台vps,lnmp全部署在同一vps 上,mys ...
- 安装win7 64位和win10 64位双系统小结
1.gpt比mbr更先进.与主启动记录 (MBR) 分区方法相比,GPT 具有更多的优点,因为它允许每个磁盘有多达 128 个分区(mbr只支持4个分区),支持高达 18 千兆兆字节的卷大小,允许将主 ...
- SymbolTable
在ClassReader中有两个重要的属性,如下定义: /** A hashtable containing the encountered top-level and member classes, ...
- HttpClient使用详细教程
Http协议的重要性相信不用我多说了,HttpClient相比传统JDK自带的URLConnection,增加了易用性和灵活性(具体区别,日后我们再讨论),它不仅是客户端发送Http请求变得容易,而且 ...
- unity字库精简
有2种办法,具体看情况使用 1.unity自带功能 选择放入的字体,修改Character项为"Custom set",接着出现Custom Chars中输入你想使用的字符串,字符 ...
- VMware虚拟机配置
VMware虚拟机配置 背景 在做学习Linux时经常会在win环境下安装虚拟机,这其中涉及到一些细节操作,需要对虚拟机工作模式加以理解. 本文在学习hadoop分布式环境搭建时写作. 1.虚拟交换机 ...
- 使用minikube在本机测试kubernetes
目录 简介 安装 Docker CE 安装 kubectl 安装 minikube 启动 minikube 启动 dashboard 启动一个服务 删除服务 参考 本文主要讲解 minikube(ku ...
- 关于安装多个版本jdk之后java -version不正确的问题
问题描述: 今天突然想写一个socket通信的小应用,分别采用BIO.NIO.AIO的方式来实现,来复习前面看的关于TCP/UDP通信的知识.于是乎在原来安装了jdk1.6的机子上重新安装了jdk1. ...
- Android6.0.1 移植:显示系统(一)--测试framebuffer
#include <stdio.h> #include <unistd.h> #include <sys/types.h> #include <sys/sta ...
- 基础语言知识C++
强制转换: (Cplusplus基础与提高(何桂林)21页) static_cast:有隐式转换的 格式: static_cast<目标类型> (标识符) int a = 10; int ...