20610: Adds node list & role->nodes map variables.
[arvados.git] / tools / salt-install / config_examples / multi_host / aws / pillars / prometheus_server.sls
1 ---
2 # Copyright (C) The Arvados Authors. All rights reserved.
3 #
4 # SPDX-License-Identifier: AGPL-3.0
5
6 ### PROMETHEUS
7 prometheus:
8   wanted:
9     component:
10       - prometheus
11       - alertmanager
12       - node_exporter
13   pkg:
14     use_upstream_repo: true
15     component:
16       prometheus:
17         config:
18           global:
19             scrape_interval: 15s
20             evaluation_interval: 15s
21           rule_files:
22             - rules.yml
23
24           scrape_configs:
25             - job_name: prometheus
26               # metrics_path defaults to /metrics
27               # scheme defaults to http.
28               static_configs:
29               - targets: ['localhost:9090']
30                 labels:
31                   instance: mon.__CLUSTER__
32                   cluster: __CLUSTER__
33
34             ## Arvados unique jobs
35             - job_name: arvados_ws
36               bearer_token: __MANAGEMENT_TOKEN__
37               scheme: https
38               static_configs:
39                 - targets: ['ws.__DOMAIN__:443']
40                   labels:
41                     instance: ws.__CLUSTER__
42                     cluster: __CLUSTER__
43             - job_name: arvados_controller
44               bearer_token: __MANAGEMENT_TOKEN__
45               scheme: https
46               static_configs:
47                 - targets: ['__DOMAIN__:443']
48                   labels:
49                     instance: controller.__CLUSTER__
50                     cluster: __CLUSTER__
51             - job_name: keep_web
52               bearer_token: __MANAGEMENT_TOKEN__
53               scheme: https
54               static_configs:
55                 - targets: ['keep.__DOMAIN__:443']
56                   labels:
57                     instance: keep-web.__CLUSTER__
58                     cluster: __CLUSTER__
59             - job_name: keep_balance
60               bearer_token: __MANAGEMENT_TOKEN__
61               static_configs:
62                 - targets: ['__KEEPBALANCE_INT_IP__:9005']
63                   labels:
64                     instance: keep-balance.__CLUSTER__
65                     cluster: __CLUSTER__
66             - job_name: keepstore
67               bearer_token: __MANAGEMENT_TOKEN__
68               static_configs:
69                 - targets: ['__KEEPSTORE0_INT_IP__:25107']
70                   labels:
71                     instance: keep0.__CLUSTER__
72                     cluster: __CLUSTER__
73             - job_name: arvados_dispatch_cloud
74               bearer_token: __MANAGEMENT_TOKEN__
75               static_configs:
76                 - targets: ['__CONTROLLER_INT_IP__:9006']
77                   labels:
78                     instance: arvados-dispatch-cloud.__CLUSTER__
79                     cluster: __CLUSTER__
80
81             # Database
82             - job_name: postgresql
83               static_configs:
84                 - targets: [
85                     '__DATABASE_INT_IP__:9187',
86                     '__DATABASE_INT_IP__:3903'
87                   ]
88                   labels:
89                     instance: database.__CLUSTER__
90                     cluster: __CLUSTER__
91
92             # Nodes
93             {%- set node_list = "__NODELIST__".split(',') %}
94             {%- set nodes = [] %}
95             {%- for node in node_list %}
96               {%- set _ = nodes.append(node.split('.')[0]) %}
97             {%- endfor %}
98             - job_name: node
99               static_configs:
100                 {% for node in nodes %}
101                 - targets: [ "{{ node }}.__DOMAIN__:9100" ]
102                   labels:
103                     instance: "{{ node }}.__CLUSTER__"
104                     cluster: __CLUSTER__
105                 {% endfor %}