---
global:
  # Scrape all targets for metrics every 10 seconds
  scrape_interval: 10s

scrape_configs:
  - job_name: vipu-agent-exporters
    file_sd_configs:
      - files:
          # File containing the list of vipu-exporters to scrape
          - /prometheus-config/vipu-agent-exporter-targets.json
    relabel_configs:
      # Reading hosts that look like this: host:port/metrics-path
      # and changes the __metrics_path__ to /metric-path
      # and the __address__ to host:port.
      # Introducing a new host label as well.
      - source_labels: [__address__]
        regex: '.+(/.*)$'               # capture '/...' part
        target_label: __metrics_path__  # change metrics path
      - source_labels: [__address__]
        regex: '(^.+)/.*'               # capture host:port
        target_label: __address__       # change target
      - source_labels: [__address__]
        regex: '(.+):.*'                # capture host
        target_label: host              # add a new host label
  - job_name: vipu-exporter
    static_configs:
      - targets:
          # scrape the vipu-server
          - 'vipu-server:2113'
          # scrape prometheus server itself
          - 'localhost:2113'