Explorar el Código

don't throw as many internal errors from prometheus

Alexander Belanger hace 3 años
padre
commit
e0e4bf120f
Se han modificado 1 ficheros con 5 adiciones y 0 borrados
  1. 5 0
      internal/kubernetes/prometheus/metrics.go

+ 5 - 0
internal/kubernetes/prometheus/metrics.go

@@ -211,6 +211,11 @@ func QueryPrometheus(
 	rawQuery, err := resp.DoRaw(context.TODO())
 
 	if err != nil {
+		// in this case, it's very likely that prometheus doesn't contain any data for the given labels
+		if strings.Contains(err.Error(), "rejected our request for an unknown reason") {
+			return []*promParsedSingletonQuery{}, nil
+		}
+
 		return nil, err
 	}