Skip to content

Commit

Permalink
add cluster:node_cpu:ratio_rate5m
Browse files Browse the repository at this point in the history
  • Loading branch information
dougbrad committed Aug 3, 2022
1 parent da75fe8 commit 29c7ad9
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 12 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -185,6 +185,10 @@
{
"record": ":node_memory_MemAvailable_bytes:sum",
"expression": "sum( node_memory_MemAvailable_bytes{job=\"node\"} or ( node_memory_Buffers_bytes{job=\"node\"} + node_memory_Cached_bytes{job=\"node\"} + node_memory_MemFree_bytes{job=\"node\"} + node_memory_Slab_bytes{job=\"node\"} )) by (cluster)"
},
{
"record": "cluster:node_cpu:ratio_rate5m",
"expression": "sum(rate(node_cpu_seconds_total{job=\"node\",mode!=\"idle\",mode!=\"iowait\",mode!=\"steal\"}[5m])) by (cluster) /count(sum(node_cpu_seconds_total{job=\"node\"}) by (cluster, instance, cpu)) by (cluster)"
}
]

Expand Down
15 changes: 5 additions & 10 deletions GeneratedMonitoringArtifacts/DefaultRecordingRulesList.txt
Original file line number Diff line number Diff line change
@@ -1,10 +1,14 @@
# Below are the default Recording Rules for Linux
# One of these has 4 actuall RR's (for different workload types)
# So count is below = 3 - currently 30
namespace_workload_pod:kube_pod_owner:relabel
node_namespace_pod_container:container_cpu_usage_seconds_total:sum_irate
namespace_cpu:kube_pod_container_resource_requests:sum
namespace_cpu:kube_pod_container_resource_limits:sum
:node_memory_MemAvailable_bytes:sum
namespace_memory:kube_pod_container_resource_requests:sum
namespace_memory:kube_pod_container_resource_limits:sum
cluster:node_cpu:ratio_rate5m
cluster:namespace:pod_cpu:active:kube_pod_container_resource_requests
cluster:namespace:pod_cpu:active:kube_pod_container_resource_limits
cluster:namespace:pod_memory:active:kube_pod_container_resource_requests
Expand All @@ -23,13 +27,4 @@ instance_device:node_disk_io_time_weighted_seconds:rate5m
node_namespace_pod_container:container_memory_working_set_bytes
node_namespace_pod_container:container_memory_rss
node_namespace_pod_container:container_memory_cache
node_namespace_pod_container:container_memory_swap
node:windows_node_cpu_utilisation:avg3m
node:windows_node_memory_utilisation:
node:windows_node_memory_totalCached_bytes:sum
node:windows_node_memory_swap_io_pages:irate
node:windows_node_disk_utilisation:avg_irate
node:windows_node_net_utilisation:sum_irate
node:windows_node_net_saturation:sum_irate
node:windows_node_filesystem_usage: .
namespace_pod_container:windows_container_cpu_usage_seconds_total:sum_rate
node_namespace_pod_container:container_memory_swap
4 changes: 2 additions & 2 deletions mixins/kubernetes/rules/node.libsonnet
Original file line number Diff line number Diff line change
Expand Up @@ -56,8 +56,8 @@
// This rule gives cpu utilization per cluster
record: 'cluster:node_cpu:ratio_rate5m',
expr: |||
sum(rate(node_cpu_seconds_total{%(nodeExporterSelector)s,mode!="idle",mode!="iowait",mode!="steal"}[5m])) /
count(sum(node_cpu_seconds_total{%(nodeExporterSelector)s}) by (%(clusterLabel)s, instance, cpu))
sum(rate(node_cpu_seconds_total{%(nodeExporterSelector)s,mode!="idle",mode!="iowait",mode!="steal"}[5m])) by (%(clusterLabel)s) /
count(sum(node_cpu_seconds_total{%(nodeExporterSelector)s}) by (%(clusterLabel)s, instance, cpu)) by (%(clusterLabel)s)
||| % $._config,
},
],
Expand Down

0 comments on commit 29c7ad9

Please sign in to comment.