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 
<https://grafana.com/blog/2020/02/25/step-by-step-guide-to-setting-up-prometheus-alertmanager-with-slack-pagerduty-and-gmail/>
 
. 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,

-- 
You received this message because you are subscribed to the Google Groups 
"Prometheus Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/prometheus-users/15779d81-d6fa-4247-8a0d-0dda24c34425n%40googlegroups.com.

Reply via email to