prometheus - VictoriaMetrics unparsed data left error on group left - Stack Overflow

admin2025-04-17  4

temperature is a gauge that returns some unique values {10,23,50...} for labels node_id,system_id with values {"1","1"},{"2","1"},{"1","2"},{"2","2"}.

I am trying to get top 100 node_id and system_id with highest temperature and per-second derivative over the 5m lookbehind window.

topk(100, temperature)[5m] , on(node_id, system_id) group_left() deriv(temperature[5m])

Sample Output

| node_id | system_id| temperature| rate of change|
+---------+----------+------------+---------------+
|     1   | 1        |    40      |   0.2         |
+---------+----------+------------+---------------+
|     2   | 2        |    30      |    0          |
+---------+----------+------------+---------------+
|     3   | 3        |    20      |    0          |
+---------+----------+------------+---------------+
|     4   | 4        |    10      |    1          |
+---------+----------+------------+---------------+
.....

Not exactly what I want to get but I tried this

with (
  top_nodes = topk(100, temperature[5m]) by (node_id)
)
(
  label_set(label_del(top_nodes,"__name__"),"metric","top-100")
)
  or
(
  label_set(deriv(temperature[5m]),"metric", "deriv") and on(node_id) top_nodes
)

any suggestions ?

temperature is a gauge that returns some unique values {10,23,50...} for labels node_id,system_id with values {"1","1"},{"2","1"},{"1","2"},{"2","2"}.

I am trying to get top 100 node_id and system_id with highest temperature and per-second derivative over the 5m lookbehind window.

topk(100, temperature)[5m] , on(node_id, system_id) group_left() deriv(temperature[5m])

Sample Output

| node_id | system_id| temperature| rate of change|
+---------+----------+------------+---------------+
|     1   | 1        |    40      |   0.2         |
+---------+----------+------------+---------------+
|     2   | 2        |    30      |    0          |
+---------+----------+------------+---------------+
|     3   | 3        |    20      |    0          |
+---------+----------+------------+---------------+
|     4   | 4        |    10      |    1          |
+---------+----------+------------+---------------+
.....

Not exactly what I want to get but I tried this

with (
  top_nodes = topk(100, temperature[5m]) by (node_id)
)
(
  label_set(label_del(top_nodes,"__name__"),"metric","top-100")
)
  or
(
  label_set(deriv(temperature[5m]),"metric", "deriv") and on(node_id) top_nodes
)

any suggestions ?

Share edited Jan 31 at 18:10 crr asked Jan 31 at 12:37 crrcrr 2636 silver badges16 bronze badges
Add a comment  | 

1 Answer 1

Reset to default 0

VictoriaMetrics querying API could return only one value per time series, so you can't have highest temperature and its derivative within one query. It should be two separate queries.

转载请注明原文地址:http://anycun.com/QandA/1744861688a88660.html