Invalid format of evaluation results for the alert definition : frame cannot uniquely be identified by its labels: has duplicate results with labels {}

i Have configure an alert

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 {}

Thank you for your help

Kibana Version : v8.1.5

1 Like

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”:

SELECT * FROM (VALUES
  (NOW() - INTERVAL '1 minute', 1, 2),
  (NOW(), 3, 4)
) t1 ("time", c1, c2)

Am I misunderstanding something about the data format?

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).

Then I removed that as it is not needed for rules using numeric data).

It was working at the beginning, but after few minutes I started getting this error, and now I’m stuck.

Anyone from Grafana can shed light on this?

Experiencing the same issue, did you ever find a solution?

Did anybody get the solution for the above problem?

I think I figured this out.

Your data needs to be formatted like this:

  • one column of type timestamp named time
  • one column of type number (this is your value)
  • zero or more columns of type string (these are your labels), none of which can be named metric

Then, you still need a (seemingly redundant) Reduce expression after that.

2 Likes

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


Welcome @mrzare1984 to the Grafana forum.

I would expect you to have 3 queries/expressions…

A: the query from Zabbix
B: the reduce expression
C: the math expression

Can you confirm and if yes, share all 3?

i have same problem with Influxdb

1 Like

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.

My query:

My reduce expression:

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.