Mercurial > code > home > repos > victoriametrics
annotate config/scrape_main.yaml @ 25:4bf507b38e34
video-files scrape cases
author | drewp@bigasterisk.com |
---|---|
date | Thu, 29 Jun 2023 13:58:20 -0700 |
parents | 10017def57ce |
children | a4c49fa01c9d |
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" | |
25 | 87 - if: '{job="video-files",__port_number="8004"}' |
88 action: replace | |
89 target_label: "__metrics_path__" | |
90 replacement: "/video/api/metrics" | |
4
1eb6e6a2b9b6
version control configs finally; use configmaps to present them to VM
drewp@bigasterisk.com
parents:
diff
changeset
|
91 |
9 | 92 # discovery is matching extra ports that don't serve metrics- remove these targets |
19 | 93 - {if: '{job="cert-manager-webhook"}', action: drop} |
94 - {if: '{job="cert-manager", __port_number="9403"}', action: drop} | |
95 - {if: '{job="filesync-syncthing",__port_number="8384"}', action: drop} | |
96 - {if: '{job="jsregistry", __port_number="4873"}', action: drop} | |
97 - {if: '{job="kube-dns", __port_number="53"}', action: drop} | |
9 | 98 - {if: '{job="kubernetes"}', action: drop} |
99 - {if: '{job="mongodb", __port_number="27017"}', action: drop} | |
100 - {if: '{job="mosquitto-ext", __port_number="1883"}', action: drop} | |
19 | 101 - {if: '{job="net-route-input", __port_number="80"}', action: drop} |
12 | 102 - {if: '{job="photoprism", __port_number="2342"}', action: drop} |
19 | 103 - {if: '{job="pomerium-metrics", __port_number="8080"}', action: drop} |
104 - {if: '{job="pomerium-metrics", __port_number="8443"}', action: drop} | |
105 - {if: '{job="pomerium-proxy", __port_number="8080"}', action: drop} | |
106 - {if: '{job="pomerium-proxy", __port_number="8443"}', action: drop} | |
25 | 107 - {if: '{job="video-files", __port_number="8003"}', action: drop} |
19 | 108 |
109 # Needs https. Used by `kubectl top` | |
110 - {if: '{job="metrics-server", __port_number="4443"}', action: drop} | |
17 | 111 |
112 # discovery is also matching redundant container ports that it also catches with the service | |
19 | 113 - {if: '{job="antigen-web", __port_number="8001"}', action: drop} |
114 - {if: '{job="collector", __port_number="8001"}', action: drop} | |
115 - {if: '{job="collector", __port_number="8002"}', action: drop} | |
116 - {if: '{job="lanscape", __port_number="8001"}', action: drop} | |
117 - {if: '{job="lanscape", __port_number="8002"}', action: drop} | |
118 - {if: '{job="racc-console", __port_number="8002"}', action: drop} | |
4
1eb6e6a2b9b6
version control configs finally; use configmaps to present them to VM
drewp@bigasterisk.com
parents:
diff
changeset
|
119 |
1eb6e6a2b9b6
version control configs finally; use configmaps to present them to VM
drewp@bigasterisk.com
parents:
diff
changeset
|
120 - job_name: "telegraf" |
1eb6e6a2b9b6
version control configs finally; use configmaps to present them to VM
drewp@bigasterisk.com
parents:
diff
changeset
|
121 scheme: http |
1eb6e6a2b9b6
version control configs finally; use configmaps to present them to VM
drewp@bigasterisk.com
parents:
diff
changeset
|
122 kubernetes_sd_configs: [{ role: node }] |
1eb6e6a2b9b6
version control configs finally; use configmaps to present them to VM
drewp@bigasterisk.com
parents:
diff
changeset
|
123 relabel_configs: |
1eb6e6a2b9b6
version control configs finally; use configmaps to present them to VM
drewp@bigasterisk.com
parents:
diff
changeset
|
124 - source_labels: [__address__] |
1eb6e6a2b9b6
version control configs finally; use configmaps to present them to VM
drewp@bigasterisk.com
parents:
diff
changeset
|
125 regex: "(.*):(\\d+)" |
1eb6e6a2b9b6
version control configs finally; use configmaps to present them to VM
drewp@bigasterisk.com
parents:
diff
changeset
|
126 target_label: __address__ |
1eb6e6a2b9b6
version control configs finally; use configmaps to present them to VM
drewp@bigasterisk.com
parents:
diff
changeset
|
127 replacement: "${1}:9273" |
1eb6e6a2b9b6
version control configs finally; use configmaps to present them to VM
drewp@bigasterisk.com
parents:
diff
changeset
|
128 action: replace |
1eb6e6a2b9b6
version control configs finally; use configmaps to present them to VM
drewp@bigasterisk.com
parents:
diff
changeset
|
129 |
17 | 130 - job_name: "smartctl" |
131 scrape_interval: 1h | |
132 scheme: http | |
133 kubernetes_sd_configs: [{ role: node }] | |
134 relabel_configs: | |
135 - source_labels: [__address__] | |
136 regex: "(.*):(\\d+)" | |
137 target_label: __address__ | |
138 replacement: "${1}:9633" | |
139 action: replace | |
140 | |
4
1eb6e6a2b9b6
version control configs finally; use configmaps to present them to VM
drewp@bigasterisk.com
parents:
diff
changeset
|
141 - job_name: "net-routes" |
1eb6e6a2b9b6
version control configs finally; use configmaps to present them to VM
drewp@bigasterisk.com
parents:
diff
changeset
|
142 static_configs: |
1eb6e6a2b9b6
version control configs finally; use configmaps to present them to VM
drewp@bigasterisk.com
parents:
diff
changeset
|
143 - targets: |
9 | 144 - pipe:9999 |
145 | |
146 - job_name: "net-traffic" | |
147 static_configs: | |
148 - targets: | |
149 - pipe:8080 | |
4
1eb6e6a2b9b6
version control configs finally; use configmaps to present them to VM
drewp@bigasterisk.com
parents:
diff
changeset
|
150 |
11 | 151 - job_name: "dnsmasq-log" |
152 static_configs: | |
153 - targets: | |
154 - pipe:9991 | |
155 | |
17 | 156 - job_name: "zfs" |
157 scrape_interval: 1h | |
158 static_configs: | |
159 - targets: | |
19 | 160 # running in in k8s, but as daemonset so it's not in SD above |
17 | 161 - ditto:9634 |
162 - ditto:9986 | |
11 | 163 |
4
1eb6e6a2b9b6
version control configs finally; use configmaps to present them to VM
drewp@bigasterisk.com
parents:
diff
changeset
|
164 - job_name: "ping" |
1eb6e6a2b9b6
version control configs finally; use configmaps to present them to VM
drewp@bigasterisk.com
parents:
diff
changeset
|
165 scrape_interval: 2m |
1eb6e6a2b9b6
version control configs finally; use configmaps to present them to VM
drewp@bigasterisk.com
parents:
diff
changeset
|
166 metrics_path: /probe |
1eb6e6a2b9b6
version control configs finally; use configmaps to present them to VM
drewp@bigasterisk.com
parents:
diff
changeset
|
167 params: |
1eb6e6a2b9b6
version control configs finally; use configmaps to present them to VM
drewp@bigasterisk.com
parents:
diff
changeset
|
168 module: [icmp] |
1eb6e6a2b9b6
version control configs finally; use configmaps to present them to VM
drewp@bigasterisk.com
parents:
diff
changeset
|
169 static_configs: |
1eb6e6a2b9b6
version control configs finally; use configmaps to present them to VM
drewp@bigasterisk.com
parents:
diff
changeset
|
170 - targets: |
1eb6e6a2b9b6
version control configs finally; use configmaps to present them to VM
drewp@bigasterisk.com
parents:
diff
changeset
|
171 # 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 | 172 - printer014032ED |
4
1eb6e6a2b9b6
version control configs finally; use configmaps to present them to VM
drewp@bigasterisk.com
parents:
diff
changeset
|
173 relabel_configs: |
9 | 174 - {source_labels: [__address__], target_label: __param_target} |
175 - {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
|
176 - target_label: __address__ |
1eb6e6a2b9b6
version control configs finally; use configmaps to present them to VM
drewp@bigasterisk.com
parents:
diff
changeset
|
177 replacement: prober |
19 | 178 |
12 | 179 - job_name: "racc" |
180 scrape_interval: 30s | |
181 static_configs: | |
182 - targets: | |
183 - dash:5150 | |
184 - dot:5150 | |
185 - plus:5150 | |
186 - Kelsis-iMac:5150 |