I have a distributed system consisting of 100s of devices which has node exporter installed on them. My main server has a prometheus server which scrapes all these data. How do I know which data is coming from which of the devices?
you can define in your scrape_configs
from prometheus.yml
file different a label
with the same name and different values for each node exporter
scrape_configs:
- job_name: 'nodeexporter-01'
scrape_interval: 5s
static_configs:
- targets: [ 'nodeexporter:9100' ]
labels:
instance: 'nodeexporter-9100'
- job_name: 'nodeexporter-02'
scrape_interval: 5s
static_configs:
- targets: [ 'nodeexporter:9200' ]
labels:
instance: 'nodeexporter-9200'
then you will see the metric
like this:
metric{instance="nodeexporter-9100"} X
metric{instance="nodeexporter-9200"} Y