aboutsummaryrefslogtreecommitdiff
path: root/roles/monitoring/templates
diff options
context:
space:
mode:
authorKumar Damani <me@kumardamani.net>2022-09-07 20:40:17 +0000
committerKumar Damani <me@kumardamani.net>2022-09-07 20:40:17 +0000
commitbbe10895d9df8dd7899bbd65575d5bf12e57f8c8 (patch)
tree244d2f1ad38320863fb60f695c88c97799be1171 /roles/monitoring/templates
parent4d34de2f5e757bfeae5738547aabb61d3d28a2f8 (diff)
parentc85806e3289b5e207d51d382f8dc75edad04404d (diff)
Merge branch 'alpine' into 'master'
switched to alpine initial commit See merge request kdam0/vps!2
Diffstat (limited to 'roles/monitoring/templates')
-rw-r--r--roles/monitoring/templates/blackbox.yml.j24
-rw-r--r--roles/monitoring/templates/prometheus.yml.j262
2 files changed, 66 insertions, 0 deletions
diff --git a/roles/monitoring/templates/blackbox.yml.j2 b/roles/monitoring/templates/blackbox.yml.j2
new file mode 100644
index 0000000..9dd359a
--- /dev/null
+++ b/roles/monitoring/templates/blackbox.yml.j2
@@ -0,0 +1,4 @@
+modules:
+ http_2xx:
+ prober: http
+ timeout: 5s
diff --git a/roles/monitoring/templates/prometheus.yml.j2 b/roles/monitoring/templates/prometheus.yml.j2
new file mode 100644
index 0000000..9bdbbe3
--- /dev/null
+++ b/roles/monitoring/templates/prometheus.yml.j2
@@ -0,0 +1,62 @@
+global:
+ scrape_interval: 15s
+ evaluation_interval: 30s
+
+scrape_configs:
+ - job_name: 'prometheus'
+ honor_labels: true
+ static_configs:
+ - targets: ["localhost:9090"]
+ labels:
+ env: prod
+
+ - job_name: 'node_exporter'
+ static_configs:
+ - targets: ["localhost:9100"]
+
+ - job_name: 'zfs_exporter'
+ metrics_path: /metrics
+ static_configs:
+ - targets: ["localhost:9134"]
+
+ - job_name: 'blackbox-service-status'
+ metrics_path: /probe
+ params:
+ module: [http_2xx]
+ static_configs:
+{% for t in monitoring_apps_confs %}
+{% if not t.conf.curl_requires_auth %}
+ - targets:
+{% if "access_domain" in t.conf %}
+ - 'https://{{ t.conf.access_domain }}{{ t.conf.status_endpoint }}'
+{% else %}
+ - 'http://0.0.0.0:{{ t.conf.port }}{{ t.conf.status_endpoint }}'
+{% endif %}
+ labels:
+ name: '{{ t.app }}'
+{% endif %}
+{% 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 # Blackbox exporter.
+
+ - job_name: 'blackbox-ssl-sites'
+ metrics_path: /probe
+ params:
+ module: [http_2xx]
+ static_configs:
+ - targets:
+{% for t in monitoring_static_sites %}
+ - 'https://{{ t.name }}'
+{% 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 # Blackbox exporter.