How to enable predefined labels in alerts

Hi, 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?

Which preset labels you are referring to? You should be able to see these Custom Labels options in v9 and higher:

@grant2 From the first image I uploaded in the original post (C&P from another post), you may see labels such as instance, job, etc.
I’m just wondering if these labels are set by user or inherited from metrics or somewhere else?

Those are Custom Labels (i.e. set by user).

Hi @lsh,
Those labels are append when prometheus scrapes data from an endpoint. Can you please check in your prometheus configuration if you are using labeldrop (or labelkeep) which would drop (keep) specific prometheus labels.

I don’t really use prometheus but I found those functions on:

Best regards,

I’ve checked these and they seems to only talk about metrics, not the same as my situation.
I’ve got the metrics with correct labels and want to inherit them in my alert labels.

However, it seems to be not working in current version.