What Grafana version and what operating system are you using?
Grafana 10.2.3, Ubuntu 16.04.3 LTS
What are you trying to achieve?
I just upgraded to Grafana 10.2.3 but I am unable to pull relevant alert information using the API call. Before upgrading to 10.2.3, I was using the API keys to successfully pull the real time alert data. But after the upgrade, I am getting stale information. For example, the information I am getting back using the API call shows that the alert is “Paused”, however, in reality, the alert is in “ok” state.
As you can see, the name of the alert in the screenshot is “Internal Alert P0”, whereas, on the API call output, it still shows as “Internal P0”
The bigger issue that I am seeing is that in the alarm condition, the alert state on the API call output does not get updated whereas the UI shows that the alert is being fired.
Do we know if this is a software bug? I am interested in finding out since I was using the API output and integrating that with another system, but ever since upgrading to Grafana 10.2.3, I seem to have broken that functionality.
I’m afraid that the API endpoint that you are using is deprecated since v.9 was available.
Currently there is no APi in the documentation that will return the current state of the alert. However there are a couple alternatives. They aren’t pretty but that’s all I could find. Otherwise, feel free to submit a feature request.
This endpoint will return the state of each (Grafana-managed only - I think ) alert
And this other endpoint will tell you what is the current state (see newState) based on the annotations