Functioning queries break when used as variables

I have a couple of data source that works great in a panel, but when added as a variable I get an error. This happens in the second I change the data source from Azure Monitor to any of the following plugins: JSON API, and CSV.

TypeError: t.getVariables is not a function

[Edit] Updated to Grafana v8.3.6 (bf8766bbf2)

An unexpected error happened
Details
TypeError: t.getVariables is not a function

    at J (https://foo.bar.com/public/build/7095.0e38943fa459e872fe93.js:6501:29939)
    at div
    at xc (https://foo.bar.com/public/build/7095.0e38943fa459e872fe93.js:2934:3689)
    at div
    at te (https://foo.bar.com/public/build/7095.0e38943fa459e872fe93.js:6501:31381)
    at ae (https://foo.bar.com/public/build/azureMonitorPlugin.0e38943fa459e872fe93.js:1:45189)
    at div
    at div
    at div
    at c (https://foo.bar.com/public/build/7095.0e38943fa459e872fe93.js:794:786)
    at u (https://foo.bar.com/public/build/7095.0e38943fa459e872fe93.js:794:1492)
    at div
    at div
    at c (https://foo.bar.com/public/build/7095.0e38943fa459e872fe93.js:794:786)
    at u (https://foo.bar.com/public/build/7095.0e38943fa459e872fe93.js:794:1492)
    at div
    at div
    at c (https://foo.bar.com/public/build/7095.0e38943fa459e872fe93.js:794:786)
    at u (https://foo.bar.com/public/build/7095.0e38943fa459e872fe93.js:794:1492)
    at G (https://foo.bar.com/public/build/7095.0e38943fa459e872fe93.js:5935:27807)
    at v (https://foo.bar.com/public/build/2201.0e38943fa459e872fe93.js:2:971571)
    at div
    at div
    at c (https://foo.bar.com/public/build/7095.0e38943fa459e872fe93.js:794:786)
    at u (https://foo.bar.com/public/build/7095.0e38943fa459e872fe93.js:794:1492)
    at form
    at div
    at B (https://foo.bar.com/public/build/7095.0e38943fa459e872fe93.js:4564:2304)
    at v (https://foo.bar.com/public/build/2201.0e38943fa459e872fe93.js:2:971571)
    at div
    at Se (https://foo.bar.com/public/build/7095.0e38943fa459e872fe93.js:4585:1288)
    at v (https://foo.bar.com/public/build/2201.0e38943fa459e872fe93.js:2:971571)
    at div
    at div
    at div
    at div
    at div
    at t (https://foo.bar.com/public/build/2201.0e38943fa459e872fe93.js:2:657031)
    at u (https://foo.bar.com/public/build/7095.0e38943fa459e872fe93.js:264:1038)
    at div
    at aa (https://foo.bar.com/public/build/7095.0e38943fa459e872fe93.js:4598:307)
    at div
    at Mi (https://foo.bar.com/public/build/DashboardPage.0e38943fa459e872fe93.js:574:3581)
    at DashboardPage
    at v (https://foo.bar.com/public/build/2201.0e38943fa459e872fe93.js:2:971571)
    at n (https://foo.bar.com/public/build/2201.0e38943fa459e872fe93.js:2:942013)
    at Bi (https://foo.bar.com/public/build/7095.0e38943fa459e872fe93.js:6399:193)
    at t (https://foo.bar.com/public/build/2201.0e38943fa459e872fe93.js:2:989569)
    at t (https://foo.bar.com/public/build/2201.0e38943fa459e872fe93.js:2:991590)
    at main
    at t (https://foo.bar.com/public/build/2201.0e38943fa459e872fe93.js:2:986187)
    at div
    at Ws (https://foo.bar.com/public/build/7095.0e38943fa459e872fe93.js:2158:1022)
    at d (https://foo.bar.com/public/build/7095.0e38943fa459e872fe93.js:4486:26210)
    at Sl (https://foo.bar.com/public/build/7095.0e38943fa459e872fe93.js:2874:458)
    at Tl (https://foo.bar.com/public/build/7095.0e38943fa459e872fe93.js:2874:1006)
    at l (https://foo.bar.com/public/build/2201.0e38943fa459e872fe93.js:2:969089)
    at No (https://foo.bar.com/public/build/7095.0e38943fa459e872fe93.js:6479:384)

what kind of variable are you trying to add? A query based variable? Can you give the community more exact steps for reproduction? Also, Grafana version is crucial for proper support

Same here. Used to work in 8.1, but not working with 8.3.6 and 8.4.0.

I choose the datasource, and then, gives the same problem

TypeError: t.getVariables is not a function

    at J (http://localhost:1337/public/build/6518.9347d70f801bfbc5206a.js:7031:29939)
    at div
    at bc (http://localhost:1337/public/build/6518.9347d70f801bfbc5206a.js:2934:3689)
    at div
    at te (http://localhost:1337/public/build/6518.9347d70f801bfbc5206a.js:7031:31381)
    at ae (http://localhost:1337/public/build/azureMonitorPlugin.9347d70f801bfbc5206a.js:1:45189)
    at div
    at div
    at div
    at c (http://localhost:1337/public/build/6518.9347d70f801bfbc5206a.js:806:786)
    at u (http://localhost:1337/public/build/6518.9347d70f801bfbc5206a.js:806:1492)
    at div
    at div
    at c (http://localhost:1337/public/build/6518.9347d70f801bfbc5206a.js:806:786)
    at u (http://localhost:1337/public/build/6518.9347d70f801bfbc5206a.js:806:1492)
    at div
    at div
    at c (http://localhost:1337/public/build/6518.9347d70f801bfbc5206a.js:806:786)
    at u (http://localhost:1337/public/build/6518.9347d70f801bfbc5206a.js:806:1492)
    at G (http://localhost:1337/public/build/6518.9347d70f801bfbc5206a.js:6905:25711)
    at v (http://localhost:1337/public/build/2201.9347d70f801bfbc5206a.js:2:971571)
    at div
    at div
    at c (http://localhost:1337/public/build/6518.9347d70f801bfbc5206a.js:806:786)
    at u (http://localhost:1337/public/build/6518.9347d70f801bfbc5206a.js:806:1492)
    at form
    at div
    at B (http://localhost:1337/public/build/6518.9347d70f801bfbc5206a.js:5440:2304)
    at v (http://localhost:1337/public/build/2201.9347d70f801bfbc5206a.js:2:971571)
    at div
    at Ce (http://localhost:1337/public/build/6518.9347d70f801bfbc5206a.js:5461:1288)
    at v (http://localhost:1337/public/build/2201.9347d70f801bfbc5206a.js:2:971571)
    at div
    at div
    at div
    at div
    at div
    at t (http://localhost:1337/public/build/2201.9347d70f801bfbc5206a.js:2:657031)
    at u (http://localhost:1337/public/build/6518.9347d70f801bfbc5206a.js:264:1038)
    at div
    at aa (http://localhost:1337/public/build/6518.9347d70f801bfbc5206a.js:5474:307)
    at div
    at Mi (http://localhost:1337/public/build/DashboardPage.9347d70f801bfbc5206a.js:574:3581)
    at DashboardPage
    at v (http://localhost:1337/public/build/2201.9347d70f801bfbc5206a.js:2:971571)
    at n (http://localhost:1337/public/build/2201.9347d70f801bfbc5206a.js:2:942013)
    at ce (http://localhost:1337/public/build/6518.9347d70f801bfbc5206a.js:4330:193)
    at t (http://localhost:1337/public/build/2201.9347d70f801bfbc5206a.js:2:989569)
    at t (http://localhost:1337/public/build/2201.9347d70f801bfbc5206a.js:2:991590)
    at main
    at t (http://localhost:1337/public/build/2201.9347d70f801bfbc5206a.js:2:986187)
    at div
    at qs (http://localhost:1337/public/build/6518.9347d70f801bfbc5206a.js:2158:1022)
    at d (http://localhost:1337/public/build/6518.9347d70f801bfbc5206a.js:4776:26210)
    at Sl (http://localhost:1337/public/build/6518.9347d70f801bfbc5206a.js:2874:458)
    at kl (http://localhost:1337/public/build/6518.9347d70f801bfbc5206a.js:2874:1006)
    at l (http://localhost:1337/public/build/2201.9347d70f801bfbc5206a.js:2:969089)
    at $e (http://localhost:1337/public/build/6518.9347d70f801bfbc5206a.js:4343:436)

We solved the problem by removing Azure Monitor as the default data source. We use a dummy default data source now.

Be aware, having some queries that point to the default data source might break. When switching from the default data source to Azure Monitor, the selected resources etc. will be gone.

1 Like