title: Prometheus reading metrics from an offline nodes
body: <p>I configured Prometheus for monitoring different spring boot applications. These applications can have multiple instances deployed on an ensemble of five different servers. Some applications are deployed on every node, some others not. There is no way to determine if applicationOne is on nodeOne (this is in charge to Portainer), so I configured Prometheus listing as target all the possible ips on which an application can be deployed.</p>
  
  <pre><code>  - job_name: 'production-diagnostic'
      metrics_path: '/actuator/prometheus'
      scrape_interval: 5s
      static_configs:
      - targets: ['1.1.1.1:9003', '1.1.1.2:9003', '1.1.1.3:9003', '1.1.1.4:9003', '1.1.1.5:9003']
  </code></pre>
  
  <p>This specific application is configured to run only on a server at a time, it will switch on another node only if there is a human request of redeploy.
  Prometheus behaves in a bad manner: it apparently reads metric from four 
  nodes for this application, even if it is deployed only on one of them.
  The same happens to the others applications.</p>
  
  <p>Example:</p>
  
  <blockquote>
    <p>jvm_memory_used_bytes{application="localization_vehicles_diagnostic",area="heap",id="G1
    Eden
    Space",instance="1.1.1.1:9003",job="production-diagnostic"}   299892736
    jvm_memory_used_bytes{application="localization_vehicles_diagnostic",area="heap",id="G1
    Eden
    Space",instance="1.1.1.2:9003",job="production-diagnostic"}   296747008
    jvm_memory_used_bytes{application="localization_vehicles_diagnostic",area="heap",id="G1
    Eden
    Space",instance="1.1.1.3:9003",job="production-diagnostic"}   294649856
    jvm_memory_used_bytes{application="localization_vehicles_diagnostic",area="heap",id="G1
    Eden
    Space",instance="1.1.1.4:9003",job="production-diagnostic"}   295698432</p>
  </blockquote>
  
  <p>Is there something wrong in my configuration? Have I to add some other parameter? Or perhaps there is some issue with Prometheus and Portainer?</p>