Hi Team,
Is there a way we can drop selective label names when routing alerting to slack, pagerduty etc. In a way, I am trying to find some working examples of Remove func in alertmanager so that while iterating over a range of alert labels, I should be able to drop some pre-defined label names.
I am finding it difficult to dec a list a names and use it with Remove func. I was following this article -
link . I am doing something like this to drop unnecessary labels -
``` {{- range .Labels.SortedPairs -}}
{{- if (and (ne .Name "name1") (ne .Name "name2") ) -}}
• *{{- .Name }}:* `{{- .Value }}`
{{ end -}}
{{- end -}}
{{ end }}
```
Is there a better way to implement this using Remove func in alertmanager.
Thanks,