global:
  scrape_interval:     15s # By default, scrape targets every 15 seconds.

  # Attach these labels to any time series or alerts when communicating with
  # external systems (federation, remote storage, Alertmanager).
  external_labels:
    monitor: 'ffdo'

# A scrape configuration containing exactly one endpoint to scrape:
# Here it's Prometheus itself.
scrape_configs:
  - job_name: 'supernodes'
    scheme: https
    bearer_token: '{{ hostvars[groups['supernodes'][0]]['node_exporter_authorization_token'] }}'
    scrape_interval: 5s
    static_configs:
      - targets: 
{% for host in groups['supernodes'] %}
        - '{{ host }}'
{% endfor %}

  - job_name: 'mapservers'
    scheme: https
    bearer_token: '{{ hostvars[groups['mapservers'][0]]['node_exporter_authorization_token'] }}'
    scrape_interval: 5s
    static_configs:
      - targets: 
{% for host in groups['mapservers'] %}
        - '{{ host }}'
{% endfor %}

  - job_name: 'imageservers'
    scheme: https
    bearer_token: '{{ hostvars[groups['imageservers'][0]]['node_exporter_authorization_token'] }}'
    scrape_interval: 5s
    static_configs:
      - targets: 
{% for host in groups['imageservers'] %}
        - '{{ host }}'
{% endfor %}

  - job_name: 'buildservers'
    scheme: https
    bearer_token: '{{ hostvars[groups['buildservers'][0]]['node_exporter_authorization_token'] }}'
    scrape_interval: 5s
    static_configs:
      - targets: 
{% for host in groups['buildservers'] %}
        - '{{ host }}'
{% endfor %}

  - job_name: 'serviceservers'
    scheme: https
    bearer_token: '{{ hostvars[groups['serviceservers'][0]]['node_exporter_authorization_token'] }}'
    scrape_interval: 5s
    static_configs:
      - targets: 
{% for host in groups['serviceservers'] %}
        - '{{ host }}'
{% endfor %}
