Stats panel with variables from a library and used in a loop row has wrong value entering into page

I’m on Grafana 9.3.1 and I got strange behavior between variables and “stats panels” linked to libraries inside a loop in a ROW panel. Seems that anything is related a library has a default value entering into page… before a force change using a combo menù on top.

How to reproduce it (as minimally and precisely as possible):
Create a ROW panel and loop over a hidden variable.
In this row introducing a panel with a simle prometheus query from panel linked to a library.
This panel must have a query using the variable of loop.


the query…
topk (1,ag_details{ag_name=“$agname”, replica_server_name=“$dbinstance”, primary_replica=“$dbinstance”, job=“$job”})

$agname is the loop variable used for ROW panel


after change from TOP menù… all is ok


only entering into page


  • Grafana version: 9.3.1
  • Data source type & version: Prometheus
  • OS Grafana is installed on: RHES
  • User OS & Browser: Chrome