summaryrefslogtreecommitdiff
path: root/roles/monitoring/prometheus/server/templates/prometheus.yml.j2
blob: eb77d6d108a8a95a96cf70f97e18034d80f08d04 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
# {{ ansible_managed }}

global:
  scrape_interval:     15s
  evaluation_interval: 15s

rule_files:
  - /etc/prometheus/rules/*.yml

scrape_configs:
  - job_name: 'prometheus'
    static_configs:
    - targets: ['localhost:9090']
      labels:
        instance: "{{ inventory_hostname }}"
{% for job in prometheus_server_jobs %}

  - job_name: '{{ job }}'
    metrics_path: /proxy
    params:
      module:
      - {{ job }}
    scheme: https
    tls_config:
      ca_file: /etc/ssl/prometheus/ca-crt.pem
      cert_file: /etc/ssl/prometheus/server/exporter-crt.pem
      key_file: /etc/ssl/prometheus/server/exporter-key.pem
    file_sd_configs:
    - files:
      - "/etc/prometheus/jobs/{{ job }}/*.yml"
{% endfor %}

  ## TODO: temporary test
  - job_name: 'ping'
    metrics_path: /proxy
    params:
      module:
      - blackbox
      - icmp
    scheme: https
    tls_config:
      ca_file: /etc/ssl/prometheus/ca-crt.pem
      cert_file: /etc/ssl/prometheus/server/exporter-crt.pem
      key_file: /etc/ssl/prometheus/server/exporter-key.pem
    static_configs:
      - targets:
        - 62.99.185.129
        - 9.9.9.9
    relabel_configs:
      - source_labels: [__address__]
        target_label: __param_target
      - source_labels: [__param_target]
        target_label: instance
      - target_label: __address__
        replacement: 192.168.32.230:9999

  - job_name: 'tcp_tls'
    metrics_path: /proxy
    params:
      module:
      - blackbox
      - tcp_tls
    scheme: https
    tls_config:
      ca_file: /etc/ssl/prometheus/ca-crt.pem
      cert_file: /etc/ssl/prometheus/server/exporter-crt.pem
      key_file: /etc/ssl/prometheus/server/exporter-key.pem
    static_configs:
      - targets:
        - web.chaos-at-home.org:443
    relabel_configs:
      - source_labels: [__address__]
        target_label: __param_target
      - source_labels: [__param_target]
        target_label: instance
      - target_label: __address__
        replacement: 192.168.32.230:9999