最初我使用Prometheus版本 1.1.1 来监控我的docker节点,以便我可以获得我的Kubernetes集群的资源监控 .

在1.1.1版本中,我的prometheus.yml文件如下所示:

- job_name: 'docker_containers'
  metrics_path: '/metrics'
  tls_config:
    insecure_skip_verify: true
  static_configs:
     - targets:
       - 172.29.225.97:4194
       - 172.29.225.98:4194
       - 172.29.225.99:4194
       - 172.29.225.100:4194
       - 172.29.225.101:4194
       - 172.29.225.102:4194
       - 172.29.225.103:4194

使用此版本的Prometheus,我可以获得我的指标:

enter image description here

有了这个,Grafana向我展示了我想要的东西:

enter image description here

现在我想用Prometheus版本 2.0.0 做同样的事情

版本 2.0.0 中的 prometheus.yml 文件看起来完全相同:

- job_name: 'docker_containers'
  metrics_path: '/metrics'
  tls_config:
    insecure_skip_verify: true
  static_configs:
     - targets:
       - 172.29.225.97:4194
       - 172.29.225.98:4194
       - 172.29.225.99:4194
       - 172.29.225.100:4194
       - 172.29.225.101:4194
       - 172.29.225.102:4194
       - 172.29.225.103:4194

这导致:

enter image description here

但是当我在Grafana中使用它作为数据源时,我看不到任何统计信息:

enter image description here

知道普罗米修斯版本之间有什么区别吗?