But when the alert is fired i have this error: invalid format of evaluation results for the alert definition : frame cannot uniquely be identified by its labels: has duplicate results with labels {}
I also have this problem. I’m using a PostgreSQL data source with Grafana Cloud v8.3.5, and my data looks like this:
time
device_id
value
2022-02-01 11:06:00
device_01
0
2022-02-01 15:21:45
device_14
1
2022-02-01 15:23:12
device_19
0
2022-02-01 15:23:22
device_13
0
2022-02-01 15:23:48
device_02
1
I want to set up alerts to be notified e.g. when a device value changes to 1.
As far as I understand, if I use a classic condition, the alert applies to any device, in aggregate. Instead, I want a multi-dimensional rule in order to “generate a separate alert for each series” (as per the documentation).
I keep getting invalid format of evaluation results for the alert definition : frame cannot uniquely be identified by its labels: has duplicate results with labels {} no matter what I try. I’ve tried no expression, various combinations of math and reduce expressions, as well as the workaround of using both: Grafana 8 alerting - multiple series values - #3 by michaelosthege
This is reproducible even with “wide” sample data without “holes”:
I’m getting exactly the same error, using PostgreSQL datasource.
I first used a Reduce expression for each query to aggregate values in the selected time range into a single value. Although it seems not correctly working as I get a single value for a specific label (and NaN for all the others).
Hi guys, I’m getting same error using Zabbix datasource with snmp data, I’m really confused, what should i do?
i get no label after using reduce and math expression for alerting
I have the same issue using ClickHouse datasource.
I wrote my query to return the number of request from each application per country. I use the reduce expression but always return more than one item.
I want to share a slightly related issue. Maybe it will help someone solve their problem.
In my case, I also ended up with multiple time series with the same labels, resulting in the error that the labels weren’t unique. The problem was that Grafana had accidentally inserted multiple “Metric” elements to the query. It certainly wasn’t me — maybe it was doing it automatically to create some data. In any case, ensuring that there was only one Metric made the alerts work.
I had this problem too with InfluxDB , I managed to workaround it with different approach , here it is:
Create query “A” with your first time series
Create query “B” with your second time series
Create “Reduce” expression for data from query “A” >> order “C”
Create “Reduce” expression for data from query “B” >> order “D”
Create “Math” expression evaluating your threshold:
“$C > <your-threshold> || $D > <your-threshold>”
This will trigger an alarm if value in $C or $D has breached the threshold