美文网首页
7、指标监控

7、指标监控

作者: ravenLu | 来源:发表于2024-01-22 23:32 被阅读0次

一、Spring Boot Actuator

Spring Boot Actuator,可检查健康、内存使用、线程使用。

在项目配置文件  pom.xml   添加依赖

<dependency>

<groupId>org.springframework.boot</groupId>

<artifactId>springfox-boot-starter-actuator</artifactId>

</dependency>

在application.properties 开启监控端点

management.endpoints.web.exposure.include=*

运行项目,在浏览器输入: http://localhost:8080/actuator

可以看到如下信息

/env 环境属性

/health  健康检查

/mappings  所有@RequestMapping路径

/loggers 日志信息

/info 定制信息

/metrics 查看内存、CPU核心等系统参数

/trace 用户请求信息

使用示例:在浏览器输入  http://localhost:8080/actuator/env

二、Spring Boot Admin

(1)创建Spring Boot Admin 服务端项目

添加2个模块

在application.properties 设置端口号  server.port=9090

启动类添加 @EnableAdminServer

运行后在url  输入 http://127.0.0.1:9090/

可看到如下页面

(2)在被监控的项目连接 Spring Boot Admin

在其项目pom文件添加依赖:

<dependency>

<groupId>de.codecentric</groupId>

<artifactId>spring-boot-admin-starter-client</artifactId>

<version>2.1.6</version>  #版本看情况确定

</dependency>

在application.properties 文件添加 spring.boot.admin.client.url=http://localhost:9090  连接服务端

启动,

然后在http://127.0.0.1:9090/  可看到应用情况

相关文章

  • 第10章 Kubernetes集群资源监控

    一. Kubernetes监控指标与监控方案 1.Kubernetes监控指标 (1).集群监控 • 节点资源利用...

  • 监控笔记

    监控分类 系统 业务 监控方法 探针(probing) 内省(introspection) 监控指标 指标设计方法...

  • 搭建Prometheus Grafana Go监控平台

    一、前言 监控指标 Go监控指标有好多库,监控指标大致一样。1)https://github.com/bmhatf...

  • 监控基础概念

    监控指标: 硬件指标 软件指标 业务指标 监控系统: 采样:sensor(传感器) 存储 展示 报警 采样: 周期...

  • 分布式应用系统监控浅谈

    监控指标 机器维度 机器维度的监控指标包括CPU、Load、内存、网络、IO、磁盘等相关指标,详细指标可以参考Li...

  • Zabbix 服务器性能指标参考(学习笔记十七)

    服务器性能及业务监控指标,可根据实际情况调整,下表供大家参考。 监控类别监控子对象监控维度监控指标警告严重 服务器...

  • 指标监控

    指标的特性 指标监控的报警链路 常用的指标项 可用性 流量 cpu 内存 checkpoint conne...

  • 监控指标

    监控工具 zabbix, falcon ,grafana,Redis监控大盘,ES监控大盘,MQ,falcon,C...

  • Redis性能指标监控

    监控指标 性能指标:Performance 内存指标: Memory 基本活动指标:Basic activity ...

  • prometheus监控spark on yarn方案(一)

    一、监控指标 使用sparkMetricSink监控的指标 二、考虑问题 spark自带的sink使用io.dro...

网友评论

      本文标题:7、指标监控

      本文链接:https://www.haomeiwen.com/subject/ouqyodtx.html