Mercurial > code > home > repos > victoriametrics
annotate config/scrape_main.yaml @ 64:def1aa2bfa3f
more targets polish. reorg code into next/
author | drewp@bigasterisk.com |
---|---|
date | Thu, 02 May 2024 23:06:31 -0700 |
parents | 8199713c9294 |
children |
rev | line source |
---|---|
4
1eb6e6a2b9b6
version control configs finally; use configmaps to present them to VM
drewp@bigasterisk.com
parents:
diff
changeset
|
1 # 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
|
2 |
1eb6e6a2b9b6
version control configs finally; use configmaps to present them to VM
drewp@bigasterisk.com
parents:
diff
changeset
|
3 - job_name: "k8services" |
1eb6e6a2b9b6
version control configs finally; use configmaps to present them to VM
drewp@bigasterisk.com
parents:
diff
changeset
|
4 kubernetes_sd_configs: [{ role: endpoints }] |
1eb6e6a2b9b6
version control configs finally; use configmaps to present them to VM
drewp@bigasterisk.com
parents:
diff
changeset
|
5 relabel_configs: |
1eb6e6a2b9b6
version control configs finally; use configmaps to present them to VM
drewp@bigasterisk.com
parents:
diff
changeset
|
6 # 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
|
7 # annotations: { prometheus.io/scrape: "false" } |
1eb6e6a2b9b6
version control configs finally; use configmaps to present them to VM
drewp@bigasterisk.com
parents:
diff
changeset
|
8 - source_labels: [__meta_kubernetes_pod_annotation_prometheus_io_scrape] |
9 | 9 regex: "false" |
4
1eb6e6a2b9b6
version control configs finally; use configmaps to present them to VM
drewp@bigasterisk.com
parents:
diff
changeset
|
10 action: drop |
1eb6e6a2b9b6
version control configs finally; use configmaps to present them to VM
drewp@bigasterisk.com
parents:
diff
changeset
|
11 |
19 | 12 # - source_labels: [__meta_kubernetes_namespace] |
13 # regex: default | |
14 # action: keep | |
4
1eb6e6a2b9b6
version control configs finally; use configmaps to present them to VM
drewp@bigasterisk.com
parents:
diff
changeset
|
15 |
9 | 16 # promote these to display |
4
1eb6e6a2b9b6
version control configs finally; use configmaps to present them to VM
drewp@bigasterisk.com
parents:
diff
changeset
|
17 - source_labels: [__meta_kubernetes_service_name] |
1eb6e6a2b9b6
version control configs finally; use configmaps to present them to VM
drewp@bigasterisk.com
parents:
diff
changeset
|
18 target_label: job |
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 - 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
|
21 target_label: node |
1eb6e6a2b9b6
version control configs finally; use configmaps to present them to VM
drewp@bigasterisk.com
parents:
diff
changeset
|
22 |
9 | 23 # for convenience in this config |
24 - source_labels: [__meta_kubernetes_pod_container_port_number] | |
25 target_label: __port_number | |
26 | |
27 # path tweaks | |
28 - if: '{job="victoriametrics",__port_number="8428"}' | |
29 action: replace | |
30 target_label: "__metrics_path__" | |
31 replacement: "/m/metrics" | |
29 | 32 - if: '{job="victorialogs",__port_number="9428"}' |
33 action: replace | |
34 target_label: "__metrics_path__" | |
35 replacement: "/logs/metrics" | |
25 | 36 - if: '{job="video-files",__port_number="8004"}' |
37 action: replace | |
38 target_label: "__metrics_path__" | |
39 replacement: "/video/api/metrics" | |
4
1eb6e6a2b9b6
version control configs finally; use configmaps to present them to VM
drewp@bigasterisk.com
parents:
diff
changeset
|
40 |
9 | 41 # discovery is matching extra ports that don't serve metrics- remove these targets |
38 | 42 - {if: '{job="cert-manager-webhook"}', action: drop} |
43 - {if: '{job="cert-manager", __port_number="9403"}', action: drop} | |
44 - {if: '{job="filesync-syncthing",__port_number="21027"}', action: drop} | |
45 - {if: '{job="filesync-syncthing",__port_number="22000"}', action: drop} | |
46 - {if: '{job="filesync-syncthing",__port_number="8384"}', action: drop} | |
47 - {if: '{job="jsregistry", __port_number="4873"}', action: drop} | |
48 - {if: '{job="kube-dns", __port_number="53"}', action: drop} | |
49 - {if: '{job="kubernetes"}', action: drop} | |
9 | 50 - {if: '{job="mongodb", __port_number="27017"}', action: drop} |
38 | 51 - {if: '{job="mosquitto-ext", __port_number="1883"}', action: drop} |
52 - {if: '{job="net-route-input", __port_number="80"}', action: drop} | |
53 - {if: '{job="photoprism", __port_number="2342"}', action: drop} | |
54 - {if: '{job="pomerium-metrics", __port_number="8080"}', action: drop} | |
55 - {if: '{job="pomerium-metrics", __port_number="8443"}', action: drop} | |
56 - {if: '{job="pomerium-proxy", __port_number="8080"}', action: drop} | |
57 - {if: '{job="pomerium-proxy", __port_number="8443"}', action: drop} | |
58 - {if: '{job="video-files", __port_number="8003"}', action: drop} | |
59 - {if: '{job=~"cm-acme-.*"}', action: drop} | |
50 | 60 - {if: '{job="nvidiagpu-node-feature-discovery-master", __port_number="8080"}', action: drop} |
41
407ee7fbda13
rm double metrics; add alert for too-many-500s
drewp@bigasterisk.com
parents:
39
diff
changeset
|
61 |
407ee7fbda13
rm double metrics; add alert for too-many-500s
drewp@bigasterisk.com
parents:
39
diff
changeset
|
62 # 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
|
63 - {if: '{job="pomerium-metrics"}', action: drop} |
407ee7fbda13
rm double metrics; add alert for too-many-500s
drewp@bigasterisk.com
parents:
39
diff
changeset
|
64 |
407ee7fbda13
rm double metrics; add alert for too-many-500s
drewp@bigasterisk.com
parents:
39
diff
changeset
|
65 |
33 | 66 |
34 | 67 # Assume all 8001/8002 port discoveries are redundant with an nginx proxy |
33 | 68 - {if: '{__port_number="8001"}', action: drop} |
69 - {if: '{__port_number="8002"}', action: drop} | |
19 | 70 |
71 # Needs https. Used by `kubectl top` | |
44 | 72 - {if: '{job="metrics-server", __port_number="443"}', action: drop} |
50 | 73 # Something doesn't work with the scrape, and I don't see why I should care: |
74 - {if: '{job="metrics-server" }', action: drop} | |
75 |