diff --git a/main.go b/main.go index 21e57ed..523f3fb 100644 --- a/main.go +++ b/main.go @@ -5,6 +5,7 @@ import ( "errors" "fmt" "log" + "math" "net/url" "os" "strings" @@ -138,6 +139,13 @@ func retrieveMetrics(event cloudevents.Event) error { Success: false, Message: err.Error(), }) + } else if math.IsNaN(sliValue) { + sliResults = append(sliResults, &keptnevents.SLIResult{ + Metric: indicator, + Value: 0, + Success: false, + Message: "SLI value is NaN", + }) } else { sliResults = append(sliResults, &keptnevents.SLIResult{ Metric: indicator,