How can I programatically determine how long an alert has been paused?

We pause alerts for various maintenance activities - all of which is done via automation. I am wanted to create a safety net that will generate an alert for alerts that have been paused greater than N time.

I am looking at the NewStateDate, but it doesn’t behave the way I would need it to. Is that intentional (that pausing an alert does not update NewStateDate)? Is there some other mechanism I should be using to understand the state change - specifically paused?

Here is the behavior I can observe:
Alert is set to paused: State is changed to Paused, NewStateDate is NOT updated.
Alert is set to unpause: State changes to Pending, NewStateDate is NOT updated.
Alert moves (automatically) from Pending to ok, NewStateDate IS updated.

This maybe tangentially related to: Alert List Timing (Paused for 20 hours).

I should mention that I also approached this from the Annotation angle, but I do not see annotations for Paused alerts. I saw a github issue for that https://github.com/grafana/grafana/issues/7252

NewState not being updated on pause/unpause seems like a bug. That’s how we want to support your use-case.