Skip to content

Commit

Permalink
Merge pull request kubesphere#4711 from junotx/proc-monitor
Browse files Browse the repository at this point in the history
add container processes/threads metrics
  • Loading branch information
ks-ci-bot authored Mar 7, 2022
2 parents 19048d5 + b205529 commit 7281996
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 0 deletions.
2 changes: 2 additions & 0 deletions pkg/models/monitoring/named_metrics.go
Original file line number Diff line number Diff line change
Expand Up @@ -264,6 +264,8 @@ var ContainerMetrics = []string{
"container_cpu_usage",
"container_memory_usage",
"container_memory_usage_wo_cache",
"container_processes_usage",
"container_threads_usage",
}

var PVCMetrics = []string{
Expand Down
2 changes: 2 additions & 0 deletions pkg/simple/client/monitoring/prometheus/promql.go
Original file line number Diff line number Diff line change
Expand Up @@ -214,6 +214,8 @@ var promQLTemplates = map[string]string{
"container_cpu_usage": `round(sum by (namespace, pod, container) (irate(container_cpu_usage_seconds_total{job="kubelet", container!="POD", container!="", image!="", $1}[5m])), 0.001)`,
"container_memory_usage": `sum by (namespace, pod, container) (container_memory_usage_bytes{job="kubelet", container!="POD", container!="", image!="", $1})`,
"container_memory_usage_wo_cache": `sum by (namespace, pod, container) (container_memory_working_set_bytes{job="kubelet", container!="POD", container!="", image!="", $1})`,
"container_processes_usage": `sum by (namespace, pod, container) (container_processes{job="kubelet", container!="POD", container!="", image!="", $1})`,
"container_threads_usage": `sum by (namespace, pod, container) (container_threads {job="kubelet", container!="POD", container!="", image!="", $1})`,

// pvc
"pvc_inodes_available": `max by (namespace, persistentvolumeclaim) (kubelet_volume_stats_inodes_free) * on (namespace, persistentvolumeclaim) group_left (storageclass) kube_persistentvolumeclaim_info{$1}`,
Expand Down

0 comments on commit 7281996

Please sign in to comment.