User-Profile-Image
hankin
  • 5
  • Java
  • Kotlin
  • Spring
  • Web
  • SQL
  • MegaData
  • More
  • Experience
  • Enamiĝu al vi
  • 分类
    • Zuul
    • XML
    • WebSocket
    • Web Notes
    • Web
    • Vue
    • Thymeleaf
    • SQL Server
    • SQL Notes
    • SQL
    • SpringSecurity
    • SpringMVC
    • SpringJPA
    • SpringCloud
    • SpringBoot
    • Spring Notes
    • Spring
    • Servlet
    • Ribbon
    • Redis
    • RabbitMQ
    • PostgreSQL
    • OAuth2
    • NOSQL
    • Netty
    • MySQL
    • MyBatis
    • More
    • MegaData
    • Maven
    • LoadBalancer
    • Kotlin Notes
    • Kotlin
    • jQuery
    • JavaScript
    • Java Notes
    • Java
    • Hystrix
    • Git
    • Gateway
    • Freemarker
    • Feign
    • Eureka
    • Enamiĝu al vi
    • ElasticSearch
    • Docker
    • Consul
    • Ajax
    • ActiveMQ
  • 页面
    • 归档
  • 友链
    • Spring Cloud Alibaba
    • Spring Cloud
    • Nacos
    • Docker
    • ElasticSearch
    • Kotlin
    • Kotlin易百
    • KotlinWeb3
    • KotlinNhooo
    • 前端开源搜索
    • Ktorm ORM
    • Ktorm-KSP
    • Ebean ORM
    • Maven
    • 江南一点雨
    • 江南国际站
    • 设计模式
    • 熊猫大佬
    • java学习
    • kotlin函数查询
    • Istio 服务网格
    • istio
    • Ktor 异步 Web 框架
    • PostGis
    • kuangstudy
    • 源码地图
    • it教程吧
    • Arthas-JVM调优
    • Electron
    • bugstack虫洞栈
    • github大佬宝典
    • Sa-Token
    • 前端技术胖
    • bennyhuo-Kt大佬
    • Rickiyang博客
    • 李大辉大佬博客
    • KOIN
    • SQLDelight
    • Exposed-Kt-ORM
    • Javalin—Web 框架
    • http4k—HTTP包
    • 爱威尔大佬
    • 小土豆
    • 小胖哥安全框架
    • 负雪明烛刷题
    • Kotlin-FP-Arrow
    • Lua参考手册
    • 美团文章
    • 666资源站
    • Java 全栈知识体系
    • 尼恩架构师学习
    • 现代 JavaScript 教程
Help?

Please contact us on our email for need any support

Support
    首页   ›   Spring   ›   SpringBoot   ›   正文
SpringBoot

SpringBoot—应用监控之Spring Boot Admin

2020-04-21 21:38:04
729  0 0

参考目录

  • Admin 简介
  • Admin 使用及配置
  • Spring Boot Admin 服务端
  • 测试
  • Spring Boot Admin 客户端
  • Spring Boot Admin 配置属性
  • Spring Boot Admin Server 配置属性详解
  • Spring Boot Admin Client 配置属性详解

阅读完需:约 8 分钟

Admin 简介

Spring Boot Admin 是 Spring Boot 应用程序运行状态监控和管理的后台界面。最新UI使用vue.js重写里。

Spring Boot Admin 为已注册的应用程序提供了丰富的监控运维功能。如下:

  • 显示健康状况
  • 显示应用运行时的详细信息,如:JVM 和内存指标等
  • 计数器和测量指标
  • 数据源度量
  • 缓存度量
  • 跟踪和下载日志文件
  • 查看 jvm 系统和环境属性
  • 一键管理loglevel
  • 管理执行 JMX-beans
  • 查看线程转储
  • 查看跟踪信息
  • Hystrix-Dashboard集成(2.X版本已删除集成)
  • 下载 heapdump
  • 状态更改通知(支持:电子邮件、Slack、Hipchat等)
  • 状态更改事件日志(非永久性)

