Group by hour in Grafana dashboard

Hello, I am trying to have a dashboard where the results are grouped by hour. What’s the best way to achieve this?

Here is my query:
from(bucket: “foo”)
|> range(start: v.timeRangeStart, stop: v.timeRangeStop)
|> filter(fn: (r) => r[“host”] =~ /^${hostname:regex}$/)
|> filter(fn: (r) => not exists r[“instance_id”] or r[“instance_id”] =~ /^${instance_id:regex}$/)
|> filter(fn: (r) => r[“path”] =~ /^/some-path/)
|> filter(fn: (r) => r[“_measurement”] == “api_requests_all”)
|> map(fn: (r) => ({
_time: r._time,
_value: r._value,
_field: r.api_name + ": " + r.method + " " + r.path

the time here is up to a second. Is there a way I can round off the value in _time: r._time?
or should I apply a transformation to do so? I tried apply a GroupBy transformation but didn’t get it working. Any help will be appreciated!

Hi @supritashankar

Are you able to use the query options to achieve this?

E.g. Data before

Data after