PostgresSQL datasource does not get substituted in the panel

I am creating a variable of type “Data Source” and the datasource is of type postgresql.

The variable gets created and all the relevant datasource gets populated under the dropdown in the dashboard (red numbers from 1 to 4 in the image). I also changed the datasource to the variable in the panel of the graph.

Now, when I choose a specific datasource (e.g. 2 in the image) from the dropdown I don’t see any change in the data. It seems like the panel doesn’t get the datasource change (e.g. 3 in the image).

Refresh button seems doesn’t solve the problem.

It looks like the Ambari plugin bug described here: https://localhost:3000/t/datasource-does-not-get-substituted-in-the-panel/16673

you should inspect each panel to see the raw request. that plugin should show the generated SQL after processing the time macros as well

Hi,
I found a solution that works for me. You have to replace constant uid (e.g. “u7srayx”) with variable name of datasource (e.g. “${db}”) in inspectPanel JSON.

I’m not sure if this problem is related to how the plugin generate the json or how the plugin works when the datasource variable change its value.

Hope it’s useful to fix this bug.

1 Like