metricsql icon indicating copy to clipboard operation
metricsql copied to clipboard

does not support func 'tmax_over_time' to PromQL

Open IsQiao opened this issue 1 year ago • 1 comments

// Convert mql to PromQL
pql, err = metricsql.ExpandWithExprs(`tmax_over_time(count(up)[1h:5m])`)
if err != nil {
    log.Fatalf("cannot expand with expressions: %s", err)
}
fmt.Println(pql)
$ go run .
tmax_over_time(count(up)[1h:5m])

IsQiao avatar Oct 17 '24 07:10 IsQiao

could the issue be caused by the fact that tmax_over_time is only support and metricsql and not promql? and the ExapndWithExprs function only expands WITH templates and doesn't translate metricsql exclusive functions to promql?

tiny-pangolin avatar Oct 17 '24 14:10 tiny-pangolin

the Parse() function meaning is parse promQL to metricsQL, but it's just implement part of it metricsql.Parse(sum(rate(foo{bar="baz"}[5m])) by (job))

IsQiao avatar Nov 21 '24 07:11 IsQiao