From 49a19b899ccfa864d98c2d5e1ada8236d1967db1 Mon Sep 17 00:00:00 2001 From: Lukasz Mierzwa Date: Thu, 14 Mar 2024 11:32:40 +0000 Subject: [PATCH] Fix preview link --- internal/checks/alerts_count.go | 2 +- internal/checks/alerts_count_test.go | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/internal/checks/alerts_count.go b/internal/checks/alerts_count.go index 925b5636..d566f0dd 100644 --- a/internal/checks/alerts_count.go +++ b/internal/checks/alerts_count.go @@ -118,7 +118,7 @@ func (c AlertsCheck) Check(ctx context.Context, _ string, rule parser.Rule, _ [] Lines: rule.AlertingRule.Expr.Value.Lines, Reporter: c.Reporter(), Text: fmt.Sprintf("%s would trigger %d alert(s) in the last %s.", promText(c.prom.Name(), qr.URI), alerts, output.HumanizeDuration(delta)), - Details: fmt.Sprintf(`To get a preview of the alerts that would fire please [click here](%s/graph?g0.expr=%s&g0.tab=1&g0.range_input=%s).`, + Details: fmt.Sprintf(`To get a preview of the alerts that would fire please [click here](%s/graph?g0.expr=%s&g0.tab=0&g0.range_input=%s).`, qr.PublicURI, url.QueryEscape(rule.AlertingRule.Expr.Value.Value), output.HumanizeDuration(delta), ), Severity: c.severity, diff --git a/internal/checks/alerts_count_test.go b/internal/checks/alerts_count_test.go index dcae2dae..6342616f 100644 --- a/internal/checks/alerts_count_test.go +++ b/internal/checks/alerts_count_test.go @@ -23,7 +23,7 @@ func alertsText(name, uri string, count int, since string) string { func alertsDetails(uri, query, since string) string { return fmt.Sprintf( - `To get a preview of the alerts that would fire please [click here](%s/graph?g0.expr=%s&g0.tab=1&g0.range_input=%s).`, + `To get a preview of the alerts that would fire please [click here](%s/graph?g0.expr=%s&g0.tab=0&g0.range_input=%s).`, uri, url.QueryEscape(query), since, ) }