-
Notifications
You must be signed in to change notification settings - Fork 349
Pause containers do not have "io.kubernetes.container.name" set to "POD" #922
Comments
We use something else for containerd pod network stats in cadvisor: https://github.com/google/cadvisor/blob/master/container/containerd/handler.go#L166. The As for in containerd whether we should have it, I'm leaning to not adding unnecessary labels. But if we really need it, we can add it. Is it easy to support containerd without the container name label on pause container in datadog? If yes, can we keep this issue open to collect more feedback? If there are many people already rely on this, we'll have to support it anyway. @yujuhong Any opinion about this? |
Yes, as @Random-Liu said, kubelet does not set this label. We set it in dockershim for backward-compatibility reason during transition. In principle, the namespace of the label key (`io.kubernetes.container.name) is owned by kubelet, and runtime should not use it at all. If the monitoring agents rely on these labels heavily (regardless whether that's the best practice or not), we can consider letting kubelet apply a label to PodSandboxes so that it will be consistent across CRI implementations. The label key will likely not to be |
Thank you for your quick answers In our case, we noticed it because pod level metrics on the kubelet
When with other runtimes we had:
It definitely makes sense for the container_name label to be empty in that case but we were surprised by the different behavior. We already have a fix for the Datadog agent: instead of only identifying pod-level metrics by testing for |
@lbernail Thanks a lot for reporting this! If you already have a fix, let's keep the issue open and see whether there are other people need this behavior. If there are many, let's add it. If not, I prefer not adding it for now, because it is a legacy thing that we want to get rid of gradually. |
These metrics are typically very low because the "pause" container is a piece of Kubernetes internals that sits and does nothing. Filtering them out of the display aids readability. Note in some Kubernetes installations the pause container is labled "POD", which was previously filtered out from the dashboard. See containerd/cri#922 for background on the name.
* Add container name to operational dashboard Memory and CPU metrics are reported per cgroup, so pods with more than one container have several lines. This change allows them to be distinguished. * Filter out 'pause' container from operational dashboard These metrics are typically very low because the "pause" container is a piece of Kubernetes internals that sits and does nothing. Filtering them out of the display aids readability. Note in some Kubernetes installations the pause container is labled "POD", which was previously filtered out from the dashboard. See containerd/cri#922 for background on the name. * Update CHANGELOG Co-authored-by: Joe Elliott <joe.elliott@grafana.com>
Hello
I'm not sure if this is really an issue but pause containers do not have an "io.kubernetes.container.name" label
For other runtimes (I checked for docker and crio) this label is set to "POD" and this appears in the kubelet cadvisor metrics for pod level metrics (network in particular).
Looks like we could add this label to
sandboxLabels
inRunPodSandbox
What do you think?
The text was updated successfully, but these errors were encountered: