1
0
Fork 0

v-m/scrape: Stable instance label for Longhorn

By default, the `instance` label for discovered metrics targets is set
to the scrape address.  For Kubernetes pods, that is the IP address and
port of the pod, which naturally changes every time the pod is recreated
or moved.  This will cause a high churn rate for Longhorn manager pods.
To avoid this, we set the `instance` label to the name of the node the
pod is running on, which will not change because the Longhorn manager
pods are managed by a DaemonSet.
dch-webhooks-secrets
Dustin 2024-01-04 09:16:20 -06:00
parent ce3bc87f9e
commit 98cdcdfe30
1 changed files with 3 additions and 0 deletions

View File

@ -257,6 +257,9 @@ scrape_configs:
source_labels: source_labels:
- __meta_kubernetes_pod_container_init - __meta_kubernetes_pod_container_init
regex: '^true$' regex: '^true$'
- target_label: instance
source_labels:
- __meta_kubernetes_pod_node_name
- job_name: zincati - job_name: zincati
metrics_path: /bridge?selector=zincati metrics_path: /bridge?selector=zincati