-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathmonitor-probe.yml
262 lines (250 loc) · 7.95 KB
/
monitor-probe.yml
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
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
# This file assumes bosh_exporter based Service Discovery is being used: ./monitor-bosh.yml
# Exporter jobs
- type: replace
path: /instance_groups/name=prometheus2/jobs/-
value:
name: blackbox_exporter
release: prometheus
properties:
blackbox_exporter:
config:
modules:
http_301:
prober: http
timeout: 5s
http:
valid_status_codes: [301]
no_follow_redirects: true
fail_if_ssl: true
fail_if_not_ssl: false
preferred_ip_protocol: "ip4"
https_200:
prober: http
timeout: 5s
http:
valid_status_codes: [200]
no_follow_redirects: true
fail_if_ssl: false
fail_if_not_ssl: true
preferred_ip_protocol: "ip4"
https_301:
prober: http
timeout: 5s
http:
valid_status_codes: [301]
no_follow_redirects: true
fail_if_ssl: false
fail_if_not_ssl: true
preferred_ip_protocol: "ip4"
https_302:
prober: http
timeout: 5s
http:
valid_status_codes: [302]
no_follow_redirects: true
fail_if_ssl: false
fail_if_not_ssl: true
preferred_ip_protocol: "ip4"
https_200_slow:
prober: http
timeout: 20s # setting to match the global prometheus scrape-timeout
http:
valid_status_codes: [200]
no_follow_redirects: true
fail_if_ssl: false
fail_if_not_ssl: true
preferred_ip_protocol: "ip4"
https_4xx:
prober: http
timeout: 5s
http:
valid_status_codes: [400, 401, 403, 404]
no_follow_redirects: true
fail_if_ssl: false
fail_if_not_ssl: true
preferred_ip_protocol: "ip4"
tcp_tls_connect:
prober: tcp
timeout: 5s
tcp:
preferred_ip_protocol: "ip4"
# Prometheus Scrape Config
- type: replace
path: /instance_groups/name=prometheus2/jobs/name=prometheus2/properties/prometheus/scrape_configs/-
value:
job_name: blackbox_http_200
metrics_path: /probe
params:
module:
- http_301
static_configs:
- targets: ((http_301_probe_endpoints))
relabel_configs:
- source_labels: [__address__]
regex: (.*)
target_label: __param_target
replacement: ${1}
- source_labels: [__param_target]
regex: (.*)
target_label: instance
replacement: ${1}
- source_labels: []
regex: .*
target_label: __address__
replacement: localhost:9115
- type: replace
path: /instance_groups/name=prometheus2/jobs/name=prometheus2/properties/prometheus/scrape_configs/-
value:
job_name: blackbox_https_200
metrics_path: /probe
params:
module:
- https_200
static_configs:
- targets: ((https_200_probe_endpoints))
relabel_configs:
- source_labels: [__address__]
regex: (.*)
target_label: __param_target
replacement: ${1}
- source_labels: [__param_target]
regex: (.*)
target_label: instance
replacement: ${1}
- source_labels: []
regex: .*
target_label: __address__
replacement: localhost:9115
- type: replace
path: /instance_groups/name=prometheus2/jobs/name=prometheus2/properties/prometheus/scrape_configs/-
value:
job_name: blackbox_https_301
metrics_path: /probe
params:
module:
- https_301
static_configs:
- targets: ((https_301_probe_endpoints))
relabel_configs:
- source_labels: [__address__]
regex: (.*)
target_label: __param_target
replacement: ${1}
- source_labels: [__param_target]
regex: (.*)
target_label: instance
replacement: ${1}
- source_labels: []
regex: .*
target_label: __address__
replacement: localhost:9115
- type: replace
path: /instance_groups/name=prometheus2/jobs/name=prometheus2/properties/prometheus/scrape_configs/-
value:
job_name: blackbox_https_302
metrics_path: /probe
params:
module:
- https_302
static_configs:
- targets: ((https_302_probe_endpoints))
relabel_configs:
- source_labels: [__address__]
regex: (.*)
target_label: __param_target
replacement: ${1}
- source_labels: [__param_target]
regex: (.*)
target_label: instance
replacement: ${1}
- source_labels: []
regex: .*
target_label: __address__
replacement: localhost:9115
- type: replace
path: /instance_groups/name=prometheus2/jobs/name=prometheus2/properties/prometheus/scrape_configs/-
value:
job_name: blackbox_https_200_slow
metrics_path: /probe
params:
module:
- https_200_slow
static_configs:
- targets: ((https_200_slow_probe_endpoints))
relabel_configs:
- source_labels: [__address__]
regex: (.*)
target_label: __param_target
replacement: ${1}
- source_labels: [__param_target]
regex: (.*)
target_label: instance
replacement: ${1}
- source_labels: []
regex: .*
target_label: __address__
replacement: localhost:9115
# check availability of sites with access restrictions in place
- type: replace
path: /instance_groups/name=prometheus2/jobs/name=prometheus2/properties/prometheus/scrape_configs/-
value:
job_name: blackbox_https_4xx
metrics_path: /probe
params:
module:
- https_4xx
static_configs:
- targets: ((https_4xx_probe_endpoints))
relabel_configs:
- source_labels: [__address__]
regex: (.*)
target_label: __param_target
replacement: ${1}
- source_labels: [__param_target]
regex: (.*)
target_label: instance
replacement: ${1}
- source_labels: []
regex: .*
target_label: __address__
replacement: localhost:9115
# Probe the targets under tcp_smtp_probe_endpoints for availability and TLS.
- type: replace
path: /instance_groups/name=prometheus2/jobs/name=prometheus2/properties/prometheus/scrape_configs/-
value:
job_name: blackbox_tcp_tls
metrics_path: /probe
params:
module:
- tcp_tls_connect
static_configs:
- targets: ((tcp_smtp_probe_endpoints))
relabel_configs:
- source_labels: [__address__]
target_label: __param_target
- source_labels: [__param_target]
target_label: instance
- target_label: __address__
replacement: localhost:9115
# Prometheus Alerts
- type: replace
path: /instance_groups/name=prometheus2/jobs/name=probe_alerts?/release
value: prometheus
- type: replace
path: /instance_groups/name=prometheus2/jobs/name=prometheus2/properties/prometheus/rule_files/-
value: /var/vcap/jobs/probe_alerts/*.alerts.yml
# Warning alerts when certificates expire in less than 30 days (default is 7)
- type: replace
path: /instance_groups/name=prometheus2/jobs/name=probe_alerts/properties?/probe_alerts/cert_expiry_warning/threshold
value: 2592000
# Critical alerts when certificates expire in less than 7 days (default is 24 hours)
- type: replace
path: /instance_groups/name=prometheus2/jobs/name=probe_alerts/properties?/probe_alerts/cert_expiry_critical/threshold
value: 604800
# Grafana Dashboards
- type: replace
path: /instance_groups/name=grafana/jobs/name=probe_dashboards?/release
value: prometheus
- type: replace
path: /instance_groups/name=grafana/jobs/name=grafana/properties/grafana/prometheus/dashboard_files?/-
value: /var/vcap/jobs/probe_dashboards/*.json