I have read through a bunch of guides showing how to monitor cpu and memory usage of pods in Kubernetes with Prometheus and most of them look something like this:
rate(container_cpu_usage_seconds_total{pod=~"compute-.*", image!="", container!="POD"}[5m])
but I can't find any documentation on why the container label is there (it seems like it causes duplicated data) and why it is being avoided in many monitoring examples. I know that this metric comes from the cadvisor component of Kubernetes, but the only docs I can find on these metrics are the short descriptions provided in the code here.
Does anyone know what this label is for and where there are more in depth documentation no these metrics?