# By default the BOSH director is not scraped by Prometheus

- type: replace
  path: /instance_groups/name=prometheus2/jobs/name=prometheus2/properties/prometheus/scrape_configs/job_name=node/static_configs?/-
  value:
    targets:
      # The port will be added in the upstream relabel configuration
      #
      # This is the BOSH director
      - "10.0.0.6"
      # This is the Prometheus monitoring its own node exporter
      - "127.0.0.1"
    labels:
      __meta_bosh_job_process_name: node_exporter

- type: replace
  path: /instance_groups/name=prometheus2/jobs/name=prometheus2/properties/prometheus/scrape_configs/job_name=node/relabel_configs?/-
  value:
    source_labels:
    - __address__
    regex: "^(10|127)[.].*"
    action: keep

# By default the BOSH director is not scraped by Prometheus

- type: replace
  path: /instance_groups/name=prometheus2/jobs/name=prometheus2/properties/prometheus/scrape_configs/job_name=node/static_configs?/-
  value:
    targets:
      # The port will be added in the upstream relabel configuration
      #
      # This is the BOSH director
      - "10.0.0.6"
      # This is the Prometheus monitoring its own node exporter
      - "127.0.0.1"
    labels:
      __meta_bosh_job_process_name: node_exporter

- type: replace
  path: /instance_groups/name=prometheus2/jobs/name=prometheus2/properties/prometheus/scrape_configs/job_name=node/relabel_configs?/-
  value:
    source_labels:
    - __address__
    regex: "^(10|127)[.].*"
    action: keep

- type: replace
  path: /instance_groups/name=prometheus2/jobs/name=prometheus2/properties/prometheus/scrape_configs/job_name=node/relabel_configs?/-
  value:
    source_labels:
    - __meta_bosh_deployment
    target_label: bosh_deployment
    regex: (.*)
    replacement: ${1}
    action: replace

Add bosh_deployment to node exporter labels
Add bosh_deployment to node exporter labels

Signed-off-by: Toby Lorne <527052641d65eef236eeef9545b2acac74c35d57@digital.cabinet-office.gov.uk>
