当前位置: 首页 > news >正文

actuator/prometheus使用pushgateway上传jvm监控数据

场景

        

准备

  1. prometheus已经部署pushgateway服务,访问{pushgateway.server:9091}可以看到面板

实现

  • 基于springboot引入支持组件,版本可以
        <!--监控检查--><dependency><groupId>org.springframework.boot</groupId><artifactId>spring-boot-starter-actuator</artifactId></dependency><dependency><groupId>io.micrometer</groupId><artifactId>micrometer-registry-prometheus</artifactId><version>1.5.14</version></dependency><dependency><groupId>io.prometheus</groupId><artifactId>simpleclient_pushgateway</artifactId><version>0.16.0</version></dependency>
  • 开启配置
management:endpoints:web:exposure:# 暴露监控接口,*为全部接口include: '*'# 不暴露接口# exclude: 'info'metrics: #是否在内存中保存监控统计数据export:simple:enabled: false # 关闭内存中计算指标prometheus:enabled: true # 开启prometheus上传pushgateway: ## 配置pushgateway信息enabled: true # 开启pushgateway上传base-url: http://10.111.11.111:9091 # 配置pushgateway服务地址job: ${spring.application.name} # 配置pushgateway服务地址grouping-key:instance: ${spring.application.name}:${spring.profiles.active}lable1: labelValue1 # 自定义tagpush-rate: 10s #上传数据间隔

 效果

         在pushgateway面板中会显示新增的服务,在prometheus中也可能看到采集的数据

http://www.lryc.cn/news/131107.html

相关文章:

  • Linux设置临时目录路径的解决方案
  • 19-普通组件的注册使用
  • Java基础篇:抽象类与接口
  • 面对对象编程范式
  • “深度学习”学习日记:Tensorflow实现VGG每一个卷积层的可视化
  • 146. LRU 缓存
  • Unity框架学习--场景切换管理器
  • Kotlin Lambda和高阶函数
  • ELKstack-Elasticsearch配置与使用
  • Kotlin 基础教程二
  • K8S deployment挂载
  • 类之间的比较
  • 设计模式之备忘录模式(Memento)的C++实现
  • 学习笔记230804---restful风格的接口,delete的传参方式问题
  • STM32使用IIC通信的引脚配置问题
  • 题解 | #K.First Last# 2023牛客暑期多校10
  • Python 程序设计入门(025)—— 使用 os 模块操作文件与目录
  • excel逻辑函数篇1
  • 前端基础(Vue的模块化开发)
  • SystemVerilog interface使用说明
  • 机器人制作开源方案 | 送餐机器人
  • Gradio部署应用到服务器不能正常访问
  • 数据暴涨时代,该如何数据治理?_光点科技
  • 2021年03月 C/C++(三级)真题解析#中国电子学会#全国青少年软件编程等级考试
  • GPT-5出世?OpenAI GPT-5商标已注册
  • 优雅的使用 Dockerfile 定制镜像
  • limit的用法mysql
  • clickhouse Checksum doesn‘t match: 问题修复
  • 企业如何开展个人信息安全影响评估(PIA)二
  • android TextView 超出长度使用省略号