How to query currently firing alerts?

I’m using Grafana Cloud with built-in Prometheus. I’m trying to build a dashboard showing all alerts that are currently firing. I tried the built-in “Alert List” panel but it doesn’t offer enough customization for my needs, so I’m trying to use a Table panel instead. Where can I find the alerts to build my own query?
I found the built-in Loki datasource called grafanacloud-<instance>-alert-state-history. This might be an option, but it seems overly complicated because I’d have to build my own LogQL logic to exclude alerts which have already been resolved. I was hoping there’s some way to query only the active alerts. Is this possible?

hello @llamafilm i was explore and try to find firing state , using prometheus but not see any metrics when we write query , also try my grafana database is postgresql using sql query fetch the alert state but this not helpfull your case.
thanks

Hi @llamafilm

I use the Infinity datasource to do something like this: