Prometheus 可视化 grafana


原文链接: Prometheus 可视化 grafana

docker run --restart=always -d -p 3000:3000 -v /var/lib/grafana:/var/lib/grafana grafana/grafana
默认账户:admin admin

#添加 prometheus 数据源

然后在 Data Sources 选项中添加数据源
Name 写入 Prometheus
注意:首字母大写

当定义多实例的时候需要给每个target单独定义instance,否则无法正常工作

  - job_name: node
    static_configs:
      - targets: ['10.114.0.2:9100','10.114.0.3:9100','10.114.0.5:9100','10.114.0.6:9100','10.114.0.7:9100','10.114.0.10:9100','10.114.0.11:9100','10.114.0.12:9100','10.114.0.13:9100','10.114.0.14:9100','10.114.0.15:9100','10.114.0.16:9100','10.114.0.17:9100','10.114.0.18:9100','10.114.0.19:9100']
# 多实例需要注释掉下面的定义
#        labels:
#          instance: zybb
`