Alert_instance does not contain newest alert state in database [version 12.3.1]

  • What Grafana version and what operating system are you using?
    12.3.1

  • What are you trying to achieve?
    Maintain dashboard which present alert state for each evaluation group.

  • How are you trying to achieve it?
    Create mysql View based on few tables - alert_instance is most important table.

  • What happened?
    I upgraded grafana from 12.0.1 to 12.3.1 and my dashboard stopped working. I checked directly in database alert_instance table and state is not updated here - either last_eval_time or current_state. Basically, when I add new alert, record for this alert is not created and records for old alerts are not updated. Of course, in alert manager menu everything is fine and working fine.

  • What did you expect to happen?
    alert_instance work as before.

  • Can you copy/paste the configuration(s) that you are having problems with?
    N/A. Eventually I need to know what you need.

  • Did you receive any errors in the Grafana UI or in related logs? If so, please tell us exactly what they were.
    No.

  • Did you follow any online instructions? If so, what is the URL?
    Didn’t find anything related to this topic, thats why I’m asking.

Since this started immediately after upgrading to 12.3.1, one thing I’d check is the alertingSaveStateCompressed feature toggle.
In current Grafana 12.x it’s enabled by default and changes how alert state is persisted. If your dashboard reads the legacy alert_instance columns directly, that could explain why the Alerting UI is correct while your SQL view sees stale data.

Set →

[feature_toggles]
alertingSaveStateCompressed = false

Restart Grafana and check whether alert_instance starts updating again. If it does, then your dashboard is relying on the legacy alert state storage format.

Thank you for your reply. Indeed, it helped!

Anyway, as you said “In current Grafana 12.x it’s enabled by default” then why when I was using Grafana 12.0.1 alert_instance table was working just fine. Any idea why is that? Also, as I can see because of that Grafana will perform more operation on Database that with alertingSaveStateCompressed activated. Any idea how we can read current alert state with this property on true? So I will be able to create dashboard with status for each Evaluation Group if its KO or OK?