windows安装prometheus和grafana

prometheus官网
grafana

软件下载

prometheus

windows_exporter
https://github.com/prometheus-community/windows_exporter

grafana

prometheus原理


配置prometheus

解压之后prometheus-2.50.1.windows-amd64.zip修改prometheus.yml

localhost修改为127.0.0.1

双击prometheus.exe运行

访问http://127.0.0.1:9090/targets

配置windows资源采集器

以管理员身份运行windows_exporter-0.25.1-amd64

访问http://localhost:9182/metrics

创建服务,以管理员身份启动cmd

bash 复制代码
sc create windows_exporter binpath= D:\Software\prometheus\windows_exporter-0.25.1-amd64.exe type= own start= auto displayname= windows_exporter

找到服务启动即可

删除服务

bash 复制代码
sc delete windows_exporter

在prometheus.yml同级目录新建windows.yml

yml 复制代码
- targets: ["127.0.0.1:9182"]
  labels:
    instance: 127.0.0.1
    serverName: '本地windows服务器'

prometheus.yml中添加如下内容 (注意缩进)

yml 复制代码
  - job_name: "windows"
    file_sd_configs:
    - refresh_interval: 15s
      files: 
      - ".\\windows.yml"

重启prometheus端,打开http://127.0.0.1:9090/targets,windows状态为up即成功

配置Grafana

可以看到prometheus的默认界面比较单一,可看到的关键资源信息不多,下面使用Grafana展示具体资源状况

在全英文路径下解压grafana-enterprise-10.4.0.windows-amd64.zip,双击bin目录下grafana-server.exe,任务栏会新增一个黑窗户(不要关闭)

浏览器打开http://127.0.0.1:3000(默认账号密码都是admin)

第一次访问端口被占用,关闭占用的应用程序

然后让输入新的密码

安装成功,创建数据源,关联prometheus端

输入url其他默认即可


选择模板

下载完成json模板之后进行导入



大盘配置完成

参考
参考

相关推荐
zhangfeng113318 小时前
Windows 的 Git Bash 中使用 md5sum 命令非常简单 md5做文件完整性检测 WinRAR 可以计算文件的 MD5 值
人工智能·windows·git·bash
彭波39619 小时前
.NET Framework 3.5问题修复教程!可以离线修复
windows·安全·电脑·.net·开源软件
love530love20 小时前
OpenClaw 手机直连配置全流程
人工智能·windows·python·智能手机·c#·agent·openclaw
AnalogElectronic1 天前
windows递归遍历当前目录下文件并重命名程序
windows
web3.08889991 天前
taoxi商品详情|商品属性|包装规格信息 API接口
windows
新手88601 天前
Oracle VirtualBox虚拟机安装 和 安装 window11版本虚拟机 及 启用EFI和硬盘无法使用 问题
服务器·windows·计算机网络·安全·虚拟机
门豪杰1 天前
Windows下配置针对WSL的cc-switch
windows·claude·claude code·cc-switch·cc switch
姓王名礼1 天前
一份 Windows/macOS/Linux 完整安装 + 运行 + 对接 WebUI 的步骤
linux·windows·macos
开开心心就好1 天前
绿色版PDF多功能工具,支持编辑转换
人工智能·windows·pdf·ocr·excel·语音识别·harmonyos
武藤一雄1 天前
C#常见面试题100问 (第一弹)
windows·microsoft·面试·c#·.net·.netcore