欢迎访问悦橙教程(wld5.com),关注java教程。悦橙教程  java问答|  每日更新
页面导航 : > > 文章正文

手把手教你搭建Windows 搭建Prometheus + Grafana + Jmeter可视化监控平台,

来源: javaer 分享于  点击 34717 次 点评:49

手把手教你搭建Windows 搭建Prometheus + Grafana + Jmeter可视化监控平台,


下载安装包

  • Prometheus
  • windows_exporter
  • Grafana

下载地址:https://share.weiyun.com/D9sdiWoC

工作原理

  • Exporter 监控工具,获取数据
  • Prometheus 普罗米修斯时序数据库,用来存储和查询监控数据
  • Grafana 仪表盘

如何配置

1、配置 windows_exporter

  • 启动 windows_exporter
  • 浏览器访问http://localhost:9182/ (默认端口9182)
  • 点击Metrics
  • 看到如下界面Windows_exporter安装成功

2、配置 Prometheus

  • 在 prometheus.yml 中加入如下配置
  • 启动 prometheus.exe
  • 访问:http://127.0.0.1:9090/

3、配置 Grafana

在bin目录下启动grafana-server.exe

如安装的是安装版,会自行启动,无需手动启动

访问 http://localhost:3000

初始的登陆账户和密码是:admin/admin,登陆进去后可自行修改密码

配置 Grafana 数据源,选择prometheus

数据源配置

  • HTTP配置:http://127.0.0.1:9090

  • Save&Test

导入模版

输入win - node-export模板:windows系统导入的是10467模板,Linux8919模板,也可以直接导入json文件

点击Load看到监控页面

4、配置Influxdb + Grafana + Jmeter

配置InfluxDB

修改配置(influxdb.conf)

[http]  
# Determines whether HTTP endpoint is enabled.  
enabled = true

# The bind address used by the HTTP service.

bind-address = ":8086"

windows中开启influxd.exe服务

启动influx.exe【cli客户端】

> create database jmeter #创建名字是jmeter数据库,

> show databases

> use jmeter

> select * from jmeter limit 10

配置Jmeter

数据来源:与jmeter集成使用

  • jmeter做性能测试,产生数据,写入influxdb数据库中
  • 打开jmeter,添加“后端监听器”
  • 后端监听器的实现:选择带有“influxdb”的
  • influxdbUrl:influxdb的数据的Ip地址,默认数据库名称为:jmeter
  • influxdbUrl 对应的值(http://127.0.0.1:8086/write?db=jmeter)

Grafana添加模板

  • 启动服务 grafana-server.exe
  • 启动后访问:http://127.0.0.1:3000,默认账号/密码:admin/admin
  • 配置 Grafana 数据源
  • 选择InfluxDB
  • HTTP配置:http://127.0.0.1:8086
  • InfluxDB Details配置:Database:jmeter
  • 导入 jmeter Dashboard
  • Dashboard ID: 5496

最终效果

优秀不够,你是否无可替代

软件测试交流QQ群:721256703,期待你的加入!!

欢迎关注我的微信公众号:软件测试君


相关栏目:

用户点评