spring cloud admin 服务监控

论坛 期权论坛 脚本     
匿名技术用户   2021-1-7 14:34   57   0

spring cloud admin 服务监控

admin server注册到consul中,会自动发现注册到consul中的应用

***************************

admin server

********************

导入 jar 包

        <dependency>
            <groupId>de.codecentric</groupId>
            <artifactId>spring-boot-admin-starter-server</artifactId>
        </dependency>

********************

配置文件

spring:
  application:
    name: admin-server
  cloud:
    consul:
      host: 172.18.0.20
      port: 8500

********************

主类添加注解:@EnableAdminServer

@SpringBootApplication
@EnableAdminServer
public class DemoApplication {

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

}

***************************

被监控的应用

********************

引入依赖

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

********************

配置文件

application.yml

spring:
  application:
    name: admin-client
  cloud:
    consul:
      host: 172.18.0.20
      port: 8500

management:
  endpoints:
    web:
      exposure:
        include: "*"
  endpoint:
    health:
      show-details: always

************************

监控界面

********************

应用墙:查看注册的应用

********************

点击admin-client,进入admin-admin监控界面

insights:查看元数据、健康信息、磁盘空间、内存等信息

日志配置

jvm 内存

映射:查看方法相关信息

缓存:查看缓存相关信息

分享到 :
0 人收藏
您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

积分:7942463
帖子:1588486
精华:0
期权论坛 期权论坛
发布
内容

下载期权论坛手机APP