about summary refs log tree commit diff
path: root/hosts/common
diff options
context:
space:
mode:
authorFranck Cuny <franck@fcuny.net>2022-04-04 14:22:36 -0700
committerFranck Cuny <franck@fcuny.net>2022-04-04 14:22:36 -0700
commit89f5319a8f5d5e6cab7a605bdfef37329bb3f191 (patch)
treed40021998931e8524ed44fc8b0df7a5b4762eaf7 /hosts/common
parentprometheus: configure correctly the blackbox (diff)
downloadworld-89f5319a8f5d5e6cab7a605bdfef37329bb3f191.tar.gz
prometheus: add scraper for HTTP
Diffstat (limited to 'hosts/common')
-rw-r--r--hosts/common/server/prometheus.nix28
1 files changed, 28 insertions, 0 deletions
diff --git a/hosts/common/server/prometheus.nix b/hosts/common/server/prometheus.nix
index 012fdb5..9128f31 100644
--- a/hosts/common/server/prometheus.nix
+++ b/hosts/common/server/prometheus.nix
@@ -85,6 +85,34 @@ in {
         ];
       }
       {
+        job_name = "blackbox-http";
+        metrics_path = "/probe";
+        params = { module = [ "http_2xx" ]; };
+        static_configs = [{
+          targets = [
+            "fcuny.net"
+            "git.fcuny.net"
+            "notes.fcuny.net"
+            "dash.fcuny.net"
+            "music.fcuny.net"
+          ];
+        }];
+        relabel_configs = [
+          {
+            source_labels = [ "__address__" ];
+            target_label = "__param_target";
+          }
+          {
+            source_labels = [ "__param_target" ];
+            target_label = "instance";
+          }
+          {
+            target_label = "__address__";
+            replacement = "localhost:9115";
+          }
+        ];
+      }
+      {
         job_name = "node";
         static_configs =
           [{ targets = [ "192.168.6.1:9100" "192.168.6.20:9100" ]; }];