更多可以通过考文档详细了解。

Admin 使用及配置

Spring Boot Admin 服务端

项目依赖

    <dependency>
        <groupId>org.springframework.boot</groupId>
        <artifactId>spring-boot-starter-web</artifactId>
    </dependency>
	<!-- admin-server -->
		<dependency>
			<groupId>de.codecentric</groupId>
			<artifactId>spring-boot-admin-starter-server</artifactId>
			<version>2.1.6</version>
		</dependency>

配置启动 Admin Server

@SpringBootApplication
@EnableAutoConfiguration
@EnableAdminServer
public class SpringBootAdminApplication {

	public static void main(String[] args) {
		SpringApplication.run(SpringBootAdminApplication.class, args);
	}

}

application.properties 配置

server.port=9000
spring.application.name=Spring Boot Admin Web

测试

启动项目,通过浏览器访问 http://127.0.0.1:9000

Spring Boot Admin 客户端

这里以上面是 Spring Boot Actuator 项目为例

项目依赖

<!-- admin-client -->
		<dependency>
			<groupId>de.codecentric</groupId>
			<artifactId>spring-boot-admin-starter-client</artifactId>
			<version>2.1.6</version>
		</dependency>

application.properties 配置

#设置 Admin Server 地址
server.port=8080
spring.application.name=Spring Boot Actuator Demo
spring.boot.admin.client.url=http://127.0.0.1:9000

测试

启动项目,通过浏览器访问 http://127.0.0.1:9000,我们会看到 Spring Boot Admin 的管理界面中 applications 会显示相应的客户端应用,点击应用进入详细的监控界面。

Spring Boot Admin 配置属性

Spring Boot Admin Server 配置属性详解

属性描述默认值
spring.boot.admin.context-path上下文路径在应为Admin Server的静态资产和API提供服务的路径的前面加上前缀。相对于Dispatcher-Servlet/
spring.boot.admin.monitor.status-interval更新client端状态的时间间隔,单位是毫秒10000
spring.boot.admin.monitor.status-lifetimeclient端状态的生命周期,该生命周期内不会更新client状态,单位是毫秒10000
spring.boot.admin.monitor.connect-timeout查询client端状态信息时的连接超时,单位是毫秒2000
spring.boot.admin.monitor.read-timeout查询client端状态信息时的读取超时时间,单位是毫秒10000
spring.boot.admin.monitor.default-retries失败请求的默认重试次数。Modyfing请求(PUT,POST,PATCH,DELETE)将永远不会重试0
spring.boot.admin.monitor.retries.*键值对,具有每个endpointId的重试次数。默认为默认重试。Modyfing请求(PUT,POST,PATCH,DELETE)将永远不会重试
spring.boot.admin.metadata-keys-to-sanitize要被过滤掉的元数据(当与正则表达式相匹配时,这些数据会在输出的json数据中过滤掉)“.password$”, “.secret$”, “.key$”, “.$token$”, “.credentials.”, “.*vcap_services$”
spring.boot.admin.probed-endpoints要获取的client的端点信息“health”, “env”, “metrics”, “httptrace:trace”, “threaddump:dump”, “jolokia”, “info”, “logfile”, “refresh”, “flyway”, “liquibase”, “heapdump”, “loggers”, “auditevents”
spring.boot.admin.instance-proxy.ignored-headers向client发起请求时不会被转发的headers信息“Cookie”, “Set-Cookie”, “Authorization”
spring.boot.admin.ui.public-url用于在ui中构建基本href的基本URL如果在反向代理后面运行(使用路径重写),则可用于进行正确的自我引用。如果省略了主机/端口,将从请求中推断出来
spring.boot.admin.ui.brand导航栏中显示的品牌<img src="assets/img/icon-spring-boot-admin.svg"><span>Spring Boot Admin</span>
spring.boot.admin.ui.title页面标题“Spring Boot Admin”
spring.boot.admin.ui.favicon用作默认图标的图标,用于桌面通知的图标“assets/img/favicon.png”
spring.boot.admin.ui.favicon-danger当一项或多项服务关闭并用于桌面通知时,用作网站图标“assets/img/favicon-danger.png”

