PMM Alerting Labels/format

I am trying to figure out what I am doing wrong here and have been learning a bunch on templates recently and attempting to move on to some additional items. I have the following query that I have setup using loki. I am trying to get the labels of datasource, orgName in the alert that is sent out to slack and or email. All I can get to show up is the values. I have tried adding items like label_format to it and otherwise adding Datasource Error Alert for {{ $labels.datasource }} in the {{ $labels.orgName }}. This may need to be looked at by the Owner of the Datasource/Org {{ $labels.orgName }}.
and other items into it but cant quite figure it out… Can someone give me a hint please?

sum by (datasource, orgName) (count_over_time({kind="usage_insights"} 
| json 
| eventName = `data-request` 
and datasource!="Loki" 
and datasource!="-- Grafana --" 
and error!=""
and datasourceUid!="-- Mixed --" 
and username!="anonymous" [5m]))

Hi @meyerder, since PMM has not yet adopted Loki, many people here cannot help. I suggest you check with the Grafana Community, as they have more general alerting knowledge.

1 Like