Skip to content

Commit

Permalink
fix: Fix loki ruler generator url left parameter url encoding
Browse files Browse the repository at this point in the history
  • Loading branch information
matthewhudsonedb committed Jan 6, 2025
1 parent b2f46de commit cd5f60e
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions pkg/ruler/base/ruler.go
Original file line number Diff line number Diff line change
Expand Up @@ -407,9 +407,9 @@ func grafanaLinkForExpression(expr, datasourceUID string) string {
}

marshaledExpression, _ := json.Marshal(exprStruct)
escapedExpression := url.QueryEscape(string(marshaledExpression))
str := `/explore?left={"queries":[%s]}`
return fmt.Sprintf(str, escapedExpression)
params := url.Values{}
params.Set("left", fmt.Sprintf(`{"queries":[%s]}`, marshaledExpression))
return `/explore?` + params.Encode()
}

// SendAlerts implements a rules.NotifyFunc for a Notifier.
Expand Down

0 comments on commit cd5f60e

Please sign in to comment.