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
parent
ce3bc87f9e
commit
98cdcdfe30
|
@ -257,6 +257,9 @@ scrape_configs:
|
|||
source_labels:
|
||||
- __meta_kubernetes_pod_container_init
|
||||
regex: '^true$'
|
||||
- target_label: instance
|
||||
source_labels:
|
||||
- __meta_kubernetes_pod_node_name
|
||||
|
||||
- job_name: zincati
|
||||
metrics_path: /bridge?selector=zincati
|
||||
|
|
Loading…
Reference in New Issue