You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
What did you do?
We added a "silence" link to the pagerduty "details" map for convenience so that users don't have to click through to alertmanager and then re-find the alert they care about and then click the silence button. This uses the go function urlQuery which will become important later.
pagerduty:
details:
silence: |-
https://alertmanager.at.mongodb.com/#/silences/new?filter=%7B
{{- $first := true }}
{{- with index .Alerts 0 -}}
{{- range .Labels.SortedPairs -}}
{{- if $first }}{{ $first = false }}{{ else }},{{ end -}}
{{ .Name | urlquery }}%3D%22{{.Value | urlquery }}%22
{{- end }}
{{- end -}}%7D
What did you expect to see?
We expect the alerts to match existing alerts that are firing. This works in the vast majority of cases, but increasingly our users are using spaces in their alertnames
What did you see instead? Under which circumstances?
We see alertnames with pluses in them, which does not match any of the firing alerts since the firing alerts have spaces.
Why did you see this?
elm is very opinionated about it. And go templates just happen to use plusses instead of %20
I just copied the solution from here since it's been a while since
using functional languages and I didn't know the order of the parser,
but I suspect there are much better places to put this, including
repacing in rest var above
What did you do?
We added a "silence" link to the pagerduty "details" map for convenience so that users don't have to click through to alertmanager and then re-find the alert they care about and then click the silence button. This uses the go function urlQuery which will become important later.
What did you expect to see?
We expect the alerts to match existing alerts that are firing. This works in the vast majority of cases, but increasingly our users are using spaces in their alertnames
What did you see instead? Under which circumstances?
We see alertnames with pluses in them, which does not match any of the firing alerts since the firing alerts have spaces.
Why did you see this?
elm is very opinionated about it. And go templates just happen to use plusses instead of %20
elm/url#32
Where is the patch?
#3945
I just copied the solution from here since it's been a while since
using functional languages and I didn't know the order of the parser,
but I suspect there are much better places to put this, including
repacing in
rest
var aboveelm/url#32 (comment)
Environment
System information:
Alertmanager version:
Fails with later versions as well
Version Information
Branch:
HEAD
BuildDate:
20240228-11:51:20
BuildUser:
root@22cd11f671e9
GoVersion:
go1.21.7
Revision:
0aa3c2a
Version:
0.27.0
victoria metrics
The text was updated successfully, but these errors were encountered: