安装配置Grafana参考

https://testerhome.com/articles/23629

使用配置

  1. 下载jmx_exporter
https://github.com/prometheus/jmx_exporter
  1. 创建jmx_exporter配置文件
vim simple-config.yml

lowercaseOutputLabelNames: true
lowercaseOutputName: true
whitelistObjectNames: ["java.lang:type=OperatingSystem"]
blacklistObjectNames: []
rules:
- pattern: 'java.lang<type=OperatingSystem><>(committed_virtual_memory|free_physical_memory|free_swap_space|total_physical_memory|total_swap_space)_size:'
name: os_$1_bytes
type: GAUGE
attrNameSnakeCase: true
- pattern: 'java.lang<type=OperatingSystem><>((?!process_cpu_time)\w+):'
name: os_$1
type: GAUGE
attrNameSnakeCase: true

javaagent启动应用

java -javaagent:./jmx_prometheus_javaagent-0.14.0.jar=8080:simple-config.yaml -jar yourJar.jar

  1. 在prometheus配置文件中添加配置
scrape_configs:
- job_name: 'java'
static_configs:
- targets: ['<host>:<port>']
  1. 重启prometheus
nohup ./prometheus  > prometheus.log 2>&1 &
  1. 下载并导入dashboards
https://grafana.com/grafana/dashboards/7727
https://grafana.com/grafana/dashboards/8563
注:8563模板对7727有依赖,所以需全部安装,否则不能正常使用

效果图





扫一扫,关注我

最新文章

  1. opengl 笔记(1)
  2. oracle修改表字段
  3. SQL查询表中的有那些索引
  4. 在Ubuntu上安装JDK、Ant、Jmeter和Jenkins
  5. PHP将在对象被销毁前调用这个函数.它称为析构函数
  6. docker kubernetes--
  7. Context上下文对象(抄书的)
  8. String Subtraction
  9. IE下判断IE版本的语句
  10. 【转】Linux中history历史命令使用方法详解
  11. Java的基本语法
  12. Redis总结(六)Redis配置文件全解
  13. PHP 环境搭建篇
  14. Windows10下的docker安装与入门 (二)使用docker引擎在容器中运行镜像
  15. maven创建一个简单的web项目
  16. Packet for query is too large (1660 &gt; 1024). You can change this value on the server by setting the max_allowed_packet&#39; variable.
  17. spring注解开发
  18. bash 定时任务
  19. Educational Codeforces Round 21 Problem A - C
  20. blast 数据库说明

热门文章

  1. AMD Ryzen 5000系列桌面处理器 2020年10月8日发布
  2. Elasticsearch(3):别名
  3. 高性能HTTP加速器Varnish--基础知识
  4. 我要告诉你:java接口中可以定义private私有方法
  5. 炉石传说酒馆战棋一键拔线(windows)
  6. ERROR 1045 (28000): Access denied for user 'root'@'localhost' (using password: YES)解决方案
  7. 多测师讲解自动化--rf断言(下)--_高级讲师肖sir
  8. IDEA项目区模块文件变为红色解决办法
  9. swoft生成控制器
  10. ASP.NET 获取客户端IP地址