diff --git a/pkg/services/ngalert/writer/prom.go b/pkg/services/ngalert/writer/prom.go index 654eca9bf93..ea46b816125 100644 --- a/pkg/services/ngalert/writer/prom.go +++ b/pkg/services/ngalert/writer/prom.go @@ -66,9 +66,15 @@ func PointsFromFrames(name string, t time.Time, frames data.Frames, extraLabels points := make([]Point, 0, len(col.Refs)) for _, ref := range col.Refs { - fp, empty, _ := ref.NullableFloat64Value() - if empty || fp == nil { - return nil, fmt.Errorf("unable to read float64 value") + fp, empty, err := ref.NullableFloat64Value() + if err != nil { + return nil, fmt.Errorf("unable to read float64 value: %w", err) + } + if empty { + return nil, fmt.Errorf("empty frame") + } + if fp == nil { + return nil, fmt.Errorf("nil frame") } metric := Metric{