How to delete alert labels

Hi,

How can i delete these Alert Labels

I don’t want these labels in my alert-email

Thanks in advance

Hello! Possible solution for you: Reducing alert labels

1 Like

Hi @ykarayildiz1140 @ylpetrova, can I ask which version of grafana can have those default preset labels? Or what configuration do I need to modify?

I’m using grafana 9.0.1 and prometheus as data source, and it has no labels other than the alertname.

What I want is to leverage all/any labels of the metric in the alert, do you know how we can do that?

Hello! Pls, show your query.

Hi @lsh,

Please show your query

@ykarayildiz1140 @ylpetrova Do you mean the alert rule query? I just get the latest value of the original metric value:

My target is to set labels in alert rules with the same Key-Value of the metric labels, which are defined in code and passed to prometheus. Shown in image below:

With the labels I can categorize rules under an alert item and route them to different contact points. For example, alerts of metrics with label teamName = “Default” will be sent to mail a@xxx.com, and that with label teamName = “Outlook” will be sent to email b@yyy.com, etc.

Try to use Reduce + Math instead of classic condition.

Can you specify how that can reflect on the reuse of metric labels?
I can only find operations on metric values rather than the labels…