Mercurial > code > home > repos > victoriametrics
annotate config/scrape_main.yaml @ 38:ddcaa1abe0c5
more ignorelist
author | drewp@bigasterisk.com |
---|---|
date | Thu, 21 Dec 2023 13:47:55 -0800 |
parents | 3b91d52b007d |
children | 84a00d1b87b3 |
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} | |
33 | 115 |
34 | 116 # Assume all 8001/8002 port discoveries are redundant with an nginx proxy |
33 | 117 - {if: '{__port_number="8001"}', action: drop} |
118 - {if: '{__port_number="8002"}', action: drop} | |
19 | 119 |
120 # Needs https. Used by `kubectl top` | |
121 - {if: '{job="metrics-server", __port_number="4443"}', action: drop} | |
17 | 122 |
4
1eb6e6a2b9b6
version control configs finally; use configmaps to present them to VM
drewp@bigasterisk.com
parents:
diff
changeset
|
123 - job_name: "telegraf" |
1eb6e6a2b9b6
version control configs finally; use configmaps to present them to VM
drewp@bigasterisk.com
parents:
diff
changeset
|
124 scheme: http |
1eb6e6a2b9b6
version control configs finally; use configmaps to present them to VM
drewp@bigasterisk.com
parents:
diff
changeset
|
125 kubernetes_sd_configs: [{ role: node }] |
1eb6e6a2b9b6
version control configs finally; use configmaps to present them to VM
drewp@bigasterisk.com
parents:
diff
changeset
|
126 relabel_configs: |
1eb6e6a2b9b6
version control configs finally; use configmaps to present them to VM
drewp@bigasterisk.com
parents:
diff
changeset
|
127 - source_labels: [__address__] |
1eb6e6a2b9b6
version control configs finally; use configmaps to present them to VM
drewp@bigasterisk.com
parents:
diff
changeset
|
128 regex: "(.*):(\\d+)" |
1eb6e6a2b9b6
version control configs finally; use configmaps to present them to VM
drewp@bigasterisk.com
parents:
diff
changeset
|
129 target_label: __address__ |
1eb6e6a2b9b6
version control configs finally; use configmaps to present them to VM
drewp@bigasterisk.com
parents:
diff
changeset
|
130 replacement: "${1}:9273" |
1eb6e6a2b9b6
version control configs finally; use configmaps to present them to VM
drewp@bigasterisk.com
parents:
diff
changeset
|
131 action: replace |
1eb6e6a2b9b6
version control configs finally; use configmaps to present them to VM
drewp@bigasterisk.com
parents:
diff
changeset
|
132 |
17 | 133 - job_name: "smartctl" |
134 scrape_interval: 1h | |
135 scheme: http | |
136 kubernetes_sd_configs: [{ role: node }] | |
137 relabel_configs: | |
138 - source_labels: [__address__] | |
139 regex: "(.*):(\\d+)" | |
140 target_label: __address__ | |
141 replacement: "${1}:9633" | |
142 action: replace | |
143 | |
4
1eb6e6a2b9b6
version control configs finally; use configmaps to present them to VM
drewp@bigasterisk.com
parents:
diff
changeset
|
144 - job_name: "net-routes" |
1eb6e6a2b9b6
version control configs finally; use configmaps to present them to VM
drewp@bigasterisk.com
parents:
diff
changeset
|
145 static_configs: |
1eb6e6a2b9b6
version control configs finally; use configmaps to present them to VM
drewp@bigasterisk.com
parents:
diff
changeset
|
146 - targets: |
9 | 147 - pipe:9999 |
148 | |
149 - job_name: "net-traffic" | |
150 static_configs: | |
151 - targets: | |
152 - pipe:8080 | |
4
1eb6e6a2b9b6
version control configs finally; use configmaps to present them to VM
drewp@bigasterisk.com
parents:
diff
changeset
|
153 |
11 | 154 - job_name: "dnsmasq-log" |
155 static_configs: | |
156 - targets: | |
157 - pipe:9991 | |
158 | |
17 | 159 - job_name: "zfs" |
160 scrape_interval: 1h | |
161 static_configs: | |
162 - targets: | |
19 | 163 # running in in k8s, but as daemonset so it's not in SD above |
17 | 164 - ditto:9634 |
165 - ditto:9986 | |
11 | 166 |
4
1eb6e6a2b9b6
version control configs finally; use configmaps to present them to VM
drewp@bigasterisk.com
parents:
diff
changeset
|
167 - job_name: "ping" |
1eb6e6a2b9b6
version control configs finally; use configmaps to present them to VM
drewp@bigasterisk.com
parents:
diff
changeset
|
168 scrape_interval: 2m |
1eb6e6a2b9b6
version control configs finally; use configmaps to present them to VM
drewp@bigasterisk.com
parents:
diff
changeset
|
169 metrics_path: /probe |
1eb6e6a2b9b6
version control configs finally; use configmaps to present them to VM
drewp@bigasterisk.com
parents:
diff
changeset
|
170 params: |
1eb6e6a2b9b6
version control configs finally; use configmaps to present them to VM
drewp@bigasterisk.com
parents:
diff
changeset
|
171 module: [icmp] |
1eb6e6a2b9b6
version control configs finally; use configmaps to present them to VM
drewp@bigasterisk.com
parents:
diff
changeset
|
172 static_configs: |
1eb6e6a2b9b6
version control configs finally; use configmaps to present them to VM
drewp@bigasterisk.com
parents:
diff
changeset
|
173 - targets: |
1eb6e6a2b9b6
version control configs finally; use configmaps to present them to VM
drewp@bigasterisk.com
parents:
diff
changeset
|
174 # 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 |
9 | 175 - printer014032ED |
4
1eb6e6a2b9b6
version control configs finally; use configmaps to present them to VM
drewp@bigasterisk.com
parents:
diff
changeset
|
176 relabel_configs: |
9 | 177 - {source_labels: [__address__], target_label: __param_target} |
178 - {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
|
179 - target_label: __address__ |
1eb6e6a2b9b6
version control configs finally; use configmaps to present them to VM
drewp@bigasterisk.com
parents:
diff
changeset
|
180 replacement: prober |
19 | 181 |
12 | 182 - job_name: "racc" |
183 scrape_interval: 30s | |
184 static_configs: | |
185 - targets: | |
186 - dash:5150 | |
187 - dot:5150 | |
188 - plus:5150 | |
189 - Kelsis-iMac:5150 |