5.1 Tasks: kube-prometheus metrics
Task 5.1.1: Memory usage of Prometheus
Task description:
- Display the memory usage of both Prometheus pods
- Use a filter to just display metrics from your
prometheuscontainers
Note
Search for a metric withmemory_working_set in its nameHints
container_memory_working_set_bytes{namespace="<user>-monitoring", pod=~"prometheus-prometheus-.*", container="prometheus"}
Task 5.1.2: Kubernetes pod count
Task description:
- Display how many pods are currently running on your Kubernetes platform
Hints
There are different ways to archive this. You can for example query all running containers and group them by pod and namespace.
count(sum(kube_pod_container_status_running == 1) by (pod,namespace,cluster))
You may also sum() all running pods on your Kubernetes nodes
sum(kubelet_running_pods)
Note
The result counts only the pods on the clusters that you actually use. Therefore, this number may be different for each monitoring stack. There may be a minor discrepancy between the two options, as the platform is constantly changing and different jobs query the targets at different times.