Add possibility to set time_frame
Change-Id: I1aa29201100862bfd87c6bae601080434d5af4c5
Related-PROD: PROD-27906
(cherry picked from commit 1c5f78e37c7072997a54477affda447649e8c25c)
diff --git a/prometheus/files/grafana_dashboards/kpi_provisioning_prometheus.json b/prometheus/files/grafana_dashboards/kpi_provisioning_prometheus.json
index c532982..b96d270 100644
--- a/prometheus/files/grafana_dashboards/kpi_provisioning_prometheus.json
+++ b/prometheus/files/grafana_dashboards/kpi_provisioning_prometheus.json
@@ -28,7 +28,7 @@
},
"id": 17,
"panels": [],
- "title": "Today",
+ "title": "Last $time_frame total",
"type": "row"
},
{
@@ -93,7 +93,7 @@
"tableColumn": "",
"targets": [
{
- "expr": "1 - sum(compute_instance_create_error_event_doc_count) / sum(compute_instance_create_start_event_doc_count)",
+ "expr": "1 - increase(compute_instance_create_error_event_doc_count[$time_frame]) / increase(compute_instance_create_start_event_doc_count[$time_frame])",
"format": "time_series",
"intervalFactor": 1,
"legendFormat": "",
@@ -176,7 +176,7 @@
"tableColumn": "",
"targets": [
{
- "expr": "sum(compute_instance_create_start_event_doc_count)",
+ "expr": "floor(increase(compute_instance_create_start_event_doc_count[$time_frame]))",
"format": "time_series",
"interval": "30s",
"intervalFactor": 1,
@@ -260,7 +260,7 @@
"tableColumn": "",
"targets": [
{
- "expr": "sum(compute_instance_create_end_event_doc_count)",
+ "expr": "floor(increase(compute_instance_create_end_event_doc_count[$time_frame]))",
"format": "time_series",
"interval": "",
"intervalFactor": 1,
@@ -345,7 +345,7 @@
"tableColumn": "",
"targets": [
{
- "expr": "sum(compute_instance_create_error_event_doc_count)",
+ "expr": "floor(increase(compute_instance_create_error_event_doc_count[$time_frame]))",
"format": "time_series",
"hide": false,
"intervalFactor": 1,
@@ -700,7 +700,40 @@
"style": "dark",
"tags": [],
"templating": {
- "list": []
+ "list": [
+ {
+ "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"
+ }
+ ]
},
"time": {
"from": "now-30d",