Skip to content

Commit

Permalink
change: use continue for ccms.loadStats errors
Browse files Browse the repository at this point in the history
  • Loading branch information
spacehamster87 committed Aug 31, 2023
1 parent 6479651 commit cffdd05
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions internal/metricdata/cc-metric-store.go
Original file line number Diff line number Diff line change
Expand Up @@ -533,7 +533,9 @@ func (ccms *CCMetricStore) LoadStats(
metric := ccms.toLocalName(query.Metric)
data := res[0]
if data.Error != nil {
return nil, fmt.Errorf("METRICDATA/CCMS > fetching %s for node %s failed: %s", metric, query.Hostname, *data.Error)
log.Infof("fetching %s for node %s failed: %s", metric, query.Hostname, *data.Error)
continue
// return nil, fmt.Errorf("METRICDATA/CCMS > fetching %s for node %s failed: %s", metric, query.Hostname, *data.Error)
}

metricdata, ok := stats[metric]
Expand All @@ -543,7 +545,9 @@ func (ccms *CCMetricStore) LoadStats(
}

if data.Avg.IsNaN() || data.Min.IsNaN() || data.Max.IsNaN() {
return nil, fmt.Errorf("METRICDATA/CCMS > fetching %s for node %s failed: %s", metric, query.Hostname, "avg/min/max is NaN")
log.Infof("fetching %s for node %s failed: one of avg/min/max is NaN", metric, query.Hostname)
continue
// return nil, fmt.Errorf("METRICDATA/CCMS > fetching %s for node %s failed: %s", metric, query.Hostname, "avg/min/max is NaN")
}

metricdata[query.Hostname] = schema.MetricStatistics{
Expand Down

0 comments on commit cffdd05

Please sign in to comment.