问题描述
所以我设置了 grafana 和 prometheus 来监控我的服务器,但我在 grafana 中没有得到任何数据(我不知道如何检查它是否在 grafana 之外工作......
Prometheus.yml:
global:
scrape_interval: 10s
scrape_configs:
- job_name: 'prometheus'
scrape_interval: 5s
static_configs:
- targets: ['localhost:9090']
- job_name: 'node'
scrape_interval: 5s
static_configs:
- targets: ['localhost:9100','192.168.1.11:9100','192.168.1.12:9100']
我错过了什么/做错了什么?
编辑:
我确实有 node_exporter 在我想要检查的所有服务器上运行。
普罗米修斯似乎得到了它的数据?
解决方法
Prometheus 正在发送数据,因此问题似乎出在 Grafana 端。
转到在 Grafana 中探索并运行与上面屏幕截图中在 Prometheus 上运行相同的查询。
如果您没有收到响应,则数据源配置不正确。转到配置->数据源并检查 Prometheus 作为源。保存和测试将显示一条通知,说明 Grafana 是否能够连接到数据源。
如果您收到响应,则仪表板似乎是问题所在。检查图表面板中的一个或多个查询,并检查这些指标是否在 Prometheus 中可用
接下来检查仪表板中的变量以检查它们是否正确。