title: How to change my instance names on Prometheus
body: <p>I'm monitoring multiple computers in the same cluster, for that I'm using prometheus.
  Here is my config file <strong>prometheus.yml</strong>:</p>
  
  <pre><code># my global config
  global:
    scrape_interval: 15s # Set the scrape interval to every 15 seconds. Default is every 1 minute.
    evaluation_interval: 15s # Evaluate rules every 15 seconds. The default is every 1 minute.
    # scrape_timeout is set to the global default (10s).
  
  # Alertmanager configuration
  alerting:
    alertmanagers:
      - static_configs:
          - targets:
            # - alertmanager:9093
  
  # Load rules once and periodically evaluate them according to the global 'evaluation_interval'.
  rule_files:
    # - "first_rules.yml"
    # - "second_rules.yml"
  
  # A scrape configuration containing exactly one endpoint to scrape:
  # Here it's Prometheus itself.
  scrape_configs:
    # The job name is added as a label `job=&lt;job_name&gt;` to any timeseries scraped from this config.
    - job_name: "Server-monitoring-Api"
  
      # metrics_path defaults to '/metrics'
      # scheme defaults to 'http'.
  
      static_configs:
        - targets: ["localhost:9090"]
        - targets: ["localhost:9182"]
        - targets: ["192.168.1.71:9182"]
        - targets: ["192.168.1.84:9182"]
  </code></pre>
  
  <p>I'm new to prometheus, I want to show the name of my target, i.e: rather than using for example <strong>192.168.1.71:9182</strong> I only want the target name to be shown, I have a research, I found this:</p>
  
  <pre><code>relabel_configs:
    - source_labels: [__meta_ec2_tag_Name]
      target_label: instance
  </code></pre>
  
  <p>But I dont know how to use to relabel my targets(instances), any help will be appreciated, thanks for your help.</p>