prometheus.yml.j2 2.62 KB
Newer Older
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
global:
  scrape_interval: 60s

# Load rules once and periodically evaluate them according to the global 'evaluation_interval'.
rule_files:
  - node.rules.yml

# Alertmanager configuration
alerting:
  alertmanagers:
  - static_configs:
    - targets:
       - localhost:9093

scrape_configs:
16
17
18
19
20
21
  - job_name: loki
    static_configs:
    - targets: ['127.0.0.1:3100']
      labels:
        instance: "{{ ansible_fqdn }}"

22
23
24
25
26
27
28
29
30
31
  - job_name: 'node_exporter'
    static_configs:
    {% for host in groups['node_exporters'] %}

    - targets: ['{{ host }}:{{ prometheus_exporter_port }}']
      labels:
        instance: "{{ host }}"

    {% endfor %}

32
33
34
35
36
37
38
39
40
41
  - job_name: 'promtail'
    static_configs:
    {% for host in groups['node_exporters'] %}

    - targets: ['{{ host }}:9080']
      labels:
        instance: "{{ host }}"

    {% endfor %}

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
  - job_name: 'gitlab_runner_exporter'
    static_configs:
    {% for host in groups['gitlab_runners'] %}

    - targets: ['{{ host }}:{{ gitlab_runner_exporter_port }}']
      labels:
        instance: "{{ host }}"

    {% endfor %}

  - job_name: 'keycloak'
    scheme: https
    metrics_path: "/auth/realms/master/metrics"
    basic_auth:
       username: "{{ vault_keycloak_nginx_user }}"
       password: "{{ vault_keycloak_nginx_passwd }}"
    static_configs:
    - targets: ['accounts.archlinux.org:443']
      labels:
        instance: "accounts.archlinux.org"

  - job_name: 'gitlab_exporter'
    scheme: https
    metrics_path: "-/metrics"
    params:
      token: ["{{ vault_gitlab_prometheus_token }}"]
    static_configs:
    - targets: ['gitlab.archlinux.org:443']
      labels:
        instance: "gitlab.archlinux.org"

  - job_name: 'mysqld_exporter'
    static_configs:
75
    {% for host in groups['mysql_servers'] %}
76

77
    - targets: ['{{ host }}:{{ prometheus_mysqld_exporter_port }}']
78
      labels:
79
80
81
82
        instance: "{{ host }}"

    {% endfor %}

83

84
85
86
87
88
89
90
91
92
93
  - job_name: 'memcached_exporter'
    static_configs:
    {% for host in groups['memcached'] %}

    - targets: ['{{ host }}:{{ prometheus_memcached_exporter_port }}']
      labels:
        instance: "{{ host }}"

    {% endfor %}

94
95
{% for module in blackbox_targets.keys() %}
  - job_name: 'blackbox_{{ module }}'
96
97
98
    metrics_path: /probe
    scrape_interval: 15s
    params:
99
      module: [{{ module }}]
100
101
    static_configs:
    - targets:
102
    {% for target in blackbox_targets[module] %}
103
104
105
106
107
108
109
110
111
112
      - {{ target }}
    {% endfor %}

    relabel_configs:
      - source_labels: [__address__]
        target_label: __param_target
      - source_labels: [__param_target]
        target_label: instance
      - target_label: __address__
        replacement: 127.0.0.1:9115
113
{% endfor %}