20889: Install Prometheus server from archives instead of package repo.
[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 {%- set controller_nodes = "__CONTROLLER_NODES__".split(',') %}
7 {%- set enable_balancer = ("__ENABLE_BALANCER__"|to_bool) %}
8
9 ### PROMETHEUS
10 prometheus:
11   wanted:
12     component:
13       - prometheus
14       - alertmanager
15       - node_exporter
16   pkg:
17     use_upstream_repo: false
18     use_upstream_archive: true
19     component:
20       prometheus:
21         config:
22           global:
23             scrape_interval: 15s
24             evaluation_interval: 15s
25           rule_files:
26             - rules.yml
27
28           scrape_configs:
29             - job_name: prometheus
30               # metrics_path defaults to /metrics
31               # scheme defaults to http.
32               static_configs:
33               - targets: ['localhost:9090']
34                 labels:
35                   instance: mon.__CLUSTER__
36                   cluster: __CLUSTER__
37
38             ## Arvados unique jobs
39             - job_name: arvados_ws
40               bearer_token: __MANAGEMENT_TOKEN__
41               scheme: https
42               static_configs:
43                 - targets: ['ws.__DOMAIN__:443']
44                   labels:
45                     instance: ws.__CLUSTER__
46                     cluster: __CLUSTER__
47             - job_name: arvados_controller
48               bearer_token: __MANAGEMENT_TOKEN__
49               {%- if enable_balancer %}
50               scheme: http
51               {%- else %}
52               scheme: https
53               {%- endif %}
54               static_configs:
55                 {%- if enable_balancer %}
56                   {%- for controller in controller_nodes %}
57                 - targets: ['{{ controller }}']
58                   labels:
59                     instance: {{ controller.split('.')[0] }}.__CLUSTER__
60                     cluster: __CLUSTER__
61                   {%- endfor %}
62                 {%- else %}
63                 - targets: ['__DOMAIN__:443']
64                   labels:
65                     instance: controller.__CLUSTER__
66                     cluster: __CLUSTER__
67                 {%- endif %}
68             - job_name: keep_web
69               bearer_token: __MANAGEMENT_TOKEN__
70               scheme: https
71               static_configs:
72                 - targets: ['keep.__DOMAIN__:443']
73                   labels:
74                     instance: keep-web.__CLUSTER__
75                     cluster: __CLUSTER__
76             - job_name: keep_balance
77               bearer_token: __MANAGEMENT_TOKEN__
78               static_configs:
79                 - targets: ['__KEEPBALANCE_INT_IP__:9005']
80                   labels:
81                     instance: keep-balance.__CLUSTER__
82                     cluster: __CLUSTER__
83             - job_name: keepstore
84               bearer_token: __MANAGEMENT_TOKEN__
85               static_configs:
86                 - targets: ['__KEEPSTORE0_INT_IP__:25107']
87                   labels:
88                     instance: keep0.__CLUSTER__
89                     cluster: __CLUSTER__
90             - job_name: arvados_dispatch_cloud
91               bearer_token: __MANAGEMENT_TOKEN__
92               static_configs:
93                 - targets: ['__DISPATCHER_INT_IP__:9006']
94                   labels:
95                     instance: arvados-dispatch-cloud.__CLUSTER__
96                     cluster: __CLUSTER__
97
98             # Database
99             - job_name: postgresql
100               static_configs:
101                 - targets: [
102                     '__DATABASE_INT_IP__:9187',
103                     '__DATABASE_INT_IP__:3903'
104                   ]
105                   labels:
106                     instance: database.__CLUSTER__
107                     cluster: __CLUSTER__
108
109             # Nodes
110             {%- set node_list = "__NODELIST__".split(',') %}
111             {%- set nodes = [] %}
112             {%- for node in node_list %}
113               {%- set _ = nodes.append(node.split('.')[0]) %}
114             {%- endfor %}
115             - job_name: node
116               static_configs:
117                 {% for node in nodes %}
118                 - targets: [ "{{ node }}.__DOMAIN__:9100" ]
119                   labels:
120                     instance: "{{ node }}.__CLUSTER__"
121                     cluster: __CLUSTER__
122                 {% endfor %}