This problem mysteriously appeared after upgrading to Grafana 12, then just as inexplicably, it suddenly disappeared following service restarts.
My suspicion here is that, in our case, the issue was incompatible alertmanager versions. The flow went something along the lines of: Grafana 11.6.0->Grafana 12.0.0 (issue appears), alertmanager some earlier version->altermanager latest version (issue persists), grafana-server service restarted (issue solved).
Assumption: Update and [re]start alertmanager before grafana-server to avoid this.
I retract that. Restarting merely altered the behaviour somewhat. Instead of almost always firing off with startsAt = endsAt, it would only sometimes do this, but still tag the previous start time with an end time beforehand.
We are now running with the feature flag alertRuleUseFiredAtForStartsAt enabled, which we believe will correct this issue. (It is also believed to be resolved in 12.1)
Until the fix is generally included in an upcoming Grafana version, the current solution is to set the alertRuleUseFiredAtForStartsAt feature toggle to true.
I have the same problem. I want to include the timestamp of when the alert was fired in the resolved alert message, but I cannot make it work.
For this reason, I tried adding the following parameter to my custom.ini file:
alertRuleUseFiredAtForStartsAt = true
as shown in the attached screenshot.
What should I do next in the notification template? Do I need to add something like .FiredAt inside the template in order to get the result I want? Is there anything else that needs to be configured?