title: How to identify ip address for instance in Prometheus result?
body: <p>I've a docker swarm configured with nodeA as manager and nodeB as worker and have Promethues installed as docker container on nodeA with <code>prometheus.yml</code> file as -</p>
  <pre><code>global:
    scrape_interval: 10s
  scrape_configs:
    - job_name: 'prometheus'
      static_configs:
        - targets:
          - 'localhost:9090'
  
    - job_name: 'node resources'
      dns_sd_configs:
        - names: ['tasks.node']
          type: 'A'
          port: 9100
      params:
        collect[]:
          - cpu
          - meminfo
          - diskstats
          - netdev
          - netstat
  
    - job_name: 'node storage'
      scrape_interval: 1m
      dns_sd_configs:
        - names: ['tasks.node']
          type: 'A'
          port: 9100
      params:
        collect[]:
          - filefd
          - filesystem
          - xfs
  
    - job_name: 'cadvisor'
      dns_sd_configs:
        - names: ['tasks.cadvisor']
          type: 'A'
          port: 8080
  </code></pre>
  <p>In Prometheus, if I execute query - <code>container_cpu_usage_seconds_total</code> it gives results like -</p>
  <pre><code>✔container_cpu_usage_seconds_total{cpu=&quot;cpu15&quot;,id=&quot;/user.slice&quot;,instance=&quot;10.0.1.220:8080&quot;,job=&quot;cadvisor&quot;}
  ✔container_cpu_usage_seconds_total{cpu=&quot;cpu15&quot;,id=&quot;/user.slice&quot;,instance=&quot;10.0.1.219:8080&quot;,job=&quot;cadvisor&quot;}
  </code></pre>
  <p>I can see <code>instance</code> having values <code>10.0.1.219:8080</code> and <code>10.0.1.220:8080</code> but these are not ip addresses of machines in swarm.</p>
  <p>How can I differentiate which instance is for which machine? Is there something which I should configure?</p>