What Grafana version and what operating system are you using?
grafana v8.3.4 on Red Hat Enterprise Linux release 8.3
What are you trying to achieve?
create a multidimensional rule for an alert using the unified alert system, so every time a different series goes over the limit, a new alert is raised.
At this point, I have 8 series, 4 of them over the limit and the other 4 under the limit. Using the classic condition, an alert is raised as at least one of the series is over the limit, but it won’t raise a new alert unless all series recover again.
How are you trying to achieve it?
Creating the SQL query and using the math condition to evaluate all series
What happened?
An error is raised:
“invalid format of evaluation results for the alert definition : frame cannot uniquely be identified by its labels: has duplicate results with labels {}”
What did you expect to happen?
I expected that the labels from the math conditions be similar to the ones in the sql query, instead of being B for all queries (I don’t know if the problem comes from here), and then, the alert is raised for all series that are over the limit.
On the opposite way, if I configure for classic condition, it raises the single alert, but the label is empty inside the response for all series, I don’t know if having the label empty on classic condition is related to the error using the multidimensional rule:
Can you copy/paste the configuration(s) that you are having problems with?
Did you receive any errors in the Grafana UI or in related logs? If so, please tell us exactly what they were.
Did you follow any online instructions? If so, what is the URL?
I tried to follow the instruction to create a multidimensional rule:
Create Grafana-managed alert rules | Grafana documentation
togarha
February 10, 2022, 12:00pm
2
I tried creating an intermediate reduce expression, but the same error is raised:
togarha
February 18, 2022, 10:48am
3
The problem seems to be the metric column, if it has any other name, it works fine.
I’ve created a bug ticket:
opened 01:11PM - 11 Feb 22 UTC
<!--
Please use this template to create your bug report. By providing as much i… nfo as possible you help us understand the issue, reproduce it and resolve it for you quicker. Therefore take a couple of extra minutes to make sure you have provided all info needed.
PROTIP: record your screen and attach it as a gif to showcase the issue.
- Questions should be posted to: https://localhost:3000
- Use query inspector to troubleshoot issues: https://bit.ly/2XNF6YS
- How to record and attach gif: https://bit.ly/2Mi8T6K
-->
**What happened**:
When creating a multidimensional rule on mssql datasource an error is raised with the following message:
```
["invalid format of evaluation results for the alert definition : frame cannot uniquely be identified by its labels: has duplicate results with labels {}"]()
```
If I create the rule using the classic condition, it doesn't raise any error, but I need a new alert to be raised if a second series goes over the limit when the first is still alerting
**What you expected to happen**:
I expected the alert to be created without problems and every time one series goes over the limit, it raises an alert
**How to reproduce it (as minimally and precisely as possible)**:
Having data as simple as:
![image](https://user-images.githubusercontent.com/24194835/153593286-8bfc9a75-e668-4b51-98c9-5f96b6f2f095.png)
Created in runtime to make it easier to report, but having into a regular mssql database with the same behavior.
```
declare @currentTime datetime;
declare @firstTime datetime;
declare @secondTime datetime;
/* set @currentTime = GETUTCDATE();*/
set @currentTime = dateadd(minute, -1, GETUTCDATE());
set @firstTime = dateadd(hour, -2, @currentTime)
set @secondTime = dateadd(hour, -1, @currentTime)
select v.*
from (values
(@firstTime, 2, 'metric1'), (@firstTime, 2, 'metric2'),
(@secondTime, 2, 'metric1'), (@secondTime, 2, 'metric2'),
(@currentTime, 4, 'metric1'), (@currentTime, 2, 'metric2')
) v(time, value, metric)
```
With the following panel:
![image](https://user-images.githubusercontent.com/24194835/153594123-317f0540-9dc3-4549-9055-626d6fcfdf39.png)
and the following data in wide format (time might change as I'm creating data in runtime to post as simple as possible here):
![image](https://user-images.githubusercontent.com/24194835/153594262-172bee66-b587-438b-8cd6-e3130416a04d.png)
after creating the multidimensional rule using a reduce expression to ensure only one point of the series is used:
![image](https://user-images.githubusercontent.com/24194835/153594443-53a392af-6943-4940-b2ff-8ccb028582fe.png)
The error is raised:
```
["invalid format of evaluation results for the alert definition : frame cannot uniquely be identified by its labels: has duplicate results with labels {}"]()
```
![image](https://user-images.githubusercontent.com/24194835/153594661-89251588-0354-4430-9660-dbd47794a488.png)
Removing the reduce expression according to https://grafana.com/docs/grafana/latest/alerting/unified-alerting/alerting-rules/create-grafana-managed-rule/ as the values are numeric doesn't solve the problem:
![image](https://user-images.githubusercontent.com/24194835/153595033-4a53283c-eb0f-40b7-9f53-226a44fa275d.png)
![image](https://user-images.githubusercontent.com/24194835/153595092-9cbada3c-c776-4537-b870-11d6a9a8d959.png)
When creating the rule as a classic condition, no error is reported and the alert is correctly raised, but it is not a multidimensional rule:
![image](https://user-images.githubusercontent.com/24194835/153596199-48e74999-b10f-4c6f-899a-0a6ad44f67aa.png)
![image](https://user-images.githubusercontent.com/24194835/153596308-0f3b1a17-c1fd-486c-a3ea-bbdee3732525.png)
In the image above, I see the labels field is empty, I don't know if it could be related to the issue seen when creating a multidimensional rule.
**Anything else we need to know?**:
**Environment**:
- Grafana version: grafana v8.3.4
- Data source type & version: Microsoft SQL
- OS Grafana is installed on: Red Hat Enterprise Linux release 8.3
- User OS & Browser: Windows 10 & Google Chrome
- Grafana plugins:
- Others:
1 Like