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



大盘配置完成

参考
参考

相关推荐
虚无境1 天前
如何编写一个SpringBoot项目告警推送的Starter
java·prometheus·webhook
qq_369224332 天前
Windows全系通用!ntdll.dll文件丢失、报错、闪退问题的完整排查与修复教程
windows·dll·dll修复·dll丢失·dll错误
阿米亚波2 天前
【Windows】QEMU 启动 openEuler aarch64/arm64 架构系统 + 离线软件源
linux·windows·经验分享·笔记·架构·arm
caimouse2 天前
Reactos 第 10 章 网络操作 — 10.3.1 NIC驱动
网络·windows
初圣魔门首席弟子2 天前
Node.js 详细介绍(知识库版)
windows·qt·node.js·知识库
CHENG-JustDoIt2 天前
AI工具 | 爆火开源项目Odysseus AI 工作台:从项目介绍、部署情况及其使用等多方位分析指南(含详细步骤)
大数据·人工智能·windows·python·ai·开源·github
kingbal2 天前
Windows:flutter环境搭建
windows·flutter
睡不醒男孩0308232 天前
云原生运维实战:高并发架构下的云原生可观测性、韧性降级与自动化干预体系
数据库·kubernetes·高并发·prometheus·devops·sre·缓存调优
未若君雅裁2 天前
Python 数据容器详解,list、tuple、str、set、dict 到底怎么选
windows·python·list
CodeKwang2 天前
Windows 环境 OCCT 8.0 编译构建及与 Qt6 项目集成
windows·qt·opencascade