Post
The solution seems to be to resample it, with samples aligned to full minutes, before taking the rate.
This is what I've come up with:
rate((last_over_time(mqtt{topic=~"shellies/.*/relay/.*/energy"}[1m]))[1m:1m])
It's awful, but it seems to work.
3/3
0
0
0
Like, I tried hard to make my monitoring setup take into account when an MQTT message was sent, with a decently good temporal resolution.
But in this case, the timestamp of the MQTT message apparently has nothing to do with when the measurement was taken....
0
0
0