Add validation (sanity-check) for dashboard yaml files "on load": At the moment of displaying the metrics dashboard
Background
On metrics dashboard page we currently only show limited number of dashboard schema errors, which prevents them from rendering including cases when: panel_groups, panels, metrics, query and query_range are missing
Proposal
We should display also warning message when selected dashboard schema has other issues which will not completely prevents it from rendering, but restrict users from utilizing all available features.
Due to UX debt #222320 (closed) currently only either warning or error can be displayed, but both of them at once.
How to test
Visit metrics dashboard page, and select dashboard with invalid schema for example dashboard which panel is missing title:
---
dashboard: Environment metrics
priority: 1
panel_groups:
- group: Response metrics (NGINX Ingress VTTS)
priority: 10
panels:
- type: area-chart
y_label: Latency (ms)
weight: 1
metrics:
- id: response_metrics_nginx_ingress_latency_pod_average
query_range: avg(nginx_upstream_response_msecs_avg{upstream=~"%{kube_namespace}-%{ci_environment_slug}-.*"})
label: Pod average (ms)
unit: ms
metric_id: 364
List of all performed validations is available at: https://docs.gitlab.com/ee/user/project/integrations/prometheus.html#dashboard-yaml-syntax-validation