m3
m3 copied to clipboard
Support additional formats for offset and time range
Currently offset values can only be specified in single units (2h, 75m, 10s, etc). Would like to request support for multi unit values such as 1h15m, etc.
The same applies for time-range values, for example, would like support for increase(up[1h15m])
Background When the query is processed using Prometheus query parsing library, these fields are parsed into time.Duration and printed back in the multi-unit format. So 75m becomes 1h15m.
@pbasetty -- we currently use the upstream Prometheus PromQL query engine for high compatibility, and it would be best to raise this issue directly on the Prometheus repository (github.com/prometheus/prometheus).
Thanks @gibbscullen. I have submitted https://github.com/prometheus/prometheus/issues/8562
FYI this is supported since Prometheus 2.21.
You will probably need to update the github.com/prometheus/common and github.com/prometheus/prometheus dependencies to be able to use this.
FYI, I just tested this against master, which does have newer versions of the prometheus libraries, and it still doesn't seem to be working. the versions in master are
github.com/prometheus/common v0.29.0
github.com/prometheus/prometheus v1.8.2-0.20210621150501-ff58416a0b02
which I thought would include the 2.21 fixes.