Bladeren bron

Merge pull request #552 from kubecost/AjayTripathy-reduce-metriclogging

Ajay tripathy reduce metriclogging
Ajay Tripathy 5 jaren geleden
bovenliggende
commit
3c49ff27d2
2 gewijzigde bestanden met toevoegingen van 8 en 8 verwijderingen
  1. 6 6
      pkg/costmodel/metrics.go
  2. 2 2
      pkg/prom/result.go

+ 6 - 6
pkg/costmodel/metrics.go

@@ -600,35 +600,35 @@ func StartCostModelMetricRecording(a *Accesses) bool {
 			}
 			for labelString, seen := range nodeSeen {
 				if !seen {
-					klog.Infof("Removing %s from nodes", labelString)
+					klog.V(4).Infof("Removing %s from nodes", labelString)
 					labels := getLabelStringsFromKey(labelString)
 					ok := a.NodeTotalPriceRecorder.DeleteLabelValues(labels...)
 					if ok {
-						klog.Infof("removed %s from totalprice", labelString)
+						klog.V(4).Infof("removed %s from totalprice", labelString)
 					} else {
 						klog.Infof("FAILURE TO REMOVE %s from totalprice", labelString)
 					}
 					ok = a.NodeSpotRecorder.DeleteLabelValues(labels...)
 					if ok {
-						klog.Infof("removed %s from spot records", labelString)
+						klog.V(4).Infof("removed %s from spot records", labelString)
 					} else {
 						klog.Infof("FAILURE TO REMOVE %s from spot records", labelString)
 					}
 					ok = a.CPUPriceRecorder.DeleteLabelValues(labels...)
 					if ok {
-						klog.Infof("removed %s from cpuprice", labelString)
+						klog.V(4).Infof("removed %s from cpuprice", labelString)
 					} else {
 						klog.Infof("FAILURE TO REMOVE %s from cpuprice", labelString)
 					}
 					ok = a.GPUPriceRecorder.DeleteLabelValues(labels...)
 					if ok {
-						klog.Infof("removed %s from gpuprice", labelString)
+						klog.V(4).Infof("removed %s from gpuprice", labelString)
 					} else {
 						klog.Infof("FAILURE TO REMOVE %s from gpuprice", labelString)
 					}
 					ok = a.RAMPriceRecorder.DeleteLabelValues(labels...)
 					if ok {
-						klog.Infof("removed %s from ramprice", labelString)
+						klog.V(4).Infof("removed %s from ramprice", labelString)
 					} else {
 						klog.Infof("FAILURE TO REMOVE %s from ramprice", labelString)
 					}

+ 2 - 2
pkg/prom/result.go

@@ -143,7 +143,7 @@ func NewQueryResults(query string, queryResult interface{}) *QueryResults {
 				return qrs
 			}
 			if warn != nil {
-				log.Warningf("%s\nQuery: %s\nLabels: %s", warn.Message(), query, labelsForMetric(metricMap))
+				log.DedupedWarningf(5, "%s\nQuery: %s\nLabels: %s", warn.Message(), query, labelsForMetric(metricMap))
 			}
 
 			vectors = append(vectors, v)
@@ -165,7 +165,7 @@ func NewQueryResults(query string, queryResult interface{}) *QueryResults {
 					if labelString == "" {
 						labelString = labelsForMetric(metricMap)
 					}
-					log.Warningf("%s\nQuery: %s\nLabels: %s", warn.Message(), query, labelString)
+					log.DedupedWarningf(5, "%s\nQuery: %s\nLabels: %s", warn.Message(), query, labelString)
 				}
 
 				vectors = append(vectors, v)