Increment of a counter metrics in the last hour divided by 5 mins

Hello community,

I have a counter metrics say api_msg_count which keeps on increasing based on incoming no. of messages to the api.
I want to show this increase of no. of messages on a graph. It should be for the last hour for each 5 mins interval. I am using the following promql, which also gives me separate timestamps for the last hour divided by 5 mins.

Example: PromLens - The query builder, analyzer, and explainer for PromQL

`increase(api_msg_count[5m])[1h:5m]

6397.894736842105 @ 1718175600
7066.315789473684 @ 1718175900
7184.210526315789 @ 1718176200
6791.578947368421 @ 1718176500
5882.105263157894 @ 1718176800
4908.421052631578 @ 1718177100
4245.263157894737 @ 1718177400
4032.6315789473683 @ 1718177700
3996.8421052631575 @ 1718178000
4074.736842105263 @ 1718178300
4558.9473684210525 @ 1718178600
5416.8421052631575 @ 1718178900`

However, I see that some of the times, the very first msg count doesn’t apear in the results. Also, the results are always extrapolated, if there are total 10 msgs sent to the api, it shows 12.5 in the result for that timestamp.
Is there a better way to do this?

I tried using offset and it gives the correct results. But now instead of one query to prometheus api, I have to make total (60 / 5 = 12) calls to prometheus api for every 5 mins of the past hour and implement a logic to calculate the increment.

api_msg_count offset 5m
api_msg_count offset 10 m

api_msg_count offset 60