Spring Boot Admin Client 配置属性详解

属性描述默认值
spring.boot.admin.client.enabled启用Spring Boot Admin Clienttrue
spring.boot.admin.client.url要注册的server端的url地址。如果要同时在多个server端口注册,则用逗号分隔各个server端的url地址
spring.boot.admin.client.api-path管理服务器上注册端点的Http路径“instances”
spring.boot.admin.client.username如果server端需要进行认证时,该属性用于配置用户名
spring.boot.admin.client.password如果server端需要进行认证时,该属性用于配置密码
spring.boot.admin.client.period重复注册的时间间隔(以毫秒为单位)10000
spring.boot.admin.client.connect-timeout连接注册的超时时间(以毫秒为单位)5000
spring.boot.admin.client.read-timeout读取注册超时(以毫秒为单位)5000
spring.boot.admin.client.auto-registration如果设置为true,则在应用程序准备就绪后会自动安排注册应用程序的定期任务true
spring.boot.admin.client.auto-deregistration当上下文关闭时,切换为在Spring Boot Admin服务器上启用自动解密。如果未设置该值,并且在检测到正在运行的CloudPlatform时,该功能处于活动状态null
spring.boot.admin.client.register-once如果设置为true,则客户端将仅向一台管理服务器注册(由定义spring.boot.admin.instance.url);如果该管理服务器出现故障,将自动向下一个管理服务器注册。如果为false,则会向所有管理服务器注册true
spring.boot.admin.client.instance.health-url要注册的health-url地址。如果可访问URL不同(例如Docker),则可以覆盖。在注册表中必须唯一默认该属性值与management-url 以及endpoints.health.id有关。比如工程中该值为:healthUrl=http://127.0.0.1:8080/actuator/health,其中http://127.0.0.1:8080/actuator是management-url,health是endpoints.health.id
spring.boot.admin.client.instance.management-base-url用于计算要注册的管理URL的基本URL。该路径是在运行时推断的,并附加到基本URL默认该属性值与management.port, service-url 以及server.servlet-path有关,如工程中该值为http://127.0.0.1:8080,其中8080端口是配置的获取actuator信息的端口。127.0.0.1是设置的service-url值,如果没有设置service-url的话,则为配置的server.servlet-path值(项目的启动路径)
spring.boot.admin.client.instance.management-url要注册的management-url。如果可访问的URL不同(例如Docker),则可以覆盖默认该属性值与management-base-url 和 management.context-path两个属性值有关,如 managementUrl=http://127.0.0.1:8080/actuator,其中http://127.0.0.1:8080为management-base-url,/actuator是management.context-path
spring.boot.admin.client.instance.service-base-url用于计算要注册的服务URL的基本URL。该路径是在运行时推断的,并附加到基本URL默认该属性值与hostname, server.port有关,如http://127.0.0.1:8080,其中8080端口是配置的server.port。127.0.0.1是client所在服务器的hostname
spring.boot.admin.client.instance.service-url要注册的服务网址。如果可访问的URL不同(例如Docker),则可以覆盖默认值是基于service-base-url 和 server.context-path进行赋值
spring.boot.admin.client.instance.name要注册的名称默认值是配置的spring.application.name的值,如果没有配置该属性的话,默认值是spring-boot-application
spring.boot.admin.client.instance.prefer-ip在猜测的网址中使用ip地址而不是主机名。如果设置了server.address/ management.address,它将被使用。否则,InetAddress.getLocalHost()将使用从返回的IP地址false
spring.boot.admin.client.instance.metadata.*要与此实例相关联的元数据键值对
spring.boot.admin.client.instance.metadata.tags.*标记作为要与此实例相关联的键值对

官方文档:

https://codecentric.github.io/spring-boot-admin/2.1.6/#faqs

