Skip to content

Commit d6d267d

Browse files
committed
logging: refine logging level in pod resources scanner
Since not all pods may have resource limits defined, adjust the frequency of less valuable events. These are often more useful during debugging than in regular operation. Signed-off-by: Feruzjon Muyassarov <[email protected]>
1 parent 02a3ec0 commit d6d267d

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

pkg/resourcemonitor/podresourcesscanner.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -134,7 +134,7 @@ func (resMon *PodResourcesScanner) Scan() (ScanResponse, error) {
134134
if err != nil {
135135
klog.ErrorS(err, "failed to calculate fingerprint")
136136
} else {
137-
klog.InfoS("podFingerprint calculated", "status", status.Repr())
137+
klog.V(1).InfoS("podFingerprint calculated", "status", status.Repr())
138138

139139
retVal.Attributes = append(retVal.Attributes, v1alpha2.AttributeInfo{
140140
Name: podfingerprint.Attribute,
@@ -145,7 +145,7 @@ func (resMon *PodResourcesScanner) Scan() (ScanResponse, error) {
145145
var podResData []PodResources
146146

147147
for _, podResource := range respPodResources {
148-
klog.InfoS("scanning pod", "podName", podResource.GetName())
148+
klog.V(1).InfoS("scanning pod", "podName", podResource.GetName())
149149
hasDevice := hasDevice(podResource)
150150
isWatchable, isIntegralGuaranteed, err := resMon.isWatchable(podResource.GetNamespace(), podResource.GetName(), hasDevice)
151151
if err != nil {
@@ -228,7 +228,7 @@ func hasDevice(podResource *podresourcesapi.PodResources) bool {
228228
return true
229229
}
230230
}
231-
klog.InfoS("pod doesn't have devices", "podName", podResource.GetName())
231+
klog.V(1).InfoS("pod doesn't have devices", "podName", podResource.GetName())
232232
return false
233233
}
234234

0 commit comments

Comments
 (0)