Merge "Host-agnostic compute queries"
diff --git a/grafana/files/dashboards/telegraf/kpi_downtime_prometheus.json b/grafana/files/dashboards/telegraf/kpi_downtime_prometheus.json
index e3bc9a8..a34cc2f 100644
--- a/grafana/files/dashboards/telegraf/kpi_downtime_prometheus.json
+++ b/grafana/files/dashboards/telegraf/kpi_downtime_prometheus.json
@@ -28,7 +28,7 @@
       },
       "id": 22,
       "panels": [],
-      "title": "Last 24h average",
+      "title": "Last $time_frame average",
       "type": "row"
     },
     {
@@ -93,7 +93,7 @@
       "tableColumn": "",
       "targets": [
         {
-          "expr": "1 - avg_over_time(total:openstack_nova_instance_failed{environment=\"$environment\"}[1d]) / avg_over_time(total:openstack_nova_instance_all{environment=\"$environment\"}[1d])",
+          "expr": "1 - avg_over_time(total:openstack_nova_instance_failed{environment=\"$environment\"}[$time_frame]) / avg_over_time(total:openstack_nova_instance_all{environment=\"$environment\"}[$time_frame])",
           "format": "time_series",
           "intervalFactor": 1,
           "legendFormat": "",
@@ -176,7 +176,7 @@
       "tableColumn": "",
       "targets": [
         {
-          "expr": "avg_over_time(total:openstack_nova_instance_all{environment=\"$environment\"}[1d])",
+          "expr": "avg_over_time(total:openstack_nova_instance_all{environment=\"$environment\"}[$time_frame])",
           "format": "time_series",
           "interval": "30s",
           "intervalFactor": 1,
@@ -260,7 +260,7 @@
       "tableColumn": "",
       "targets": [
         {
-          "expr": "avg_over_time(total:openstack_nova_instance_failed{environment=\"$environment\"}[1d])",
+          "expr": "avg_over_time(total:openstack_nova_instance_failed{environment=\"$environment\"}[$time_frame])",
           "format": "time_series",
           "interval": "30s",
           "intervalFactor": 1,
@@ -872,6 +872,38 @@
         "tagsQuery": "",
         "type": "query",
         "useTags": false
+      },
+      {
+        "allValue": null,
+        "current": {
+          "tags": [],
+          "text": "1d",
+          "value": "1d"
+        },
+        "hide": 0,
+        "includeAll": false,
+        "label": null,
+        "multi": false,
+        "name": "time_frame",
+        "options": [
+          {
+            "selected": true,
+            "text": "1d",
+            "value": "1d"
+          },
+          {
+            "selected": false,
+            "text": "7d",
+            "value": "7d"
+          },
+          {
+            "selected": false,
+            "text": "30d",
+            "value": "30d"
+          }
+        ],
+        "query": "1d,7d,30d",
+        "type": "custom"
       }
     ]
   },
@@ -906,6 +938,6 @@
   },
   "timezone": "",
   "title": "KPI - Downtime",
-  "version": 1
+  "version": 2
 }
 {%- endraw %}