This article applies to:
• Querying/PromQl
• Product edition: All
• Feature Category: Prometheus
Feature Category: Query, Prometheus,
Problem Description:
When PromQL query passes the interval '1vw' as a variable it fails with 'Error' when the converted WQL query succeeds.
Example:
Dashboard/Chart
Variable Name: time
Variable Value: 1vw
PromQL
count(count_over_time(kube.pod.created{namespace="runners"}[${time}]))
Converted WQL
rawcount(aliasMetric(mcount(${time}, ts(kube.pod.create, namespace="runners")), ''))
Error Messages/Messages
Your query contained a syntax error (Query syntax error: rule stack: [program, expr, atom, application, exprList, expr, atom, application, exprList, expr, subQuery] line 1:61,1:63 (text='vw'): - no viable alternative at input '[1vw' )
Cause:
Currently it is possible only to pass variables such as minute, hour and day (Example, 1m, 1h, 1d) but not the View Window length, '1vw'.
A feature request has been submitted to pass the View Window length (1vw) as a variable.
Resolution/Workaround:
Currently there is no workaround, must use defined values such as 1h, 1w, 1m, as a variable value.
See also:
Using PromQL with Tanzu Observability
Set Up Tanzu Observability as a PromQL Data Source in Grafana