m3 icon indicating copy to clipboard operation
m3 copied to clipboard

Support additional formats for offset and time range

Open pbasetty opened this issue 3 years ago • 5 comments

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 avatar Feb 25 '21 19:02 pbasetty

@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).

gibbscullen avatar Mar 02 '21 20:03 gibbscullen

Thanks @gibbscullen. I have submitted https://github.com/prometheus/prometheus/issues/8562

pbasetty avatar Mar 04 '21 18:03 pbasetty

FYI this is supported since Prometheus 2.21.

roidelapluie avatar Mar 04 '21 18:03 roidelapluie

You will probably need to update the github.com/prometheus/common and github.com/prometheus/prometheus dependencies to be able to use this.

roidelapluie avatar Mar 04 '21 18:03 roidelapluie

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.

BertHartm avatar Aug 09 '21 21:08 BertHartm