Mercurial > code > home > repos > victoriametrics
annotate config/scrape_main.yaml @ 42:2f87ecd2a754
fix ping; add ping to prime
author | drewp@bigasterisk.com |
---|---|
date | Tue, 23 Jan 2024 14:56:51 -0800 |
parents | 407ee7fbda13 |
children | ccb6a2889e73 |
rev | line source |
---|---|
9 | 1 # see https://relabeler.promlabs.com/ |
2 | |
4
1eb6e6a2b9b6
version control configs finally; use configmaps to present them to VM
drewp@bigasterisk.com
parents:
diff
changeset
|
3 global: |
1eb6e6a2b9b6
version control configs finally; use configmaps to present them to VM
drewp@bigasterisk.com
parents:
diff
changeset
|
4 scrape_interval: 1m |
1eb6e6a2b9b6
version control configs finally; use configmaps to present them to VM
drewp@bigasterisk.com
parents:
diff
changeset
|
5 scrape_timeout: 10s |
1eb6e6a2b9b6
version control configs finally; use configmaps to present them to VM
drewp@bigasterisk.com
parents:
diff
changeset
|
6 |
9 | 7 # scrape_config_files: |
8 # - build/scrape_ssl.yaml | |
4
1eb6e6a2b9b6
version control configs finally; use configmaps to present them to VM
drewp@bigasterisk.com
parents:
diff
changeset
|
9 # These can even be urls: https://github.com/VictoriaMetrics/VictoriaMetrics/blob/master/app/vmagent/README.md#loading-scrape-configs-from-multiple-files |
1eb6e6a2b9b6
version control configs finally; use configmaps to present them to VM
drewp@bigasterisk.com
parents:
diff
changeset
|
10 |
1eb6e6a2b9b6
version control configs finally; use configmaps to present them to VM
drewp@bigasterisk.com
parents:
diff
changeset
|
11 scrape_configs: |
1eb6e6a2b9b6
version control configs finally; use configmaps to present them to VM
drewp@bigasterisk.com
parents:
diff
changeset
|
12 # some based on https://github.com/prometheus/prometheus/blob/main/documentation/examples/prometheus-kubernetes.yml |
1eb6e6a2b9b6
version control configs finally; use configmaps to present them to VM
drewp@bigasterisk.com
parents:
diff
changeset
|
13 |
1eb6e6a2b9b6
version control configs finally; use configmaps to present them to VM
drewp@bigasterisk.com
parents:
diff
changeset
|
14 - job_name: "kubernetes-apiservers" |
1eb6e6a2b9b6
version control configs finally; use configmaps to present them to VM
drewp@bigasterisk.com
parents:
diff
changeset
|
15 scheme: https |
1eb6e6a2b9b6
version control configs finally; use configmaps to present them to VM
drewp@bigasterisk.com
parents:
diff
changeset
|
16 tls_config: { ca_file: /var/run/secrets/kubernetes.io/serviceaccount/ca.crt } |
1eb6e6a2b9b6
version control configs finally; use configmaps to present them to VM
drewp@bigasterisk.com
parents:
diff
changeset
|
17 bearer_token_file: /var/run/secrets/kubernetes.io/serviceaccount/token |
1eb6e6a2b9b6
version control configs finally; use configmaps to present them to VM
drewp@bigasterisk.com
parents:
diff
changeset
|
18 |
1eb6e6a2b9b6
version control configs finally; use configmaps to present them to VM
drewp@bigasterisk.com
parents:
diff
changeset
|
19 kubernetes_sd_configs: [{ role: endpoints }] |
1eb6e6a2b9b6
version control configs finally; use configmaps to present them to VM
drewp@bigasterisk.com
parents:
diff
changeset
|
20 |
1eb6e6a2b9b6
version control configs finally; use configmaps to present them to VM
drewp@bigasterisk.com
parents:
diff
changeset
|
21 relabel_configs: |
1eb6e6a2b9b6
version control configs finally; use configmaps to present them to VM
drewp@bigasterisk.com
parents:
diff
changeset
|
22 - source_labels: [__meta_kubernetes_namespace, __meta_kubernetes_service_name, __meta_kubernetes_endpoint_port_name] |
1eb6e6a2b9b6
version control configs finally; use configmaps to present them to VM
drewp@bigasterisk.com
parents:
diff
changeset
|
23 action: keep |
1eb6e6a2b9b6
version control configs finally; use configmaps to present them to VM
drewp@bigasterisk.com
parents:
diff
changeset
|
24 regex: default;kubernetes;https |
1eb6e6a2b9b6
version control configs finally; use configmaps to present them to VM
drewp@bigasterisk.com
parents:
diff
changeset
|
25 |
1eb6e6a2b9b6
version control configs finally; use configmaps to present them to VM
drewp@bigasterisk.com
parents:
diff
changeset
|
26 - job_name: "kubernetes-nodes" |
1eb6e6a2b9b6
version control configs finally; use configmaps to present them to VM
drewp@bigasterisk.com
parents:
diff
changeset
|
27 scheme: https |
1eb6e6a2b9b6
version control configs finally; use configmaps to present them to VM
drewp@bigasterisk.com
parents:
diff
changeset
|
28 tls_config: { ca_file: /var/run/secrets/kubernetes.io/serviceaccount/ca.crt } |
1eb6e6a2b9b6
version control configs finally; use configmaps to present them to VM
drewp@bigasterisk.com
parents:
diff
changeset
|
29 bearer_token_file: /var/run/secrets/kubernetes.io/serviceaccount/token |
1eb6e6a2b9b6
version control configs finally; use configmaps to present them to VM
drewp@bigasterisk.com
parents:
diff
changeset
|
30 |
1eb6e6a2b9b6
version control configs finally; use configmaps to present them to VM
drewp@bigasterisk.com
parents:
diff
changeset
|
31 kubernetes_sd_configs: [{ role: node }] |
1eb6e6a2b9b6
version control configs finally; use configmaps to present them to VM
drewp@bigasterisk.com
parents:
diff
changeset
|
32 |
1eb6e6a2b9b6
version control configs finally; use configmaps to present them to VM
drewp@bigasterisk.com
parents:
diff
changeset
|
33 relabel_configs: |
1eb6e6a2b9b6
version control configs finally; use configmaps to present them to VM
drewp@bigasterisk.com
parents:
diff
changeset
|
34 - action: labelmap |
1eb6e6a2b9b6
version control configs finally; use configmaps to present them to VM
drewp@bigasterisk.com
parents:
diff
changeset
|
35 regex: __meta_kubernetes_node_label_(.+) |
1eb6e6a2b9b6
version control configs finally; use configmaps to present them to VM
drewp@bigasterisk.com
parents:
diff
changeset
|
36 |
1eb6e6a2b9b6
version control configs finally; use configmaps to present them to VM
drewp@bigasterisk.com
parents:
diff
changeset
|
37 # see https://github.com/google/cadvisor/blob/master/docs/storage/prometheus.md |
1eb6e6a2b9b6
version control configs finally; use configmaps to present them to VM
drewp@bigasterisk.com
parents:
diff
changeset
|
38 # for metric definitions |
1eb6e6a2b9b6
version control configs finally; use configmaps to present them to VM
drewp@bigasterisk.com
parents:
diff
changeset
|
39 - job_name: "kubernetes-cadvisor" |
1eb6e6a2b9b6
version control configs finally; use configmaps to present them to VM
drewp@bigasterisk.com
parents:
diff
changeset
|
40 scheme: https |
1eb6e6a2b9b6
version control configs finally; use configmaps to present them to VM
drewp@bigasterisk.com
parents:
diff
changeset
|
41 metrics_path: /metrics/cadvisor |
1eb6e6a2b9b6
version control configs finally; use configmaps to present them to VM
drewp@bigasterisk.com
parents:
diff
changeset
|
42 tls_config: { ca_file: /var/run/secrets/kubernetes.io/serviceaccount/ca.crt } |
1eb6e6a2b9b6
version control configs finally; use configmaps to present them to VM
drewp@bigasterisk.com
parents:
diff
changeset
|
43 bearer_token_file: /var/run/secrets/kubernetes.io/serviceaccount/token |
1eb6e6a2b9b6
version control configs finally; use configmaps to present them to VM
drewp@bigasterisk.com
parents:
diff
changeset
|
44 |
1eb6e6a2b9b6
version control configs finally; use configmaps to present them to VM
drewp@bigasterisk.com
parents:
diff
changeset
|
45 kubernetes_sd_configs: [{ role: node }] |
1eb6e6a2b9b6
version control configs finally; use configmaps to present them to VM
drewp@bigasterisk.com
parents:
diff
changeset
|
46 |
1eb6e6a2b9b6
version control configs finally; use configmaps to present them to VM
drewp@bigasterisk.com
parents:
diff
changeset
|
47 relabel_configs: |
1eb6e6a2b9b6
version control configs finally; use configmaps to present them to VM
drewp@bigasterisk.com
parents:
diff
changeset
|
48 - action: labelmap |
1eb6e6a2b9b6
version control configs finally; use configmaps to present them to VM
drewp@bigasterisk.com
parents:
diff
changeset
|
49 regex: __meta_kubernetes_node_label_(.+) |
1eb6e6a2b9b6
version control configs finally; use configmaps to present them to VM
drewp@bigasterisk.com
parents:
diff
changeset
|
50 |
1eb6e6a2b9b6
version control configs finally; use configmaps to present them to VM
drewp@bigasterisk.com
parents:
diff
changeset
|
51 - job_name: "k8services" |
1eb6e6a2b9b6
version control configs finally; use configmaps to present them to VM
drewp@bigasterisk.com
parents:
diff
changeset
|
52 kubernetes_sd_configs: [{ role: endpoints }] |
1eb6e6a2b9b6
version control configs finally; use configmaps to present them to VM
drewp@bigasterisk.com
parents:
diff
changeset
|
53 relabel_configs: |
1eb6e6a2b9b6
version control configs finally; use configmaps to present them to VM
drewp@bigasterisk.com
parents:
diff
changeset
|
54 # To omit a service, add this at pod-level (Deployment.spec.template.metadata.annotations): |
1eb6e6a2b9b6
version control configs finally; use configmaps to present them to VM
drewp@bigasterisk.com
parents:
diff
changeset
|
55 # annotations: { prometheus.io/scrape: "false" } |
1eb6e6a2b9b6
version control configs finally; use configmaps to present them to VM
drewp@bigasterisk.com
parents:
diff
changeset
|
56 - source_labels: [__meta_kubernetes_pod_annotation_prometheus_io_scrape] |
9 | 57 regex: "false" |
4
1eb6e6a2b9b6
version control configs finally; use configmaps to present them to VM
drewp@bigasterisk.com
parents:
diff
changeset
|
58 action: drop |
1eb6e6a2b9b6
version control configs finally; use configmaps to present them to VM
drewp@bigasterisk.com
parents:
diff
changeset
|
59 |
19 | 60 # - source_labels: [__meta_kubernetes_namespace] |
61 # regex: default | |
62 # action: keep | |
4
1eb6e6a2b9b6
version control configs finally; use configmaps to present them to VM
drewp@bigasterisk.com
parents:
diff
changeset
|
63 |
9 | 64 # promote these to display |
4
1eb6e6a2b9b6
version control configs finally; use configmaps to present them to VM
drewp@bigasterisk.com
parents:
diff
changeset
|
65 - source_labels: [__meta_kubernetes_service_name] |
1eb6e6a2b9b6
version control configs finally; use configmaps to present them to VM
drewp@bigasterisk.com
parents:
diff
changeset
|
66 target_label: job |
1eb6e6a2b9b6
version control configs finally; use configmaps to present them to VM
drewp@bigasterisk.com
parents:
diff
changeset
|
67 |
1eb6e6a2b9b6
version control configs finally; use configmaps to present them to VM
drewp@bigasterisk.com
parents:
diff
changeset
|
68 - source_labels: [__meta_kubernetes_pod_node_name] |
1eb6e6a2b9b6
version control configs finally; use configmaps to present them to VM
drewp@bigasterisk.com
parents:
diff
changeset
|
69 target_label: node |
1eb6e6a2b9b6
version control configs finally; use configmaps to present them to VM
drewp@bigasterisk.com
parents:
diff
changeset
|
70 |
9 | 71 # for convenience in this config |
72 - source_labels: [__meta_kubernetes_pod_container_port_number] | |
73 target_label: __port_number | |
74 | |
75 # period tweaks | |
76 - if: '{job="power-eagle"}' | |
77 action: replace | |
78 target_label: __scrape_interval__ | |
79 # from powerEagle/private_config.periodSec | |
80 replacement: 8s | |
4
1eb6e6a2b9b6
version control configs finally; use configmaps to present them to VM
drewp@bigasterisk.com
parents:
diff
changeset
|
81 |
9 | 82 # path tweaks |
83 - if: '{job="victoriametrics",__port_number="8428"}' | |
84 action: replace | |
85 target_label: "__metrics_path__" | |
86 replacement: "/m/metrics" | |
29 | 87 - if: '{job="victorialogs",__port_number="9428"}' |
88 action: replace | |
89 target_label: "__metrics_path__" | |
90 replacement: "/logs/metrics" | |
25 | 91 - if: '{job="video-files",__port_number="8004"}' |
92 action: replace | |
93 target_label: "__metrics_path__" | |
94 replacement: "/video/api/metrics" | |
4
1eb6e6a2b9b6
version control configs finally; use configmaps to present them to VM
drewp@bigasterisk.com
parents:
diff
changeset
|
95 |
9 | 96 # discovery is matching extra ports that don't serve metrics- remove these targets |
38 | 97 - {if: '{job="cert-manager-webhook"}', action: drop} |
98 - {if: '{job="cert-manager", __port_number="9403"}', action: drop} | |
99 - {if: '{job="filesync-syncthing",__port_number="21027"}', action: drop} | |
100 - {if: '{job="filesync-syncthing",__port_number="22000"}', action: drop} | |
101 - {if: '{job="filesync-syncthing",__port_number="8384"}', action: drop} | |
102 - {if: '{job="jsregistry", __port_number="4873"}', action: drop} | |
103 - {if: '{job="kube-dns", __port_number="53"}', action: drop} | |
104 - {if: '{job="kubernetes"}', action: drop} | |
9 | 105 - {if: '{job="mongodb", __port_number="27017"}', action: drop} |
38 | 106 - {if: '{job="mosquitto-ext", __port_number="1883"}', action: drop} |
107 - {if: '{job="net-route-input", __port_number="80"}', action: drop} | |
108 - {if: '{job="photoprism", __port_number="2342"}', action: drop} | |
109 - {if: '{job="pomerium-metrics", __port_number="8080"}', action: drop} | |
110 - {if: '{job="pomerium-metrics", __port_number="8443"}', action: drop} | |
111 - {if: '{job="pomerium-proxy", __port_number="8080"}', action: drop} | |
112 - {if: '{job="pomerium-proxy", __port_number="8443"}', action: drop} | |
113 - {if: '{job="video-files", __port_number="8003"}', action: drop} | |
114 - {if: '{job=~"cm-acme-.*"}', action: drop} | |
41
407ee7fbda13
rm double metrics; add alert for too-many-500s
drewp@bigasterisk.com
parents:
39
diff
changeset
|
115 |
407ee7fbda13
rm double metrics; add alert for too-many-500s
drewp@bigasterisk.com
parents:
39
diff
changeset
|
116 # already have this with a job="pomerium-proxy" |
407ee7fbda13
rm double metrics; add alert for too-many-500s
drewp@bigasterisk.com
parents:
39
diff
changeset
|
117 - {if: '{job="pomerium-metrics"}', action: drop} |
407ee7fbda13
rm double metrics; add alert for too-many-500s
drewp@bigasterisk.com
parents:
39
diff
changeset
|
118 |
407ee7fbda13
rm double metrics; add alert for too-many-500s
drewp@bigasterisk.com
parents:
39
diff
changeset
|
119 |
33 | 120 |
34 | 121 # Assume all 8001/8002 port discoveries are redundant with an nginx proxy |
33 | 122 - {if: '{__port_number="8001"}', action: drop} |
123 - {if: '{__port_number="8002"}', action: drop} | |
19 | 124 |
125 # Needs https. Used by `kubectl top` | |
126 - {if: '{job="metrics-server", __port_number="4443"}', action: drop} | |
17 | 127 |
4
1eb6e6a2b9b6
version control configs finally; use configmaps to present them to VM
drewp@bigasterisk.com
parents:
diff
changeset
|
128 - job_name: "telegraf" |
1eb6e6a2b9b6
version control configs finally; use configmaps to present them to VM
drewp@bigasterisk.com
parents:
diff
changeset
|
129 scheme: http |
1eb6e6a2b9b6
version control configs finally; use configmaps to present them to VM
drewp@bigasterisk.com
parents:
diff
changeset
|
130 kubernetes_sd_configs: [{ role: node }] |
1eb6e6a2b9b6
version control configs finally; use configmaps to present them to VM
drewp@bigasterisk.com
parents:
diff
changeset
|
131 relabel_configs: |
1eb6e6a2b9b6
version control configs finally; use configmaps to present them to VM
drewp@bigasterisk.com
parents:
diff
changeset
|
132 - source_labels: [__address__] |
1eb6e6a2b9b6
version control configs finally; use configmaps to present them to VM
drewp@bigasterisk.com
parents:
diff
changeset
|
133 regex: "(.*):(\\d+)" |
1eb6e6a2b9b6
version control configs finally; use configmaps to present them to VM
drewp@bigasterisk.com
parents:
diff
changeset
|
134 target_label: __address__ |
1eb6e6a2b9b6
version control configs finally; use configmaps to present them to VM
drewp@bigasterisk.com
parents:
diff
changeset
|
135 replacement: "${1}:9273" |
1eb6e6a2b9b6
version control configs finally; use configmaps to present them to VM
drewp@bigasterisk.com
parents:
diff
changeset
|
136 action: replace |
1eb6e6a2b9b6
version control configs finally; use configmaps to present them to VM
drewp@bigasterisk.com
parents:
diff
changeset
|
137 |
17 | 138 - job_name: "smartctl" |
139 scrape_interval: 1h | |
140 scheme: http | |
141 kubernetes_sd_configs: [{ role: node }] | |
142 relabel_configs: | |
143 - source_labels: [__address__] | |
144 regex: "(.*):(\\d+)" | |
145 target_label: __address__ | |
146 replacement: "${1}:9633" | |
147 action: replace | |
148 | |
4
1eb6e6a2b9b6
version control configs finally; use configmaps to present them to VM
drewp@bigasterisk.com
parents:
diff
changeset
|
149 - job_name: "net-routes" |
1eb6e6a2b9b6
version control configs finally; use configmaps to present them to VM
drewp@bigasterisk.com
parents:
diff
changeset
|
150 static_configs: |
1eb6e6a2b9b6
version control configs finally; use configmaps to present them to VM
drewp@bigasterisk.com
parents:
diff
changeset
|
151 - targets: |
9 | 152 - pipe:9999 |
153 | |
154 - job_name: "net-traffic" | |
155 static_configs: | |
156 - targets: | |
157 - pipe:8080 | |
4
1eb6e6a2b9b6
version control configs finally; use configmaps to present them to VM
drewp@bigasterisk.com
parents:
diff
changeset
|
158 |
11 | 159 - job_name: "dnsmasq-log" |
160 static_configs: | |
161 - targets: | |
162 - pipe:9991 | |
163 | |
39 | 164 - job_name: "maildir-count" |
165 static_configs: | |
166 - targets: | |
167 - prime:2500 | |
168 | |
17 | 169 - job_name: "zfs" |
170 scrape_interval: 1h | |
171 static_configs: | |
172 - targets: | |
19 | 173 # running in in k8s, but as daemonset so it's not in SD above |
17 | 174 - ditto:9634 |
175 - ditto:9986 | |
11 | 176 |
4
1eb6e6a2b9b6
version control configs finally; use configmaps to present them to VM
drewp@bigasterisk.com
parents:
diff
changeset
|
177 - job_name: "ping" |
1eb6e6a2b9b6
version control configs finally; use configmaps to present them to VM
drewp@bigasterisk.com
parents:
diff
changeset
|
178 scrape_interval: 2m |
1eb6e6a2b9b6
version control configs finally; use configmaps to present them to VM
drewp@bigasterisk.com
parents:
diff
changeset
|
179 metrics_path: /probe |
1eb6e6a2b9b6
version control configs finally; use configmaps to present them to VM
drewp@bigasterisk.com
parents:
diff
changeset
|
180 params: |
1eb6e6a2b9b6
version control configs finally; use configmaps to present them to VM
drewp@bigasterisk.com
parents:
diff
changeset
|
181 module: [icmp] |
1eb6e6a2b9b6
version control configs finally; use configmaps to present them to VM
drewp@bigasterisk.com
parents:
diff
changeset
|
182 static_configs: |
1eb6e6a2b9b6
version control configs finally; use configmaps to present them to VM
drewp@bigasterisk.com
parents:
diff
changeset
|
183 - targets: |
1eb6e6a2b9b6
version control configs finally; use configmaps to present them to VM
drewp@bigasterisk.com
parents:
diff
changeset
|
184 # printer, since it falls out of ntop with no traffic at all. Or, we could poll ink status at http://10.2.0.37/general/status.html?pageid=1 |
42 | 185 - printer |
186 # wireguard connection test | |
187 - prime5 | |
4
1eb6e6a2b9b6
version control configs finally; use configmaps to present them to VM
drewp@bigasterisk.com
parents:
diff
changeset
|
188 relabel_configs: |
9 | 189 - {source_labels: [__address__], target_label: __param_target} |
190 - {source_labels: [__param_target], target_label: instance} | |
4
1eb6e6a2b9b6
version control configs finally; use configmaps to present them to VM
drewp@bigasterisk.com
parents:
diff
changeset
|
191 - target_label: __address__ |
1eb6e6a2b9b6
version control configs finally; use configmaps to present them to VM
drewp@bigasterisk.com
parents:
diff
changeset
|
192 replacement: prober |
19 | 193 |
12 | 194 - job_name: "racc" |
195 scrape_interval: 30s | |
196 static_configs: | |
197 - targets: | |
198 - dash:5150 | |
199 - dot:5150 | |
200 - plus:5150 | |
201 - Kelsis-iMac:5150 |