关于 Spring Boot Actuator 的监控内容:

SpringBoot—应用监控之Spring Boot Actuator

如本文“对您有用”,欢迎随意打赏作者,让我们坚持创作!

0 打赏
Enamiĝu al vi
一个人若有一百只羊,一只走迷了路,你们的意思如何?他岂不撇下这九十九只,往山里去找那只迷路的羊吗?
519文章 67评论 191点赞 323861浏览

默认版本~SpringBoot2.0~2.3
  • Java—定时任务—HashedWheelTimer时间轮
  • Java—有向无环图(DAG)
  • JXLS—Excel模板框架
  • Disruptor—无锁队列
  • Redis—注解接口限流
  • SpringBoot—数据库读写分离
  • Netty—初探与核心(未完)
随便看看
ActiveMQ (4) Ajax (13) Docker (7) ElasticSearch (13) Enamiĝu al vi (1) Eureka (2) Feign (6) Freemarker (5) Gateway (6) Git (5) Hystrix (7) Java (78) Java Notes (117) JavaScript (1) jQuery (2) Kotlin Notes (47) Maven (2) More (2) MyBatis (42) MySQL (5) Netty (2) NOSQL (1) OAuth2 (11) PostgreSQL (4) RabbitMQ (6) Redis (18) Ribbon (6) Servlet (3) Spring (70) SpringBoot (85) SpringCloud (14) SpringJPA (4) SpringMVC (46) Spring Notes (43) SpringSecurity (49) SQL (15) SQL Notes (9) SQL Server (2) Thymeleaf (4) Vue (9) Web (12) Web Notes (18) WebSocket (9) XML (1) Zuul (3)
随便看看
  • 2023年5月 (2)
  • 2023年4月 (1)
  • 2023年3月 (1)
  • 2023年2月 (5)
  • 2023年1月 (4)
  • 2022年12月 (1)
  • 2022年11月 (3)
  • 2022年10月 (5)
  • 2022年9月 (8)
  • 2022年8月 (1)
  • 2022年7月 (2)
  • 2022年6月 (4)
  • 2022年5月 (5)
  • 2022年4月 (3)
  • 2022年3月 (7)
  • 2022年2月 (4)
  • 2022年1月 (15)
  • 2021年12月 (16)
  • 2021年11月 (3)
  • 2021年10月 (3)
  • 2021年9月 (3)
  • 2021年8月 (2)
  • 2021年7月 (4)
  • 2021年6月 (16)
  • 2021年5月 (3)
  • 2021年4月 (2)
  • 2021年3月 (13)
  • 2021年2月 (2)
  • 2021年1月 (33)
  • 2020年12月 (13)
  • 2020年11月 (6)
  • 2020年10月 (17)
  • 2020年9月 (26)
  • 2020年8月 (46)
  • 2020年7月 (28)
  • 2020年6月 (4)
  • 2020年5月 (16)
  • 2020年4月 (88)
  • 2020年3月 (104)
随机文章
Java—Pair、MutablePair、ImmutablePair(实用数据结构推荐apache)
3年前
Spring—DelegatingFilterProxy的作用与用法 (过滤器授权代理)
3年前
Kotlin-类型进阶—枚举类(二十五)
2年前
Spring—RestTemplate几种常见的请求方式
3年前
ElasticSearch—字段类型详解(十一)
2年前
Maven—pom文件详细解析
3年前
ENMAL摘要

1、Kotlin:

https://www.liuwj.me/

 

2、webflux:

https://www.cnblogs.com/lixinjie/p/a-brother-of-spring-mvc-is-spring-webflux.html

 

3、Java中的Unsafe

 

4、https://my.oschina.net/quanke/blog/1631990

 

