we have used Dynatrace DataSource By API endpoint v2 for visualizing management zone name using Repeat by variable in Grafana version 11.3. I am trying to get alert for one MZ name panel in this variable. I am getting error unexpected end of Json input.
Is there any other ways to use dashboard variable in Alerts?
Dashboard variables cannot be used in alert rules because dashboards and alerts operate independently. While an alert rule query can be created from a dashboard panel, the two remain separate—changes to the alert rule query do not affect the panel query, and vice versa.
That said, you can achieve similar functionality in your alert rule query without using the dashboard variable. Here are two possible approaches:
-
Use a Fixed MZ Value: In your alert rule query, manually replace the dashboard variable with a specific Management Zone (MZ) name.
-
Query All MZs: If the Dynatrace API supports it, you could modify your alert rule query to retrieve all MZs, allowing the alert rule to generate separate alert instances for each one. This approach is commonly used when monitoring multiple instances. You can find more details on the alert rules and alert instances doc sections.
Hope it helps!