Mercurial > code > home > repos > victoriametrics
annotate config/scrape_main.yaml @ 17:5702bde523ad
update scrape configs
author | drewp@bigasterisk.com |
---|---|
date | Fri, 23 Jun 2023 23:54:38 -0700 |
parents | b6720e379d5b |
children | 10017def57ce |
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 |
9 | 14 # - job_name: "vmalert" |
15 # metrics_path: /vmalert/metrics | |
16 # static_configs: | |
17 # - targets: | |
18 # - vmalert.default.svc.cluster.local | |
4
1eb6e6a2b9b6
version control configs finally; use configmaps to present them to VM
drewp@bigasterisk.com
parents:
diff
changeset
|
19 |
1eb6e6a2b9b6
version control configs finally; use configmaps to present them to VM
drewp@bigasterisk.com
parents:
diff
changeset
|
20 - job_name: "kubernetes-apiservers" |
1eb6e6a2b9b6
version control configs finally; use configmaps to present them to VM
drewp@bigasterisk.com
parents:
diff
changeset
|
21 scheme: https |
1eb6e6a2b9b6
version control configs finally; use configmaps to present them to VM
drewp@bigasterisk.com
parents:
diff
changeset
|
22 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
|
23 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
|
24 |
1eb6e6a2b9b6
version control configs finally; use configmaps to present them to VM
drewp@bigasterisk.com
parents:
diff
changeset
|
25 kubernetes_sd_configs: [{ role: endpoints }] |
1eb6e6a2b9b6
version control configs finally; use configmaps to present them to VM
drewp@bigasterisk.com
parents:
diff
changeset
|
26 |
1eb6e6a2b9b6
version control configs finally; use configmaps to present them to VM
drewp@bigasterisk.com
parents:
diff
changeset
|
27 relabel_configs: |
1eb6e6a2b9b6
version control configs finally; use configmaps to present them to VM
drewp@bigasterisk.com
parents:
diff
changeset
|
28 - 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
|
29 action: keep |
1eb6e6a2b9b6
version control configs finally; use configmaps to present them to VM
drewp@bigasterisk.com
parents:
diff
changeset
|
30 regex: default;kubernetes;https |
1eb6e6a2b9b6
version control configs finally; use configmaps to present them to VM
drewp@bigasterisk.com
parents:
diff
changeset
|
31 |
1eb6e6a2b9b6
version control configs finally; use configmaps to present them to VM
drewp@bigasterisk.com
parents:
diff
changeset
|
32 - job_name: "kubernetes-nodes" |
1eb6e6a2b9b6
version control configs finally; use configmaps to present them to VM
drewp@bigasterisk.com
parents:
diff
changeset
|
33 scheme: https |
1eb6e6a2b9b6
version control configs finally; use configmaps to present them to VM
drewp@bigasterisk.com
parents:
diff
changeset
|
34 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
|
35 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
|
36 |
1eb6e6a2b9b6
version control configs finally; use configmaps to present them to VM
drewp@bigasterisk.com
parents:
diff
changeset
|
37 kubernetes_sd_configs: [{ role: node }] |
1eb6e6a2b9b6
version control configs finally; use configmaps to present them to VM
drewp@bigasterisk.com
parents:
diff
changeset
|
38 |
1eb6e6a2b9b6
version control configs finally; use configmaps to present them to VM
drewp@bigasterisk.com
parents:
diff
changeset
|
39 relabel_configs: |
1eb6e6a2b9b6
version control configs finally; use configmaps to present them to VM
drewp@bigasterisk.com
parents:
diff
changeset
|
40 - action: labelmap |
1eb6e6a2b9b6
version control configs finally; use configmaps to present them to VM
drewp@bigasterisk.com
parents:
diff
changeset
|
41 regex: __meta_kubernetes_node_label_(.+) |
1eb6e6a2b9b6
version control configs finally; use configmaps to present them to VM
drewp@bigasterisk.com
parents:
diff
changeset
|
42 |
1eb6e6a2b9b6
version control configs finally; use configmaps to present them to VM
drewp@bigasterisk.com
parents:
diff
changeset
|
43 # 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
|
44 # for metric definitions |
1eb6e6a2b9b6
version control configs finally; use configmaps to present them to VM
drewp@bigasterisk.com
parents:
diff
changeset
|
45 - job_name: "kubernetes-cadvisor" |
1eb6e6a2b9b6
version control configs finally; use configmaps to present them to VM
drewp@bigasterisk.com
parents:
diff
changeset
|
46 scheme: https |
1eb6e6a2b9b6
version control configs finally; use configmaps to present them to VM
drewp@bigasterisk.com
parents:
diff
changeset
|
47 metrics_path: /metrics/cadvisor |
1eb6e6a2b9b6
version control configs finally; use configmaps to present them to VM
drewp@bigasterisk.com
parents:
diff
changeset
|
48 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
|
49 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
|
50 |
1eb6e6a2b9b6
version control configs finally; use configmaps to present them to VM
drewp@bigasterisk.com
parents:
diff
changeset
|
51 kubernetes_sd_configs: [{ role: node }] |
1eb6e6a2b9b6
version control configs finally; use configmaps to present them to VM
drewp@bigasterisk.com
parents:
diff
changeset
|
52 |
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 - action: labelmap |
1eb6e6a2b9b6
version control configs finally; use configmaps to present them to VM
drewp@bigasterisk.com
parents:
diff
changeset
|
55 regex: __meta_kubernetes_node_label_(.+) |
1eb6e6a2b9b6
version control configs finally; use configmaps to present them to VM
drewp@bigasterisk.com
parents:
diff
changeset
|
56 |
1eb6e6a2b9b6
version control configs finally; use configmaps to present them to VM
drewp@bigasterisk.com
parents:
diff
changeset
|
57 - job_name: "k8services" |
1eb6e6a2b9b6
version control configs finally; use configmaps to present them to VM
drewp@bigasterisk.com
parents:
diff
changeset
|
58 kubernetes_sd_configs: [{ role: endpoints }] |
1eb6e6a2b9b6
version control configs finally; use configmaps to present them to VM
drewp@bigasterisk.com
parents:
diff
changeset
|
59 relabel_configs: |
1eb6e6a2b9b6
version control configs finally; use configmaps to present them to VM
drewp@bigasterisk.com
parents:
diff
changeset
|
60 # 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
|
61 # annotations: { prometheus.io/scrape: "false" } |
1eb6e6a2b9b6
version control configs finally; use configmaps to present them to VM
drewp@bigasterisk.com
parents:
diff
changeset
|
62 - source_labels: [__meta_kubernetes_pod_annotation_prometheus_io_scrape] |
9 | 63 regex: "false" |
4
1eb6e6a2b9b6
version control configs finally; use configmaps to present them to VM
drewp@bigasterisk.com
parents:
diff
changeset
|
64 action: drop |
1eb6e6a2b9b6
version control configs finally; use configmaps to present them to VM
drewp@bigasterisk.com
parents:
diff
changeset
|
65 |
1eb6e6a2b9b6
version control configs finally; use configmaps to present them to VM
drewp@bigasterisk.com
parents:
diff
changeset
|
66 - source_labels: [__meta_kubernetes_namespace] |
1eb6e6a2b9b6
version control configs finally; use configmaps to present them to VM
drewp@bigasterisk.com
parents:
diff
changeset
|
67 regex: default |
1eb6e6a2b9b6
version control configs finally; use configmaps to present them to VM
drewp@bigasterisk.com
parents:
diff
changeset
|
68 action: keep |
1eb6e6a2b9b6
version control configs finally; use configmaps to present them to VM
drewp@bigasterisk.com
parents:
diff
changeset
|
69 |
9 | 70 # promote these to display |
4
1eb6e6a2b9b6
version control configs finally; use configmaps to present them to VM
drewp@bigasterisk.com
parents:
diff
changeset
|
71 - source_labels: [__meta_kubernetes_service_name] |
1eb6e6a2b9b6
version control configs finally; use configmaps to present them to VM
drewp@bigasterisk.com
parents:
diff
changeset
|
72 target_label: job |
1eb6e6a2b9b6
version control configs finally; use configmaps to present them to VM
drewp@bigasterisk.com
parents:
diff
changeset
|
73 |
1eb6e6a2b9b6
version control configs finally; use configmaps to present them to VM
drewp@bigasterisk.com
parents:
diff
changeset
|
74 - 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
|
75 target_label: node |
1eb6e6a2b9b6
version control configs finally; use configmaps to present them to VM
drewp@bigasterisk.com
parents:
diff
changeset
|
76 |
9 | 77 # for convenience in this config |
78 - source_labels: [__meta_kubernetes_pod_container_port_number] | |
79 target_label: __port_number | |
80 | |
81 # period tweaks | |
82 - if: '{job="power-eagle"}' | |
83 action: replace | |
84 target_label: __scrape_interval__ | |
85 # from powerEagle/private_config.periodSec | |
86 replacement: 8s | |
4
1eb6e6a2b9b6
version control configs finally; use configmaps to present them to VM
drewp@bigasterisk.com
parents:
diff
changeset
|
87 |
9 | 88 # path tweaks |
89 - if: '{job="victoriametrics",__port_number="8428"}' | |
90 action: replace | |
91 target_label: "__metrics_path__" | |
92 replacement: "/m/metrics" | |
4
1eb6e6a2b9b6
version control configs finally; use configmaps to present them to VM
drewp@bigasterisk.com
parents:
diff
changeset
|
93 |
9 | 94 # discovery is matching extra ports that don't serve metrics- remove these targets |
95 - {if: '{job="kubernetes"}', action: drop} | |
96 - {if: '{job="mongodb", __port_number="27017"}', action: drop} | |
97 - {if: '{job="mosquitto-ext", __port_number="1883"}', action: drop} | |
98 - {if: '{job="filesync-syncthing",__port_number="8384"}', action: drop} | |
99 - {if: '{job="jsregistry", __port_number="4873"}', action: drop} | |
12 | 100 - {if: '{job="photoprism", __port_number="2342"}', action: drop} |
101 - {if: '{job="net-route-input", __port_number="80"}', action: drop} | |
17 | 102 |
103 # discovery is also matching redundant container ports that it also catches with the service | |
104 - {if: '{job="lanscape", __port_number="8001"}', action: drop} | |
105 - {if: '{job="lanscape", __port_number="8002"}', action: drop} | |
106 - {if: '{job="collector", __port_number="8001"}', action: drop} | |
107 - {if: '{job="collector", __port_number="8002"}', action: drop} | |
108 - {if: '{job="racc-console", __port_number="8002"}', action: drop} | |
109 - {if: '{job="antigen-web", __port_number="8001"}', action: drop} | |
110 | |
9 | 111 |
4
1eb6e6a2b9b6
version control configs finally; use configmaps to present them to VM
drewp@bigasterisk.com
parents:
diff
changeset
|
112 # # seems like this would match more stuff, but all I get is coredns |
1eb6e6a2b9b6
version control configs finally; use configmaps to present them to VM
drewp@bigasterisk.com
parents:
diff
changeset
|
113 # - job_name: 'old_coredns' |
1eb6e6a2b9b6
version control configs finally; use configmaps to present them to VM
drewp@bigasterisk.com
parents:
diff
changeset
|
114 # kubernetes_sd_configs: [{role: pod}] |
1eb6e6a2b9b6
version control configs finally; use configmaps to present them to VM
drewp@bigasterisk.com
parents:
diff
changeset
|
115 # relabel_configs: |
1eb6e6a2b9b6
version control configs finally; use configmaps to present them to VM
drewp@bigasterisk.com
parents:
diff
changeset
|
116 # - source_labels: [__meta_kubernetes_pod_container_port_name] |
1eb6e6a2b9b6
version control configs finally; use configmaps to present them to VM
drewp@bigasterisk.com
parents:
diff
changeset
|
117 # regex: metrics |
1eb6e6a2b9b6
version control configs finally; use configmaps to present them to VM
drewp@bigasterisk.com
parents:
diff
changeset
|
118 # action: keep |
1eb6e6a2b9b6
version control configs finally; use configmaps to present them to VM
drewp@bigasterisk.com
parents:
diff
changeset
|
119 # - source_labels: [__meta_kubernetes_pod_container_name] |
1eb6e6a2b9b6
version control configs finally; use configmaps to present them to VM
drewp@bigasterisk.com
parents:
diff
changeset
|
120 # target_label: job |
1eb6e6a2b9b6
version control configs finally; use configmaps to present them to VM
drewp@bigasterisk.com
parents:
diff
changeset
|
121 |
1eb6e6a2b9b6
version control configs finally; use configmaps to present them to VM
drewp@bigasterisk.com
parents:
diff
changeset
|
122 - job_name: "telegraf" |
1eb6e6a2b9b6
version control configs finally; use configmaps to present them to VM
drewp@bigasterisk.com
parents:
diff
changeset
|
123 scheme: http |
1eb6e6a2b9b6
version control configs finally; use configmaps to present them to VM
drewp@bigasterisk.com
parents:
diff
changeset
|
124 kubernetes_sd_configs: [{ role: node }] |
1eb6e6a2b9b6
version control configs finally; use configmaps to present them to VM
drewp@bigasterisk.com
parents:
diff
changeset
|
125 relabel_configs: |
1eb6e6a2b9b6
version control configs finally; use configmaps to present them to VM
drewp@bigasterisk.com
parents:
diff
changeset
|
126 - source_labels: [__address__] |
1eb6e6a2b9b6
version control configs finally; use configmaps to present them to VM
drewp@bigasterisk.com
parents:
diff
changeset
|
127 regex: "(.*):(\\d+)" |
1eb6e6a2b9b6
version control configs finally; use configmaps to present them to VM
drewp@bigasterisk.com
parents:
diff
changeset
|
128 target_label: __address__ |
1eb6e6a2b9b6
version control configs finally; use configmaps to present them to VM
drewp@bigasterisk.com
parents:
diff
changeset
|
129 replacement: "${1}:9273" |
1eb6e6a2b9b6
version control configs finally; use configmaps to present them to VM
drewp@bigasterisk.com
parents:
diff
changeset
|
130 action: replace |
1eb6e6a2b9b6
version control configs finally; use configmaps to present them to VM
drewp@bigasterisk.com
parents:
diff
changeset
|
131 |
17 | 132 - job_name: "smartctl" |
133 scrape_interval: 1h | |
134 scheme: http | |
135 kubernetes_sd_configs: [{ role: node }] | |
136 relabel_configs: | |
137 - source_labels: [__address__] | |
138 regex: "(.*):(\\d+)" | |
139 target_label: __address__ | |
140 replacement: "${1}:9633" | |
141 action: replace | |
142 | |
4
1eb6e6a2b9b6
version control configs finally; use configmaps to present them to VM
drewp@bigasterisk.com
parents:
diff
changeset
|
143 - job_name: "net-routes" |
1eb6e6a2b9b6
version control configs finally; use configmaps to present them to VM
drewp@bigasterisk.com
parents:
diff
changeset
|
144 static_configs: |
1eb6e6a2b9b6
version control configs finally; use configmaps to present them to VM
drewp@bigasterisk.com
parents:
diff
changeset
|
145 - targets: |
9 | 146 - pipe:9999 |
147 | |
148 - job_name: "net-traffic" | |
149 static_configs: | |
150 - targets: | |
151 - pipe:8080 | |
4
1eb6e6a2b9b6
version control configs finally; use configmaps to present them to VM
drewp@bigasterisk.com
parents:
diff
changeset
|
152 |
11 | 153 - job_name: "dnsmasq-log" |
154 static_configs: | |
155 - targets: | |
156 - pipe:9991 | |
157 | |
17 | 158 - job_name: "pomerium" |
11 | 159 static_configs: |
160 - targets: | |
17 | 161 - pomerium-metrics.pomerium.svc:9090 |
162 - cert-manager.cert-manager.svc:9402 | |
163 | |
164 | |
165 - job_name: "zfs" | |
166 scrape_interval: 1h | |
167 static_configs: | |
168 - targets: | |
169 # running in in k8s, but not in SD | |
170 - ditto:9634 | |
171 - ditto:9986 | |
11 | 172 |
4
1eb6e6a2b9b6
version control configs finally; use configmaps to present them to VM
drewp@bigasterisk.com
parents:
diff
changeset
|
173 - job_name: "ping" |
1eb6e6a2b9b6
version control configs finally; use configmaps to present them to VM
drewp@bigasterisk.com
parents:
diff
changeset
|
174 scrape_interval: 2m |
1eb6e6a2b9b6
version control configs finally; use configmaps to present them to VM
drewp@bigasterisk.com
parents:
diff
changeset
|
175 metrics_path: /probe |
1eb6e6a2b9b6
version control configs finally; use configmaps to present them to VM
drewp@bigasterisk.com
parents:
diff
changeset
|
176 params: |
1eb6e6a2b9b6
version control configs finally; use configmaps to present them to VM
drewp@bigasterisk.com
parents:
diff
changeset
|
177 module: [icmp] |
1eb6e6a2b9b6
version control configs finally; use configmaps to present them to VM
drewp@bigasterisk.com
parents:
diff
changeset
|
178 static_configs: |
1eb6e6a2b9b6
version control configs finally; use configmaps to present them to VM
drewp@bigasterisk.com
parents:
diff
changeset
|
179 - targets: |
1eb6e6a2b9b6
version control configs finally; use configmaps to present them to VM
drewp@bigasterisk.com
parents:
diff
changeset
|
180 # 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 | 181 - printer014032ED |
4
1eb6e6a2b9b6
version control configs finally; use configmaps to present them to VM
drewp@bigasterisk.com
parents:
diff
changeset
|
182 # frontbed, for monitoring |
11 | 183 # - 10.5.0.17 # too flaky |
9 | 184 # asher bulb, not sure why it sleeps so long |
185 - bulb1 | |
4
1eb6e6a2b9b6
version control configs finally; use configmaps to present them to VM
drewp@bigasterisk.com
parents:
diff
changeset
|
186 |
1eb6e6a2b9b6
version control configs finally; use configmaps to present them to VM
drewp@bigasterisk.com
parents:
diff
changeset
|
187 relabel_configs: |
9 | 188 - {source_labels: [__address__], target_label: __param_target} |
189 - {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
|
190 - target_label: __address__ |
1eb6e6a2b9b6
version control configs finally; use configmaps to present them to VM
drewp@bigasterisk.com
parents:
diff
changeset
|
191 replacement: prober |
12 | 192 - job_name: "racc" |
193 scrape_interval: 30s | |
194 static_configs: | |
195 - targets: | |
196 - dash:5150 | |
197 - dot:5150 | |
198 - plus:5150 | |
199 - Kelsis-iMac:5150 |