5、https://blog.csdn.net/u013064109/article/details/78786646?ops_request_misc=%25257B%252522request%25255Fid%252522%25253A%252522161214257916780264022540%252522%25252C%252522scm%252522%25253A%25252220140713.130102334.pc%25255Fall.%252522%25257D&request_id=161214257916780264022540&biz_id=0&utm_medium=distribute.pc_search_result.none-task-blog-2~all~first_rank_v2~rank_v29-11-78786646.first_rank_v2_pc_rank_v29&utm_term=kotlin

 

6、待学习除Spring之外的Web框架 — Cloudopt Next、Javalin、jfinal

https://jfinal.com/doc

 

7、kotlin设计模式——https://github.com/AboutKotlin/Design-Patterns-In-Kotlin

 

8、kotlin–ktorm+SpringBoot——https://gitee.com/tianchaohongyu/Spring-Boot-Ktor-Starter

 

9、新技术 — CQRS、jasync-sql、play!framework、akka、asyncdb

 

10、Kotlin Tips

https://gitee.com/lesliekoma/kotlin_tips?_from=gitee_search#tip5–%E6%87%92%E5%88%9D%E5%A7%8B%E5%8C%96by-lazy-%E5%92%8C-%E5%BB%B6%E8%BF%9F%E5%88%9D%E5%A7%8B%E5%8C%96lateinit

 

11、mall项目电商系统

https://github.com/macrozheng/mall

 

12、POI大量读写

https://www.cnblogs.com/swordfall/p/8298386.html

 

13、Gitee

权限RBAC:

https://gitee.com/log4j/pig

 

14、freecodecamp、pf4j

 

15、https://javadoop.com/

 

16、https://www.cnblogs.com/skywang12345/

 

17、Flyway

 

18、https://github.com/kotlin-orm/ktorm/pull/296

 

kt实体类自动生成表

 

https://github.com/tursom/TursomServer/tree/master/ts-database/src/main/kotlin/cn/tursom/database

 

19、蓝狐、支付沙盒、虚拟币

 

20、r2dbc spring强推,vertx这边是quarkus强推 redhat认证

 

21、Keycloak为Web应用和Restful服务提供了一站式的单点登录解决方案。

 

22、RSQL 的形式为 Restful API 带来了 SQL 声明性的便利

https://github.com/vineey/archelix-rsql

https://github.com/ymind/rsql-ktorm

 

23、Kotlin依赖注入

https://github.com/InsertKoinIO/koin

 

24、Kotlin– Alpas

https://github.com/alpas/alpas

一个基于 Kotlin 的 Web 框架,可让您简单快速地创建 Web 应用程序和 API。

 

25、外网学习网站,文章

https://medium.com/nerd-for-tech

 

26、Compose Multiplatform 进入 Alpha 版,统一桌面、Web 和 Android UI

https://blog.jetbrains.com/kotlin/2021/08/compose-multiplatform-goes- alpha/

 

27、Sureness

面向REST API的高性能认证鉴权框架,致力于管理保护API安全

https://gitee.com/dromara/sureness

与Javalin结合

https://javalin.io/2021/04/16/javalin-sureness-example.html

 

28、Kotlin官网合集库

https://kotlinlang.org/lp/server-side/

https://kotlinlang.org/lp/server-side/

https://kotlinlang.org/lp/server-side/

 

29、CLI知识体系

https://juejin.cn/post/6966119324478079007

 

30、面向 Web、移动和 Flutter 开发人员的安全开源后端服务器

https://appwrite.io/

 

31、Java锁

https://blog.csdn.net/hancoder/article/details/120421993

 

32、java—简单的鉴权认证

介绍 – Sa-Token (dev33.cn)

 

33、Effective Kotlin 中文翻译

GitHub – MaxzMeng/Effective-Kotlin-zh-CN: Effective Kotlin 中文翻译

 

34、Nutz—国产Web开源框架

http://www.nutzam.com/core/nutz_preface.html

 

35、Quarkus 夸克—国外开源框架

https://quarkus.io/

 

