---
- type: replace
  path: /instance_groups/name=prometheus2/jobs/name=prometheus2/properties/prometheus/scrape_configs/-
  value:
    job_name: aiven-service-discovery

    file_sd_configs:
      - files:
          - "/var/vcap/store/bosh_exporter/bosh_target_groups.json"

    relabel_configs:
      - source_labels:
          - __meta_bosh_job_process_name
        regex: aiven-service-discovery
        action: keep

      - source_labels:
          - __meta_bosh_deployment
        regex: ((metrics_environment))
        action: keep

      - source_labels:
          - __meta_bosh_deployment
        regex: "(.*)"
        target_label: bosh_deployment

      - source_labels:
          - __address__
        regex: "(.*)"
        target_label: __address__
        replacement: "${1}:9274"

- type: replace
  path: /instance_groups/name=prometheus2/jobs/name=prometheus2/properties/prometheus/scrape_configs/-
  value:
    job_name: cf-prometheus

    file_sd_configs:
      - files:
          - "/var/vcap/store/bosh_exporter/bosh_target_groups.json"

    relabel_configs:
      - source_labels:
          - __meta_bosh_job_process_name
        regex: prometheus2
        action: keep

      - source_labels:
          - __meta_bosh_deployment
        regex: ((metrics_environment))
        action: keep

      - source_labels:
          - __meta_bosh_deployment
        regex: "(.*)"
        target_label: bosh_deployment

      - source_labels:
          - __address__
        regex: "(.*)"
        target_label: __address__
        replacement: "${1}:9090"

Monitor prometheus in CF BOSH deployment
Monitor prometheus in CF BOSH deployment

We provide prometheus as a service for scraping elasticsearch

We should get metrics about prometheus and the aiven service discovery
service

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