Skip to content

Commit

Permalink
cadvisor: Move log location because empty label is expected
Browse files Browse the repository at this point in the history
With proper sock mounting, some path still got empty label and we should
not generate warning error message.
  • Loading branch information
pingleig committed Mar 24, 2021
1 parent d1838da commit c4319e0
Showing 1 changed file with 4 additions and 5 deletions.
9 changes: 4 additions & 5 deletions plugins/inputs/cadvisor/container_info_processor.go
Original file line number Diff line number Diff line change
Expand Up @@ -67,9 +67,11 @@ func processContainers(cInfos []*cinfo.ContainerInfo, detailMode bool, container
metrics = append(metrics, processPod(cInfo, podKeys)...)
}
}
// This happens when our cgroup path based pod detection logic is not working.
// This happens when our cgroup path and label based pod detection logic is not working.
// contained https://github.com/aws/amazon-cloudwatch-agent/issues/188
// docker systemd https://github.com/aws/amazon-cloudwatch-agent/pull/171
if len(metrics) == beforePod {
log.Printf("W! No pod metric collected, metrics count is still %d", beforePod)
log.Printf("W! No pod metric collected, metrics count is still %d is containerd socket mounted? https://github.com/aws/amazon-cloudwatch-agent/issues/188", beforePod)
}

metrics = mergeMetrics(metrics)
Expand Down Expand Up @@ -99,9 +101,6 @@ func processContainer(info *cinfo.ContainerInfo, detailMode bool, containerOrche
return result, pKey
}

if len(info.Spec.Labels) == 0 {
log.Printf("W! no label found from container spec, is containerd socket mounted? https://github.com/aws/amazon-cloudwatch-agent/issues/188")
}
// Only a container has all these three labels set.
containerName := info.Spec.Labels[containerNameLable]
namespace := info.Spec.Labels[namespaceLable]
Expand Down

0 comments on commit c4319e0

Please sign in to comment.