Skip to content

Commit

Permalink
fix
Browse files Browse the repository at this point in the history
Signed-off-by: forsaken628 <[email protected]>
  • Loading branch information
forsaken628 committed Jun 18, 2024
1 parent 2a79c3d commit 6f83d32
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions cmd/metricscollector/v1beta1/file-metricscollector/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -210,7 +210,10 @@ func watchMetricsFile(mFile string, stopRules stopRulesFlag, filters []string, f
if metricName != name {
continue
}
rules.UpdateMetric(name, metricValue)
err = rules.UpdateMetric(name, metricValue)
if err != nil {
klog.Fatalf("Unable to UpdateMetric %s %v", name, err)
}
}
}
}
Expand All @@ -230,7 +233,10 @@ func watchMetricsFile(mFile string, stopRules stopRulesFlag, filters []string, f
if err != nil {
klog.Fatalf("Unable to parse value %v to float for metric %v", metricValue, name)
}
rules.UpdateMetric(name, metricValue)
err = rules.UpdateMetric(name, metricValue)
if err != nil {
klog.Fatalf("Unable to UpdateMetric %s %v", name, err)
}
}
default:
klog.Fatalf("Format must be set to %v or %v", commonv1beta1.TextFormat, commonv1beta1.JsonFormat)
Expand Down

0 comments on commit 6f83d32

Please sign in to comment.