diff --git a/jsonnet/kube-prometheus/kube-prometheus-insecure-kubelet.libsonnet b/jsonnet/kube-prometheus/kube-prometheus-insecure-kubelet.libsonnet index 9fd74a96342d500b92b86adf962ccd8aaccf7a54..4ac6773f10f81f0544212ba73eb21c5722a20a3a 100644 --- a/jsonnet/kube-prometheus/kube-prometheus-insecure-kubelet.libsonnet +++ b/jsonnet/kube-prometheus/kube-prometheus-insecure-kubelet.libsonnet @@ -37,7 +37,9 @@ action: 'drop', regex: '(' + std.join('|', [ + 'container_fs_.*', // add filesystem read/write data (nodes*disks*services*4) 'container_spec_.*', // everything related to cgroup specification and thus static data (nodes*services*5) + 'container_blkio_device_usage_total', // useful for containers, but not for system services (nodes*disks*services*operations*2) 'container_file_descriptors', // file descriptors limits and global numbers are exposed via (nodes*services) 'container_sockets', // used sockets in cgroup. Usually not important for system services (nodes*services) 'container_threads_max', // max number of threads in cgroup. Usually for system services it is not limited (nodes*services) @@ -46,14 +48,6 @@ 'container_last_seen', // not needed as system services are always running (nodes*services) ]) + ');;', }, - { - sourceLabels: ['__name__', 'container'], - action: 'drop', - regex: '(' + std.join('|', - [ - 'container_blkio_device_usage_total', - ]) + ');.+', - }, ], }, ], diff --git a/jsonnet/kube-prometheus/prometheus/prometheus.libsonnet b/jsonnet/kube-prometheus/prometheus/prometheus.libsonnet index 5f077aa3541e0b90f384d5bb97943fcb62630aa7..27b2e1f972752b8e6b1a9973bb8161b7c48587d4 100644 --- a/jsonnet/kube-prometheus/prometheus/prometheus.libsonnet +++ b/jsonnet/kube-prometheus/prometheus/prometheus.libsonnet @@ -328,7 +328,9 @@ local relabelings = import 'kube-prometheus/dropping-deprecated-metrics-relabeli action: 'drop', regex: '(' + std.join('|', [ + 'container_fs_.*', // add filesystem read/write data (nodes*disks*services*4) 'container_spec_.*', // everything related to cgroup specification and thus static data (nodes*services*5) + 'container_blkio_device_usage_total', // useful for containers, but not for system services (nodes*disks*services*operations*2) 'container_file_descriptors', // file descriptors limits and global numbers are exposed via (nodes*services) 'container_sockets', // used sockets in cgroup. Usually not important for system services (nodes*services) 'container_threads_max', // max number of threads in cgroup. Usually for system services it is not limited (nodes*services) @@ -337,14 +339,6 @@ local relabelings = import 'kube-prometheus/dropping-deprecated-metrics-relabeli 'container_last_seen', // not needed as system services are always running (nodes*services) ]) + ');;', }, - { - sourceLabels: ['__name__', 'container'], - action: 'drop', - regex: '(' + std.join('|', - [ - 'container_blkio_device_usage_total', - ]) + ');.+', - }, ], }, { diff --git a/manifests/prometheus-serviceMonitorKubelet.yaml b/manifests/prometheus-serviceMonitorKubelet.yaml index ab96d5b1780e5dffe07d63c5ee72da201f790804..b52725320542dc7dc35e5e880d9ff0f45bb641ec 100644 --- a/manifests/prometheus-serviceMonitorKubelet.yaml +++ b/manifests/prometheus-serviceMonitorKubelet.yaml @@ -61,16 +61,11 @@ spec: sourceLabels: - __name__ - action: drop - regex: (container_spec_.*|container_file_descriptors|container_sockets|container_threads_max|container_threads|container_start_time_seconds|container_last_seen);; + regex: (container_fs_.*|container_spec_.*|container_blkio_device_usage_total|container_file_descriptors|container_sockets|container_threads_max|container_threads|container_start_time_seconds|container_last_seen);; sourceLabels: - __name__ - pod - namespace - - action: drop - regex: (container_blkio_device_usage_total);.+ - sourceLabels: - - __name__ - - container path: /metrics/cadvisor port: https-metrics relabelings: