Order of panels in displayed dashboard is different from .yml file
Summary
Panel are not presented in the expected order for a yml file.
Steps to reproduce
-
Enable monitoring metrics with the autodevops project.
-
Use the following dashboard:
metrics.yml
01
to 12
.
---
dashboard: Environment metrics
priority: 1
panel_groups:
- group: Charts 1
panels:
- title: Memory Usage (Total) 01
type: area-chart
y_label: Total Memory Used (GB)
metrics:
- id: system_metrics_kubernetes_container_memory_total
metric_id: 1
query_range: avg(sum(container_memory_usage_bytes{container_name!="POD",pod_name=~"^{{ci_environment_slug}}-(.*)",namespace="{{kube_namespace}}"})
by (job)) without (job) /1024/1024/1024
label: Total (GB)
unit: GB
- title: Memory Usage (Total) 02
type: area-chart
y_label: Total Memory Used (GB)
metrics:
- id: metric_2
metric_id: 2
query_range: container_memory_usage_bytes{container_name!="POD",pod_name=~"^{{ci_environment_slug}}-(.*)",namespace="{{kube_namespace}}"}
label: Total (GB)
unit: GB
- title: Memory Usage (Total) 03
type: area-chart
y_label: Total Memory Used (GB)
metrics:
- id: metric_3
metric_id: 3
query: avg(sum(container_memory_usage_bytes{container_name!="POD",pod_name=~"^{{ci_environment_slug}}-(.*)",namespace="{{kube_namespace}}"})
by (job)) without (job) /1024/1024/1024
label: Total (GB)
unit: GB
- title: Memory Usage (Total) 04
type: area-chart
y_label: Total Memory Used (GB)
metrics:
- id: metric_4
metric_id: 4
query: container_memory_usage_bytes{container_name!="POD",pod_name=~"^{{ci_environment_slug}}-(.*)",namespace="{{kube_namespace}}"}
label: Total (GB)
unit: GB
- title: Memory Usage (Total) 05
type: single-stat
y_label: Total Memory Used (GB)
metrics:
- id: metric_5
metric_id: 5
query: avg(sum(container_memory_usage_bytes{container_name!="POD",pod_name=~"^{{ci_environment_slug}}-(.*)",namespace="{{kube_namespace}}"})
by (job)) without (job) /1024/1024/1024
label: Total (GB)
unit: GB
- title: Memory Usage (Total) 06
type: single-stat
y_label: Total Memory Used (GB)
metrics:
- id: metric_6
metric_id: 6
query: container_memory_usage_bytes{container_name!="POD",pod_name=~"^{{ci_environment_slug}}-(.*)",namespace="{{kube_namespace}}"}
label: Total (GB)
unit: GB
- title: Memory Usage (Total) 07
type: column
y_label: Total Memory Used (GB) 7
metrics:
- id: metric_7
metric_id: 7
query: avg(sum(container_memory_usage_bytes{container_name!="POD",pod_name=~"^{{ci_environment_slug}}-(.*)",namespace="{{kube_namespace}}"})
by (job)) without (job) /1024/1024/1024
label: Total (GB)
unit: GB
- title: Memory Usage (Total) 08
type: column
y_label: Total Memory Used (GB) 8
metrics:
- id: metric_8
metric_id: 8
query: container_memory_usage_bytes{container_name!="POD",pod_name=~"^{{ci_environment_slug}}-(.*)",namespace="{{kube_namespace}}"}
label: Total (GB)
unit: GB
- title: Memory Usage (Total) 09
type: bar
y_label: Total Memory Used (GB) 9
metrics:
- id: metric_9
metric_id: 9
query: avg(sum(container_memory_usage_bytes{container_name!="POD",pod_name=~"^{{ci_environment_slug}}-(.*)",namespace="{{kube_namespace}}"})
by (job)) without (job) /1024/1024/1024
label: Total (GB)
unit: GB
- title: Memory Usage (Total) 10
type: bar
y_label: Total Memory Used (GB) 10
metrics:
- id: metric_10
metric_id: 10
query: container_memory_usage_bytes{container_name!="POD",pod_name=~"^{{ci_environment_slug}}-(.*)",namespace="{{kube_namespace}}"}
label: Total (GB)
unit: GB
- title: Memory Usage (Total) 11
type: heatmap
y_label: Total Memory Used (GB) 11
metrics:
- id: metric_11
metric_id: 11
query: avg(sum(container_memory_usage_bytes{container_name!="POD",pod_name=~"^{{ci_environment_slug}}-(.*)",namespace="{{kube_namespace}}"})
by (job)) without (job) /1024/1024/1024
label: Total (GB)
unit: GB
- title: Memory Usage (Total) 12
type: heatmap
y_label: Total Memory Used (GB) 12
metrics:
- id: metric_12
metric_id: 12
query: container_memory_usage_bytes{container_name!="POD",pod_name=~"^{{ci_environment_slug}}-(.*)",namespace="{{kube_namespace}}"}
label: Total (GB)
unit: GB
What is the current bug behavior?
The panels/charts are not in the same order as the original yml file. The chart 12 is in the first position.
What is the expected correct behavior?
The panels/charts are in the same order as the yml file.
Possible fixes
As far as I could see this happens in the backend. The json from metrics_dashboard.json
is not correct:
Edited by Miguel Rincon