Skip to content

Commit

Permalink
fixed record rules without cluster lable
Browse files Browse the repository at this point in the history
Signed-off-by: frezes <zhangjunhao@kubesphere.io>
  • Loading branch information
frezes committed Jan 13, 2023
1 parent 05ca993 commit 730c23a
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions rules/apps.libsonnet
Original file line number Diff line number Diff line change
Expand Up @@ -26,35 +26,35 @@
record: 'node_namespace_pod_container:container_memory_working_set_bytes',
expr: |||
container_memory_working_set_bytes{%(cadvisorSelector)s, image!=""}
* on (namespace, pod) group_left(node) topk by(namespace, pod) (1,
max by(namespace, pod, node) (kube_pod_info{node!=""})
* on (%(clusterLabel)s, namespace, pod) group_left(node) topk by(%(clusterLabel)s, namespace, pod) (1,
max by(%(clusterLabel)s, namespace, pod, node) (kube_pod_info{node!=""})
)
||| % $._config,
},
{
record: 'node_namespace_pod_container:container_memory_rss',
expr: |||
container_memory_rss{%(cadvisorSelector)s, image!=""}
* on (namespace, pod) group_left(node) topk by(namespace, pod) (1,
max by(namespace, pod, node) (kube_pod_info{node!=""})
* on (%(clusterLabel)s, namespace, pod) group_left(node) topk by(%(clusterLabel)s, namespace, pod) (1,
max by(%(clusterLabel)s, namespace, pod, node) (kube_pod_info{node!=""})
)
||| % $._config,
},
{
record: 'node_namespace_pod_container:container_memory_cache',
expr: |||
container_memory_cache{%(cadvisorSelector)s, image!=""}
* on (namespace, pod) group_left(node) topk by(namespace, pod) (1,
max by(namespace, pod, node) (kube_pod_info{node!=""})
* on (%(clusterLabel)s, namespace, pod) group_left(node) topk by(%(clusterLabel)s, namespace, pod) (1,
max by(%(clusterLabel)s, namespace, pod, node) (kube_pod_info{node!=""})
)
||| % $._config,
},
{
record: 'node_namespace_pod_container:container_memory_swap',
expr: |||
container_memory_swap{%(cadvisorSelector)s, image!=""}
* on (namespace, pod) group_left(node) topk by(namespace, pod) (1,
max by(namespace, pod, node) (kube_pod_info{node!=""})
* on (%(clusterLabel)s, namespace, pod) group_left(node) topk by(%(clusterLabel)s, namespace, pod) (1,
max by(%(clusterLabel)s, namespace, pod, node) (kube_pod_info{node!=""})
)
||| % $._config,
},
Expand Down

0 comments on commit 730c23a

Please sign in to comment.