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模板之后进行导入



大盘配置完成

参考
参考

相关推荐
SeanQhl2 小时前
中文 Windows 上跑 Python 定时任务——编码、路径、控制台三个坑
windows·python·编码·效率工具·定时任务
JasonChen@6663 小时前
pushgateway组件实现自定义监控数据采集(16)
grafana·prometheus·pushgateway
Vex2une6 小时前
系统出问题不想重装?系统还原点创建与重置此电脑完整指南
windows·系统还原点·重置此电脑·系统还原怎么用·创建还原点·保留文件重置·系统保护开启
保卫大狮兄1 天前
2026中小制造企业轻量化ERP选型观察:产供销协同路线、上线周期与ROI分析
windows·microsoft·erp·生产管理
陈工大模型1 天前
MacOS 跨平台压缩包处理:从编码痛点到工程化落地的完整方案
windows·macos·缓存·电脑·策略模式·c盘清理
凌镜icecraft2 天前
我改文件扩展名的时候那个警告弹窗再也不会弹出来了
windows·c#·wpf·explorer
the3clipse2 天前
Windows 11 26H2 AI 功能使用指南:回顾、单击以执行与实时字幕
人工智能·windows·copilot+ pc·recall 回顾·单击以执行·实时字幕翻译·windows studio
the3clipse2 天前
Windows 11 26H2 账户登录与 Windows Hello 指南:并行验证、增强登录安全与无密码设置
windows·无密码登录·windows hello·增强登录安全性ess·pin与密码区别·动态锁·win11 26h2
承渊政道2 天前
Toonflow AI短剧教程:Windows部署、批量生成与角色一致性
人工智能·windows·cpolar·ai短剧·toonflow
W_son2 天前
14.Grafana 监控看板实战:新建、调优、变量配置全流程
grafana·prometheus