Skip to content

Commit

Permalink
Fix preview link
Browse files Browse the repository at this point in the history
  • Loading branch information
prymitive committed Mar 14, 2024
1 parent f93589c commit 49a19b8
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion internal/checks/alerts_count.go
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
2 changes: 1 addition & 1 deletion internal/checks/alerts_count_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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,
)
}
Expand Down

0 comments on commit 49a19b8

Please sign in to comment.