From 249c5b013ebd7a286b82cf20a4fd92e927659ccf Mon Sep 17 00:00:00 2001 From: "Grot (@grafanabot)" <43478413+grafanabot@users.noreply.github.com> Date: Tue, 21 Feb 2023 17:15:55 +0100 Subject: [PATCH] [v9.4.x] Alerting: Fix incorrect comment in eval.go (#63513) Alerting: Fix incorrect comment in eval.go (#63510) This commit fixes an incorrect comment in the Result struct in eval.go that I had written some time ago. The comment now documents the actual behaviour and content of this field. (cherry picked from commit f93a9c794d1c498eff107debe04a3333e3145796) Co-authored-by: George Robinson --- pkg/services/ngalert/eval/eval.go | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/pkg/services/ngalert/eval/eval.go b/pkg/services/ngalert/eval/eval.go index f4f7d6733f4..ea6d2e9e1f9 100644 --- a/pkg/services/ngalert/eval/eval.go +++ b/pkg/services/ngalert/eval/eval.go @@ -163,9 +163,10 @@ type Result struct { // Results contains the results of all queries, reduce and math expressions Results map[string]data.Frames - // Values contains the RefID and value of reduce and math expressions. - // It does not contain values for classic conditions as the values - // in classic conditions do not have a RefID. + // Values contains the labels and values for all Threshold, Reduce and Math expressions, + // and all conditions of a Classic Condition that are firing. Threshold, Reduce and Math + // expressions are indexed by their Ref ID, while conditions in a Classic Condition are + // indexed by their Ref ID and the index of the condition. For example, B0, B1, etc. Values map[string]NumberValueCapture EvaluatedAt time.Time