prometheus related updates
[distro-setup] / filesystem / etc / prometheus / prometheus.yml
index fb1e53757ffa7894871b00feaf793a9cbdfc2102..51eb43bfca2bfb409aa46a20a3dffcf7c8362d83 100644 (file)
@@ -7,7 +7,11 @@ global:
   ## for both.
   # scrape_interval: 5s
   # evaluation_interval: 5s
-
+  # and also useful
+  # /etc/default/prometheus
+# --query.lookback-delta=15s
+# the default lookback is 5 minutes, there is a way to change
+# it per query in the api with a QueryOpt option, but it isnt exposed in the web ui.
 
   # Attach these labels to any time series or alerts when communicating with
   # external systems (federation, remote storage, Alertmanager).
@@ -37,21 +41,44 @@ scrape_configs:
 
     static_configs:
       - targets: ['localhost:9090']
+        labels:
+          instance: 'kd'
   - job_name: 'alertmanager'
     static_configs:
-      - targets: ['localhost:9093']
+      -
+        targets: ['localhost:9093']
+        labels:
+          instance: 'kd'
+
 
   - job_name: simple_node
     file_sd_configs:
       - files:
         - /etc/prometheus/file_sd/simple_node.yml
+
   - job_name: node
-    basic_auth:
-      username: prom
-      password_file: /etc/prometheus-pass
+    scheme: https
+    tls_config:
+      # Verifying remote identity
+      ca_file: /etc/prometheus/ssl/prom_node_cert.pem
+      server_name: prom_node
+      # Asserting our identity
+      cert_file: /etc/prometheus/ssl/prometheus_cert.pem
+      key_file: /etc/prometheus/ssl/prometheus_key.pem
     file_sd_configs:
       - files:
         - /etc/prometheus/file_sd/node.yml
+    relabel_configs:
+    - source_labels: [__address__]
+      regex: "localhost:9100"
+      replacement: kd
+      target_label: instance
+    - source_labels: [__address__]
+      regex: "(.*)wg:.*"
+      # this is the default:
+      #replacement: "${1}"
+      target_label: instance
+
   - job_name: tlsnode
     scheme: https
     basic_auth: