Including data in alert message

I’ve been bashing my head against the wall on this today. Any pointers gratefully appreciated.

I am trying to achieve the following:

I have a query that returns charging current and state of charge. If charging current is greater than zero, trigger an alert with the state of charge in the text.

I have tried structuring the query to return the state of charge as meta data for the charging current. This works, but every time the state of charge changes during the charge then the initial alert is resolved and a new one is triggered.

I have also tried using two separate queries, but it looks like Grafana doesn’t resolve the query that results in the alert so the state of charge value is never queried and the result ends up being blank.

How do I achieve this?

Hi,

Can you share some alert configuration screenshots (namely query, expressions and your template - was it in contact point template or description / summary). Grafana should be able to pass the value to the template with {{ $values.<query ref id>.value }}, so you don’t have to pass the current to metadata (as you’ve noticed it would create new alert each time).