Whitespace in metrics query was encoded to "%2B"

** What Grafana version and what operating system are you using?**
bash-5.1# grafana-server -v
Version 9.2.0 (commit: c7eea48209, branch: HEAD)
bash-5.1# uname -a
Linux 84bcea5e05c2 5.4.0-110-generic #124-Ubuntu SMP Thu Apr 14 19:46:19 UTC 2022 x86_64 Linux

** What happened?**
I tried to query metrics in grafana toward to my victoriametrics with below PromQL:
sum by(name) (container_cpu_usage_seconds_total{exported_host_fqdn=“host1”})

But i got error below from response:
“error”: “422: error when executing query="sum+by(name)+(container_cpu_usage_seconds_total{exported_host_fqdn=\"host1\"})" on the time range (start=1666681245000, end=1666684845000, step=15000): cannot execute query: cannot execute "(sum{exported_host_fqdn=\"host1\"} + by(name)) + container_cpu_usage_seconds_total{exported_host_fqdn=\"host1\"}": cannot execute "sum{exported_host_fqdn=\"host1\"} + by(name)": unknown func "by"”

I did some packets capture and found the whitespace between “sum” and “by(name)” was encoded to %2B in URL. But my server side(victoriametrics) decoded “%2B” to plus sign “+” instead whitespace.
BTW, a basic query without whitespace is ok.

** What did you expect to happen?**
I expect grafana encode the whitespace to plus sign or %20 in URL. Actually it’s quite strange that i queried another datasource with http directly and i can get correct response. Not sure why i got this issue when i use attached datasource configuration.

  • Can you copy/paste the configuration(s) that you are having problems with?
    I attach my datasource configuration. Not sure if it’s enough.

** Did you receive any errors in the Grafana UI or in related logs? If so, please tell us exactly what they were.**
Error from response:
“error”: “422: error when executing query="sum+by(name)+(container_cpu_usage_seconds_total{exported_host_fqdn=\"host1\"})" on the time range (start=1666681245000, end=1666684845000, step=15000): cannot execute query: cannot execute "(sum{exported_host_fqdn=\"host1\"} + by(name)) + container_cpu_usage_seconds_total{exported_host_fqdn=\"host1\"}": cannot execute "sum{exported_host_fqdn=\"host1\"} + by(name)": unknown func "by"”

Thanks a lot,
BR, Cass