diff --git a/promql/printer.go b/promql/printer.go index 5b4d1070e..35b40b00e 100644 --- a/promql/printer.go +++ b/promql/printer.go @@ -107,7 +107,7 @@ func (node *AlertStmt) String() string { s += fmt.Sprintf("\n\tFOR %s", strutil.DurationToString(node.Duration)) } if len(node.Labels) > 0 { - s += fmt.Sprintf("\n\tWITH %s", node.Labels) + s += fmt.Sprintf("\n\tLABELS %s", node.Labels) } if len(node.Annotations) > 0 { s += fmt.Sprintf("\n\tANNOTATIONS %s", node.Labels) diff --git a/rules/alerting.go b/rules/alerting.go index cb89b8b1a..127c922a1 100644 --- a/rules/alerting.go +++ b/rules/alerting.go @@ -258,7 +258,7 @@ func (rule *AlertingRule) String() string { s += fmt.Sprintf("\n\tFOR %s", strutil.DurationToString(rule.holdDuration)) } if len(rule.labels) > 0 { - s += fmt.Sprintf("\n\tWITH %s", rule.labels) + s += fmt.Sprintf("\n\tLABELS %s", rule.labels) } if len(rule.annotations) > 0 { s += fmt.Sprintf("\n\tANNOTATIONS %s", rule.annotations) @@ -280,7 +280,7 @@ func (rule *AlertingRule) HTMLSnippet(pathPrefix string) template.HTML { s += fmt.Sprintf("\n FOR %s", strutil.DurationToString(rule.holdDuration)) } if len(rule.labels) > 0 { - s += fmt.Sprintf("\n WITH %s", rule.labels) + s += fmt.Sprintf("\n LABELS %s", rule.labels) } if len(rule.annotations) > 0 { s += fmt.Sprintf("\n ANNOTATIONS %s", rule.annotations)