Victoriametrics: Errors in logs ` error app/vmselect/main.go:149 error `

Created on 23 Mar 2019  路  3Comments  路  Source: VictoriaMetrics/VictoriaMetrics

Hello!

I found errors in the logs. Can your check it?
2019-02-26T15:33:33.701Z error app/vmselect/main.go:149 error in "/api/v1/query_range": cannot execute "clamp_max(((sum by (instance) (avg by (mode) ( (clamp_max(rate(node_cpu{instance=\"host\",cpu=\"cpu3\",mode!=\"idle\",mode!=\"user\",mode!=\"system\",mode!=\"iowait\",mode!=\"steal\"}[5m]),1)) or (clamp_max(irate(node_cpu{instance=\"host\",cpu=\"cpu3\",mode!=\"idle\",mode!=\"user\",mode!=\"system\",mode!=\"iowait\",mode!=\"steal\"}[5m]),1)) )) *100) or (sum(avg_over_time(node_cpu_average{instance=\"host\", cpu=\"All\",mode!=\"total\",mode!=\"idle\",mode!=\"user\",mode!=\"system\",mode!=\"wait\",mode!=\"steal\"}[5m])) or sum(avg_over_time(node_cpu_average{instance=\"host\",cpu=\"All\",mode!=\"total\",mode!=\"idle\",mode!=\"user\",mode!=\"system\",mode!=\"wait\",mode!=\"steal\"}[5m])))),100)": aggrFuncExpr: unexpected token "or"; want func modifier; unparsed data: "or sum(avg_over_time(node_cpu_average{instance=\"host\",cpu=\"All\",mode!=\"total\",mode!=\"idle\",mode!=\"user\",mode!=\"system\",mode!=\"wait\",mode!=\"steal\"}[5m])))),100)"l

Version: 1.11.4

Thanks

bug

Most helpful comment

Fixed the issue at v1.12.1.

All 3 comments

Hi @isality!

Is this the query you sent to VM? Could you try following query instead:

WITH (
 allFilters = {instance="host", cpu="All",mode!~"(total|idle|user|system|wait|steal)"},
 cpu3Filters = {instance="host",cpu="cpu3",mode!~"(idle|user|system|wait|steal)"}
)

clamp_max( 
sum by (instance) (
  avg by (mode) (
   (clamp_max(rate(node_cpu{cpu3Filters}[5m]),1)) 
   or (clamp_max(irate(node_cpu{cpu3Filters}[5m]),1) *100) 
   or sum(avg_over_time(node_cpu_average{allFilters}[5m]))
)),100)

@isality, thanks for the bug report. The following minimal query reproduces it:

sum(a) or sum(b)

The bug should be fixed in the next release.

As for the original query, it looks really complicated and, as @hagen1778 already noted, it may be significantly simplified with CTE expressions supported by VictoriaMetrics. Read more about CTE and try them here.

Fixed the issue at v1.12.1.

Was this page helpful?
0 / 5 - 0 ratings