metricsql
metricsql copied to clipboard
does not support func 'tmax_over_time' to PromQL
// 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])
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?
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))