36、目前6个框架

  1. Spring Reactive → 背靠 Pivotal → 归属 VMware → 归属戴尔
  2. Quarkus 和 Vert.x → 背靠 Eclipse 基金会 → 主要由 Red Hat 支持
  3. Helidon → 背靠 Oracle
  4. Micronaut → 背靠 Object Computing(Grails、OpenDDS)
  5. Lagom → 背靠 Lightbend(Akka)
  6. Ktor → 背靠 JetBrains

 

37、XXL-JOB—–分布式任务调度平台

https://www.xuxueli.com/xxl-job/#%E3%80%8A%E5%88%86%E5%B8%83%E5%BC%8F%E4%BB%BB%E5%8A%A1%E8%B0%83%E5%BA%A6%E5%B9%B3%E5%8F%B0XXL-JOB%E3%80%8B

 

38、领域设计驱动模版

https://myddd.org

 

39、BFF— Backend For Frontend

 

40、面试突击小册

https://snailclimb.gitee.io/javaguide-interview/#/

https://javaguide.cn/

 

41、JeecgBoot 是一款基于代码生成器的低代码开发平台

http://doc.jeecg.com/2043868

 

42、

IdentityServer4 是用于 ASP.NET Core 的 OpenID Connect 和 OAuth 2.0 框架。

https://identityserver4docs.readthedocs.io/zh_CN/latest/index.html

 

43、cn.novelweb 工具类的个人博客

https://blog.novelweb.cn

 

44、分布式链路追踪SkyWalking

 

45、刷题模版

https://blog.csdn.net/fuxuemingzhu/article/details/101900729

 

46、TS中文文档

https://ts.xcatliu.com/

 

47、Rust 中文文档

https://kaisery.github.io/trpl-zh-cn/ch00-00-introduction.html

 

48、Bean Searcher 只读 ORM

https://searcher.ejlchina.com/guide/latest/start.html

 

49、K8S的学习手册

https://kuboard.cn/learning/k8s-basics/kubernetes-basics.html#%E5%AD%A6%E4%B9%A0%E7%9B%AE%E6%A0%87

 

50、fluent-mybatis, mybatis语法增强框架(关键自动生成代码JavaPoet)

https://gitee.com/fluent-mybatis/fluent-mybatis?_from=gitee_search

 

51、程序猿博客

https://qicoder.com/categories/

https://blog.hhui.top/hexblog/

https://fangshixiang.blog.csdn.net/category_7941357_2.html

https://www.zhihu.com/people/zhuo-zi-yang-93

 

52、itxiaoshen大佬的分享

https://www.cnblogs.com/itxiaoshen/

 

53、MySQL实战学习

https://funnylog.gitee.io/mysql45/

 

54、八股文

https://www.javalearn.cn/#/

 

55、两个宣传很牛的IO框架

https://gitee.com/smartboot/smart-socket

https://www.tiocloud.com/doc/taixin/?pageNumber=1

 

56、GIS动态扩散模型

https://43.140.250.235/vue/#/

 

57、PGGIS大佬

https://blog.csdn.net/m0_60387551/article/details/123184049

 

58、有时间看一下的东西

Trino、presto、shenyu、Pigx

 

59、外网IT博客

https://kt.academy/article/dispatcher-loom

https://medium.com/

https://vived.io/blog/page/2/

https://vived.io/blog/page/2/

https://vived.io/blog/page/2/

https://www.bmpi.dev/dev/

 

60、源码阅读笔记

https://github.com/seaswalker/jdk-sourcecode-analysis

https://github.com/doocs/source-code-hunter

 

61、图书下载

http://www.ucdrs.superlib.net/

http://www.chendianrong.com/pdf#g

 

62、组件式规则引擎—liteflow

https://liteflow.yomahub.com/

 

Copyright © 2023 网站备案号: 浙ICP备20017730号
主页
页面
  • 归档
博主
Enamiĝu al vi
Enamiĝu al vi 管理员
To be, or not to be
519 文章 67 评论 323861 浏览
测试
测试
赞赏作者

请通过微信、支付宝 APP 扫一扫

感谢您对作者的支持!

 支付宝 微信支付