-
Notifications
You must be signed in to change notification settings - Fork 8
Open
Description
When using PromQL to query GreptimeDB, if the query contains a variable and the variable has multiple values, it is now necessary to use ${datanode:pipe}.
For example:
sum(process_resident_memory_bytes{instance=~"${datanode:pipe}"}) by (instance, pod)
After being filled by Grafana, it becomes:
sum(process_resident_memory_bytes{instance=~"172.16.214.189:4000|172.16.214.190:4000|172.16.214.193:4000"}) by (instance, pod)
Previously, using ${datanode} would separate the values with |, but it would escape the values. After version 0.14, GreptimeDB no longer supports escaped query conditions, so this approach fails.
For example:
sum(process_resident_memory_bytes{instance=~"${datanode}"}) by (instance, pod)
After being filled by Grafana, it becomes:
sum(process_resident_memory_bytes{instance=~"(172\\.16\\.214\\.189:4000|172\\.16\\.214\\.190:4000|172\\.16\\.214\\.193:4000)"}) by (instance, pod)
Initially, it was suggested to use ${datanode:raw}, but this separates the values with ,. Therefore, if the variable has multiple values, using raw will also fail.
Reference:
Metadata
Metadata
Assignees
Labels
No labels