I’m trying to setup alerts in the new unified alerting.
Grafana Version: v8.3.2
I want to build the message from template variables of the labels and can not figure out what I’m doing wrong.
The configuration:
The result:
Am I doing something wrong here?
Thank you for any help
Additional Info, everything makes even less sense to me now.
This:
Returns this:
Hello @naneosrs
Did you achieved to managed this issue ? I’m encountering the same behavior which I don’t understand !
The templated annotations are not translate to their value when text is there too.
Many thanks in advanced
kind regards,
Hi I’m sorry I missed your reply.
I never managed to fixed this, I’m afraid.
1 Like
I’m using Grafana 9.3 and I still have this issue.
Has anyone solved that problem?
I have found a solution in another forum
opened 10:53AM - 25 Mar 22 UTC
closed 07:29PM - 29 Mar 22 UTC
type/question
Hello,
I have created a grafana managed alert which is using a query with a P… rometheus data source and a Math expression. I have also added a label to uniquely identify each alert instance, that label value will be retrieved from the Prometheus metrics by using the template variables as explained in https://grafana.com/docs/grafana/next/alerting/unified-alerting/alerting-rules/alert-annotation-label/.
The alerts works correctly as it is firing up as expected, however the status of the alerts is in error with the message : "invalid format of evaluation results for the alert definition : frame cannot uniquely be identified by its labels: has duplicate results with labels {}".
By looking at the alert status, I see that this label was evaluated to `<no value>` for each alert instance,which is casing the error.
Below are some details of my alert:
- grafana version: community edition 8.4.4 on-prem
- unified alerting: enabled
- classic alerting disabled
- Alert query using prometheus datasource: ibm_mq_statq_queue_depth{queue = "SYSTEM.MQTT.TRANSMIT.QUEUE"} (that metrics contains the qmname label)
- Alert expression of type Math: $A > 0
- custom label qm set to {{ $values.A.Labels.qmname }}
When firing up, the alert status show that the label qm is set to <no value>.
I have tried a lot of combinations as described in the official documentation and I always have the same result.
You need use reduce function between query and condition expression and use the reduce expression as value of condition.
You need use reduce function between query and condition expression and use the reduce expression as value of condition.
I believe this is the solution, resolving the variables worked for me on newer alerts I created lately and I figured the problem was resolved in some update.
But all my current alerts contain reduce expressions, so it’s likely that it was fixed for me because of that.