user3464179
user3464179

Reputation: 99

Prometheus QL get the first values from the query result

I write the query below to get the up time for the microvices.

base_jvm_uptime_seconds{kubernetes_name="namepspce1"}

However, it returns multiple values, so the grafana returns "Only queries that return single series/table is supported". I am wondering how can I the first velus from the query result?

I tried base_jvm_uptime_seconds{kubernetes_name="namepspce1"}[0], but it doesn't work..

Thanks!

Upvotes: 0

Views: 7356

Answers (1)

sskrlj
sskrlj

Reputation: 309

I suggest you first inspect the label values of these multiple time series by running the query in Prometheus Graph console. The you'll need to decide which one you want to display. Random first usually isn't the best idea. But you can always do topk(1,query) if it helps. Just turn the Instant mode on in the Grafana Query editor.

Upvotes: 1

Related Questions