ansible-debops-infrastructure

DebOps and Ansible scripts to manage my infrastructure
git clone git://git.erethon.com/ansible-debops-infrastructure
Log | Files | Refs

prometheus.yml.j2 (2079B)


      1 global:
      2   scrape_interval:     15s
      3   evaluation_interval: 15s
      4 
      5 scrape_configs:
      6   - job_name: 'prometheus'
      7     static_configs:
      8       - targets: ['localhost:9090']
      9 
     10   - job_name: node
     11     static_configs:
     12       - targets:
     13       {% for target in prometheus__node_targets %}
     14         - '{{ target }}:9100'
     15       {% endfor %}
     16 
     17 {% if prometheus__http_targets is defined %}
     18   - job_name: 'blackbox'
     19     metrics_path: /probe
     20     params:
     21       module: [http_2xx]
     22     static_configs:
     23       - targets:
     24 {% for target in prometheus__http_targets %}
     25         - {{ target }}
     26 {% endfor %}
     27     relabel_configs:
     28       - source_labels: [__address__]
     29         target_label: __param_target
     30       - source_labels: [__param_target]
     31         target_label: instance
     32       - target_label: __address__
     33         replacement: 127.0.0.1:9115
     34 {% endif %}
     35 
     36 {% if prometheus__dot_targets is defined %}
     37   - job_name: 'dot_blackbox'
     38     metrics_path: /probe
     39     params:
     40       module: [dns]
     41     static_configs:
     42       - targets:
     43 {% for target in prometheus__dot_targets %}
     44         - {{ target }}
     45 {% endfor %}
     46     relabel_configs:
     47       - source_labels: [__address__]
     48         target_label: __param_target
     49       - source_labels: [__param_target]
     50         target_label: instance
     51       - target_label: __address__
     52         replacement: 127.0.0.1:9115
     53 {% endif %}
     54 
     55 {% if prometheus__postgres_targets is defined %}
     56   - job_name: 'postgres'
     57     static_configs:
     58       - targets:
     59 {% for target in prometheus__postgres_targets %}
     60         - '{{ target }}:9187'
     61 {% endfor %}
     62 {% endif %}
     63 
     64 {% if prometheus__synapse_target is defined %}
     65   - job_name: 'synapse'
     66     metrics_path: '/_synapse/metrics'
     67     static_configs:
     68       - targets: ['{{ prometheus__synapse_target }}:9666']
     69 {% endif %}
     70 
     71 {% if prometheus__apcupsd_target is defined %}
     72   - job_name: 'apcupsd'
     73     static_configs:
     74       - targets: ['{{ prometheus__apcupsd_target }}:9162']
     75 {% endif %}
     76 
     77 {% if prometheus__dht_target is defined %}
     78   - job_name: 'dht_environment'
     79     metrics_path: '/'
     80     static_configs:
     81       - targets: ['{{ prometheus__dht_target }}:9222']
     82 {% endif %}