[monitoring] Add whitelist for labels in cadvisor/kubelet metrics
This patch introduces a whitelist-based label filtering mechanism in cadvisor/kubelet metrics collection. By explicitly keeping only the desired labels, we avoid noisy and high-cardinality dimensions while retaining meaningful CPU metrics for analysis. This improves the stability of the metrics pipeline and ensures consistent visibility into application workloads. ```release-note [monitoring] Introduce whitelist label filtering for cadvisor/kubelet metrics to reduce noise and improve CPU metric reliability. ```
This commit is contained in:
commit
4e618adf0a
2 changed files with 6 additions and 12 deletions
|
|
@ -19,10 +19,8 @@ spec:
|
|||
- __name__
|
||||
path: /metrics/cadvisor
|
||||
relabelConfigs:
|
||||
- action: labelmap
|
||||
regex: __meta_kubernetes_node_label_(.+)
|
||||
- action: labeldrop
|
||||
regex: '.*node_kubevirt_io.*'
|
||||
- action: labelkeep
|
||||
regex: "__address__|instance|__scheme__|__scrape_timeout__|__scrape_interval__|metrics_path|node|job|__metrics_path__"
|
||||
- sourceLabels: [__metrics_path__]
|
||||
targetLabel: metrics_path
|
||||
- replacement: cadvisor
|
||||
|
|
|
|||
|
|
@ -19,10 +19,8 @@ spec:
|
|||
- __name__
|
||||
path: /metrics/probes
|
||||
relabelConfigs:
|
||||
- action: labelmap
|
||||
regex: __meta_kubernetes_node_label_(.+)
|
||||
- action: labeldrop
|
||||
regex: '.*node_kubevirt_io.*'
|
||||
- action: labelkeep
|
||||
regex: "__address__|instance|__scheme__|__scrape_timeout__|__scrape_interval__|metrics_path|node|job|__metrics_path__|container|pod|namespace"
|
||||
- sourceLabels: [__metrics_path__]
|
||||
targetLabel: metrics_path
|
||||
- replacement: kubelet
|
||||
|
|
@ -51,10 +49,8 @@ spec:
|
|||
regex: (rest_client_request_duration_seconds_bucket|rest_client_request_duration_seconds_sum|rest_client_request_duration_seconds_count)
|
||||
source_labels: [__name__]
|
||||
relabelConfigs:
|
||||
- action: labelmap
|
||||
regex: __meta_kubernetes_node_label_(.+)
|
||||
- action: labeldrop
|
||||
regex: '.*node_kubevirt_io.*'
|
||||
- action: labelkeep
|
||||
regex: "__address__|instance|__scheme__|__scrape_timeout__|__scrape_interval__|metrics_path|node|job|__metrics_path__|container|pod|namespace"
|
||||
- sourceLabels:
|
||||
- __metrics_path__
|
||||
targetLabel: metrics_path
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue