mirror of
https://github.com/outbackdingo/cozystack.git
synced 2026-01-27 18:18:41 +00:00
[platform] 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 [platform] Introduce whitelist label filtering for cadvisor/kubelet metrics to reduce noise and improve CPU metric reliability. ``` Signed-off-by: IvanHunters <xorokhotnikov@gmail.com>
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user