使用 Spring Boot Admin 来监控你的服务
来源:互联网 发布:淘宝怎么上架莆田鞋 编辑:程序博客网 时间:2024/05/24 15:36
Spring boot 的出现,大大的简化了传统的软件开发流程,同时,软件的架构也在向微服务靠拢。而Spring 基于此,给我们提供了非常强大的基础设施 – Spring cloud 系列项目。本文将基于 Spring cloud 以及 Spring boot, 介绍怎样使用 Spring boot admin 来监控Spring cloud 提供的微服务基础设施。
当我们使用 Spring boot 进行开发之时, 它提供了一个非常有用的模块: spring-boot-starter-actuator
, 这个模块提供了以下的 endpoint 用于监控我们的服务:
actuator
Provides a hypermedia-based “discovery page” for the other endpoints. Requires Spring HATEOAS to be on the classpath. true auditevents
Exposes audit events information for the current application. true autoconfig
Displays an auto-configuration report showing all auto-configuration candidates and the reason why they ‘were’ or ‘were not’ applied. true beans
Displays a complete list of all the Spring beans in your application. true configprops
Displays a collated list of all @ConfigurationProperties
. true dump
Performs a thread dump. true env
Exposes properties from Spring’s ConfigurableEnvironment
. true flyway
Shows any Flyway database migrations that have been applied. true health
Shows application health information (when the application is secure, a simple ‘status’ when accessed over an unauthenticated connection or full message details when authenticated). false info
Displays arbitrary application info. false loggers
Shows and modifies the configuration of loggers in the application. true liquibase
Shows any Liquibase database migrations that have been applied. true metrics
Shows ‘metrics’ information for the current application. true mappings
Displays a collated list of all @RequestMapping
paths. true shutdown
Allows the application to be gracefully shutdown (not enabled by default). true trace
Displays trace information (by default the last 100 HTTP requests). true如果使用了Spring MVC, 还额外提供了以下的 endpoint:
docs
Displays documentation, including example requests and responses, for the Actuator’s endpoints. Requires spring-boot-actuator-docs
to be on the classpath. false heapdump
Returns a GZip compressed hprof
heap dump file. true jolokia
Exposes JMX beans over HTTP (when Jolokia is on the classpath). true logfile
Returns the contents of the logfile (if logging.file
or logging.path
properties have been set). Supports the use of the HTTP Range
header to retrieve part of the log file’s content. true但是光有对应的 API 而没有界面, 这样也不便于我们查看,所以这里介绍一个开源项目: Spring Boot Admin ,它提供了对 Spring boot 的 endpoint UI 界面支持, 同时也提供了对 Spring cloud 的一些支持。
因为用到的配置项和涉及的模块有点多,所以在此就不具体介绍配置,只是简单介绍一下我们会使用到的几个服务,其他的配置项,可以自行查看源码 。
在本篇文章中,我们只需用到以下三个模块:
- mcloud-blog 这个模块是个简单的博客系统,这里仅用作示例
- mcloud-monitoring 最重要的就是这个模块,使用了 Spring Boot Admin 实现了整个服务的监控
- mcloud-eureka 非常简单的一个模块,主要提供了服务注册与发现功能,用于 Spring Boot Admin 查找可用的服务
下载源码并启动上面三个模块后,访问 http://localhost:18080/monitoring/
,就可以看到最终的效果:
对于 Spring Boot Admin 就简单的介绍到这,整个 MCloud 系列项目还有很多模块,后续会一一介绍。
阅读全文
0 0
- 使用 Spring Boot Admin 来监控你的服务
- Spring boot Admin 使用eureka监控服务
- 使用spring-boot-admin对spring-boot服务进行监控
- Spring Boot Admin服务监控
- spring-boot 之 使用Admin监控应用
- spring-boot 之 使用Admin监控应用
- spring-boot 之 使用Admin监控应用
- spring-boot 之 使用Admin监控应用
- spring-boot 之 使用Admin监控应用
- Spring cloud eureka+Client+Spring boot admin 服务注册监控
- Spring Boot Admin 的使用
- Spring Boot Admin的使用
- Spring Boot Admin 的使用
- Spring Boot Admin 的使用
- Spring Boot Admin的使用
- Spring Boot Admin的使用
- Spring Boot Admin 的使用
- Spring Boot Admin的使用
- Java中的低耦合高内聚法则
- Go GIF 动画
- 51nod-1284 2 3 5 7的倍数 (容斥原理)
- ZCMU2016: 不存在的树 (2017浙江中医药校赛) (树链剖分)
- AXI 的乱序操作
- 使用 Spring Boot Admin 来监控你的服务
- 史上最简单的SpringCloud教程 | 第七篇: 高可用的分布式配置中心(Spring Cloud Config)
- 超级简单的标签页
- win10 蓝屏问题及解决
- 统计量及抽样分布(统计学复习)
- HTML笔记2
- jqueryUI的下载以及引用
- JMS(三)--ActiveMQ简单的HelloWorld实例
- 安装完YUI Compressor后 sublime ctrl+b控制台不输出