Skip to content

Commit

Permalink
Merge pull request #7765 from omerap12/fix-metricsClient-logs
Browse files Browse the repository at this point in the history
chore: fix metricsClient logs
  • Loading branch information
k8s-ci-robot authored Jan 31, 2025
2 parents 29b611d + c50040a commit bd15f93
Showing 1 changed file with 6 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,12 @@ func (c *metricsClient) GetContainersMetrics() ([]*ContainerMetricsSnapshot, err
if err != nil {
return nil, err
}
klog.V(3).InfoS("podMetrics retrieved for all namespaces", "podMetrics", len(podMetricsList.Items))
if c.namespace == k8sapiv1.NamespaceAll {
klog.V(3).InfoS("podMetrics retrieved for all namespaces", "podMetrics", len(podMetricsList.Items))
} else {
klog.V(3).InfoS("podMetrics retrieved", "namespace", c.namespace, "podMetrics", len(podMetricsList.Items))
}

for _, podMetrics := range podMetricsList.Items {
metricsSnapshotsForPod := createContainerMetricsSnapshots(podMetrics)
metricsSnapshots = append(metricsSnapshots, metricsSnapshotsForPod...)
Expand Down

0 comments on commit bd15f93

Please sign in to comment.