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.