Library panels spontaneously replicating

  • What Grafana version and what operating system are you using?

Grafana v10.1.4, Docker image OS: linux/AMD64

  • What are you trying to achieve?

Minimum reproducible example:
A library panel that repeats for a particular variable (var_1) inside a row

Actual desired use case:
A library panel that repeats for a particular variable (var_1) in a row that repeats for another variable (var_2).

  • How are you trying to achieve it?

Minimum reproducible example:
I have two variables.
var_1 is a custom type variable with values: a, b
var_2 is also custom, but is a set of key value pairs: ONE : 1, TWO : 2

I have a single row with title: $var_2 (Text is ${var_2: text})

Inside that row I have 3 grafana random walk panels that repeat for each of the two values of var_1

First panel titled: Var_1 $var_1 - $var_2 Signal1
Second panel titled: Var_1 $var_1 - $var_2 Signal2
Third panel titled: Var_1 $var_1 - $var_2 Signal3

The first panel (Signal1) is a library panel (name: Grafana Signal1 - single var1).
The panels for Signal2 and Signal3 are not library panels.

  • What happened?

The Signal1 panel replicates beyond the two values for var_1. The most reproducible case for this is if the dashboard is saved with the row closed.

Original dashboard:

After saving with the row closed and then opening the row:

Note, only the library panel creates a second set of repeats and they are exact duplicates of the original use case in terms of variable (identical titles). If the browser is refreshed the row will show the original correct number of panels (6), but as soon as it is expanded the extra two panels appear and if it is closed it will show the new incorrect number of panels (8). If it is saved with the row closed again what started as 2 panels (a single with one repeat) and became 4 will double again to 8 panels, and so on.

The non-library panels remain unaffected and continue to show the one panel with one repeat.

The “extra” panels sometimes appear directly below the originals, sometimes elsewhere, sometimes staggered as in the above image. On occasion they have replicated to uneven numbers on the right and left.

This is a problem since some rows are closed by default to avoid running unnecessary queries. If the row is saved closed the replications will happen the moment it is opened, so there is no way to display the intended dashboard. I would like to be able to have these as library panels because I use them on several dashboards and maintaining them is tricky when they are used in multiple places.

  • What did you expect to happen?

I expect the panels to only replicate once for the variable they are set to replicate for var_1 regardless of whether the row is saved expanded or collapsed. Basically, I expect the behavior to remain consistent as it is for the panels that are not library panels, but have otherwise identical properties.

  • Did you receive any errors in the Grafana UI or in related logs? If so, please tell us exactly what they were.

No errors are given.