File tree Expand file tree Collapse file tree 2 files changed +5
-5
lines changed Expand file tree Collapse file tree 2 files changed +5
-5
lines changed Original file line number Diff line number Diff line change @@ -407,9 +407,9 @@ func grafanaLinkForExpression(expr, datasourceUID string) string {
407
407
}
408
408
409
409
marshaledExpression , _ := json .Marshal (exprStruct )
410
- escapedExpression := url .QueryEscape ( string ( marshaledExpression ))
411
- str := `/explore?left= {"queries":[%s]}`
412
- return fmt . Sprintf ( str , escapedExpression )
410
+ params := url.Values {}
411
+ params . Set ( "left" , fmt . Sprintf ( ` {"queries":[%s]}`, marshaledExpression ))
412
+ return `/explore?` + params . Encode ( )
413
413
}
414
414
415
415
// SendAlerts implements a rules.NotifyFunc for a Notifier.
Original file line number Diff line number Diff line change @@ -1733,7 +1733,7 @@ func TestSendAlerts(t *testing.T) {
1733
1733
Annotations : []labels.Label {{Name : "a2" , Value : "v2" }},
1734
1734
StartsAt : time .Unix (2 , 0 ),
1735
1735
EndsAt : time .Unix (3 , 0 ),
1736
- GeneratorURL : fmt .Sprintf ("http://localhost:8080/explore?left={ \" queries \" :[%s]} " , escapedExpression ),
1736
+ GeneratorURL : fmt .Sprintf ("http://localhost:8080/explore?left=%%7B%%22queries%%22%%3A%%5B%s%%5D%%7D " , escapedExpression ),
1737
1737
},
1738
1738
},
1739
1739
},
@@ -1753,7 +1753,7 @@ func TestSendAlerts(t *testing.T) {
1753
1753
Annotations : []labels.Label {{Name : "a2" , Value : "v2" }},
1754
1754
StartsAt : time .Unix (2 , 0 ),
1755
1755
EndsAt : time .Unix (4 , 0 ),
1756
- GeneratorURL : fmt .Sprintf ("http://localhost:8080/explore?left={ \" queries \" :[%s]} " , escapedExpression ),
1756
+ GeneratorURL : fmt .Sprintf ("http://localhost:8080/explore?left=%%7B%%22queries%%22%%3A%%5B%s%%5D%%7D " , escapedExpression ),
1757
1757
},
1758
1758
},
1759
1759
},
You can’t perform that action at this time.
0 commit comments