Not sure what you mean by time series vector vs. scalar. Prometheus defines the concepts of
- instant vector, e.g.
up{instance="foo"}: (1, t1), up{instance="bar"}: (0, t1)
;
- range vectors, e.g.
up{instance="foo"}: [(1, t0), (1, t1)], up{instance="bar"}: [(0, t1), (1, t2)]
; and
- scalar, e.g.
5
.
sum(increase(http_request_duration_ms_count[1m]))
will always produce an instant vector, i.e. the first of the above, consisting of a single time series with a single sample (as long as there exists at least one http_request_duration_ms_count
time series).
If you want to turn that into a scalar (as defined by Prometheus) all you need to do is put a scalar()
function call around it, i.e. scalar(sum(increase(http_request_duration_ms_count[1m])))
.