Schema: convert dashboards from v1beta1 to v2beta1 (#109037)
- Implement full conversion pipeline from v1beta1 → v2beta1 - Ensure frontend–backend parity for all dashboard serialization paths - Add automatic data loss detection for conversions (panels, queries, annotations, links, variables) - Extract atomic conversion functions for v0 → v1beta1 → v2alpha1 → v2beta1 - Introduce conversion metrics and detailed logging for loss tracking - Normalize datasource resolution, defaults, and annotation processing - Improve panel layout serialization and y-coordinate normalization - Fix inconsistencies in nested panels and collapsed row behavior - Refine variable handling: - Filter refId from variable query specs - Default variable refresh to 'never' (matches frontend) - Fix constant and interval variable handling for missing queries - Unify schema defaults (enable, hide, iconColor, editable, liveNow) - Fix pluginId usage (UID vs type) and datasource references - Fix metrics.go bug swallowing errors (return nil → return err) - Add tests for version-specific conversion error handling - Add data loss detection tests using source/target version comparison - Clean up lint issues, legacy code, and redundant files - Update OpenAPI snapshots and migrated dashboards - Improve backend migrator to reuse datasource provider and match frontend logic Co-authored-by: Haris Rozajac <haris.rozajac12@gmail.com> Co-authored-by: Oscar Kilhed <oscar.kilhed@grafana.com> Co-authored-by: Stephanie Hingtgen <stephanie.hingtgen@grafana.com>
This commit is contained in:
co-authored by
Haris Rozajac
Oscar Kilhed
Stephanie Hingtgen
parent
09942c08db
commit
e463781077
Vendored
+1
-1
@@ -2147,4 +2147,4 @@
|
||||
"title": "Panel tests - Gauge (new)",
|
||||
"uid": "panel-tests-gauge-new",
|
||||
"weekStart": ""
|
||||
}
|
||||
}
|
||||
Vendored
+1
-1
@@ -384,4 +384,4 @@
|
||||
"title": "Heatmap X axis",
|
||||
"uid": "5Y0jv6pVz",
|
||||
"weekStart": ""
|
||||
}
|
||||
}
|
||||
+51
-46
@@ -10,7 +10,7 @@
|
||||
"enable": true,
|
||||
"hide": true,
|
||||
"iconColor": "rgba(0, 211, 255, 1)",
|
||||
"name": "Annotations & Alerts",
|
||||
"name": "Annotations \u0026 Alerts",
|
||||
"target": {
|
||||
"limit": 100,
|
||||
"matchAny": false,
|
||||
@@ -1071,32 +1071,27 @@
|
||||
"type": "status-history"
|
||||
},
|
||||
{
|
||||
"id": 15,
|
||||
"type": "status-history",
|
||||
"title": "no data",
|
||||
"gridPos": {
|
||||
"x": 18,
|
||||
"y": 18,
|
||||
"h": 9,
|
||||
"w": 6
|
||||
"datasource": {
|
||||
"type": "grafana-testdata-datasource"
|
||||
},
|
||||
"fieldConfig": {
|
||||
"defaults": {
|
||||
"custom": {
|
||||
"lineWidth": 0,
|
||||
"fillOpacity": 70,
|
||||
"spanNulls": false,
|
||||
"insertNulls": false,
|
||||
"hideFrom": {
|
||||
"tooltip": false,
|
||||
"viz": false,
|
||||
"legend": false
|
||||
},
|
||||
"axisPlacement": "auto"
|
||||
},
|
||||
"color": {
|
||||
"mode": "palette-classic"
|
||||
},
|
||||
"custom": {
|
||||
"axisPlacement": "auto",
|
||||
"fillOpacity": 70,
|
||||
"hideFrom": {
|
||||
"legend": false,
|
||||
"tooltip": false,
|
||||
"viz": false
|
||||
},
|
||||
"insertNulls": false,
|
||||
"lineWidth": 0,
|
||||
"spanNulls": false
|
||||
},
|
||||
"fieldMinMax": false,
|
||||
"mappings": [],
|
||||
"thresholds": {
|
||||
"mode": "absolute",
|
||||
@@ -1105,44 +1100,54 @@
|
||||
"color": "green"
|
||||
}
|
||||
]
|
||||
},
|
||||
"fieldMinMax": false
|
||||
}
|
||||
},
|
||||
"overrides": []
|
||||
},
|
||||
"gridPos": {
|
||||
"h": 9,
|
||||
"w": 6,
|
||||
"x": 18,
|
||||
"y": 18
|
||||
},
|
||||
"id": 15,
|
||||
"options": {
|
||||
"alignValue": "center",
|
||||
"legend": {
|
||||
"displayMode": "list",
|
||||
"placement": "bottom",
|
||||
"showLegend": true
|
||||
},
|
||||
"mergeValues": true,
|
||||
"rowHeight": 0.9,
|
||||
"showValue": "auto",
|
||||
"tooltip": {
|
||||
"hideZeros": false,
|
||||
"mode": "single",
|
||||
"sort": "none"
|
||||
}
|
||||
},
|
||||
"pluginVersion": "12.3.0-pre",
|
||||
"targets": [
|
||||
{
|
||||
"scenarioId": "random_walk",
|
||||
"refId": "A",
|
||||
"scenarioId": "random_walk",
|
||||
"seriesCount": 0
|
||||
}
|
||||
],
|
||||
"datasource": {
|
||||
"type": "grafana-testdata-datasource"
|
||||
},
|
||||
"options": {
|
||||
"mergeValues": true,
|
||||
"showValue": "auto",
|
||||
"alignValue": "center",
|
||||
"rowHeight": 0.9,
|
||||
"legend": {
|
||||
"showLegend": true,
|
||||
"displayMode": "list",
|
||||
"placement": "bottom"
|
||||
},
|
||||
"tooltip": {
|
||||
"mode": "single",
|
||||
"sort": "none",
|
||||
"hideZeros": false
|
||||
}
|
||||
}
|
||||
"title": "no data",
|
||||
"type": "status-history"
|
||||
}
|
||||
],
|
||||
"preload": false,
|
||||
"refresh": "",
|
||||
"schemaVersion": 42,
|
||||
"tags": ["gdev", "panel-tests", "state-timeline", "graph-ng"],
|
||||
"tags": [
|
||||
"gdev",
|
||||
"panel-tests",
|
||||
"state-timeline",
|
||||
"graph-ng"
|
||||
],
|
||||
"templating": {
|
||||
"list": []
|
||||
},
|
||||
@@ -1152,7 +1157,7 @@
|
||||
},
|
||||
"timepicker": {},
|
||||
"timezone": "utc",
|
||||
"title": "StatusHistory - Thresholds & Mappings",
|
||||
"title": "StatusHistory - Thresholds \u0026 Mappings",
|
||||
"uid": "a2f4ad9e-3b44-4624-8067-35f31be5d309",
|
||||
"weekStart": ""
|
||||
}
|
||||
}
|
||||
+27
-22
@@ -183,6 +183,24 @@
|
||||
},
|
||||
"fieldConfig": {
|
||||
"defaults": {
|
||||
"actions": [
|
||||
{
|
||||
"fetch": {
|
||||
"body": "{}",
|
||||
"headers": [
|
||||
[
|
||||
"Content-Type",
|
||||
"application/json"
|
||||
]
|
||||
],
|
||||
"method": "GET",
|
||||
"queryParams": [],
|
||||
"url": "/api/health"
|
||||
},
|
||||
"title": "Get instance health",
|
||||
"type": "fetch"
|
||||
}
|
||||
],
|
||||
"color": {
|
||||
"fixedColor": "blue",
|
||||
"mode": "shades"
|
||||
@@ -195,6 +213,13 @@
|
||||
},
|
||||
"inspect": false
|
||||
},
|
||||
"links": [
|
||||
{
|
||||
"targetBlank": true,
|
||||
"title": "Google Grafana",
|
||||
"url": "https://google.com/search?q=grafana"
|
||||
}
|
||||
],
|
||||
"mappings": [],
|
||||
"thresholds": {
|
||||
"mode": "absolute",
|
||||
@@ -208,27 +233,7 @@
|
||||
"value": 80
|
||||
}
|
||||
]
|
||||
},
|
||||
"actions": [
|
||||
{
|
||||
"fetch": {
|
||||
"body": "{}",
|
||||
"headers": [["Content-Type", "application/json"]],
|
||||
"method": "GET",
|
||||
"queryParams": [],
|
||||
"url": "/api/health"
|
||||
},
|
||||
"title": "Get instance health",
|
||||
"type": "fetch"
|
||||
}
|
||||
],
|
||||
"links": [
|
||||
{
|
||||
"targetBlank": true,
|
||||
"title": "Google Grafana",
|
||||
"url": "https://google.com/search?q=grafana"
|
||||
}
|
||||
]
|
||||
}
|
||||
},
|
||||
"overrides": []
|
||||
},
|
||||
@@ -612,4 +617,4 @@
|
||||
"title": "Panel Tests - Table - Sparklines",
|
||||
"uid": "d6373b49-1957-4f00-9218-ee2120d3ecd9",
|
||||
"weekStart": ""
|
||||
}
|
||||
}
|
||||
+43
-43
@@ -1071,32 +1071,27 @@
|
||||
"type": "state-timeline"
|
||||
},
|
||||
{
|
||||
"id": 15,
|
||||
"type": "state-timeline",
|
||||
"title": "no data",
|
||||
"gridPos": {
|
||||
"x": 18,
|
||||
"y": 18,
|
||||
"h": 9,
|
||||
"w": 6
|
||||
"datasource": {
|
||||
"type": "grafana-testdata-datasource"
|
||||
},
|
||||
"fieldConfig": {
|
||||
"defaults": {
|
||||
"custom": {
|
||||
"lineWidth": 0,
|
||||
"fillOpacity": 70,
|
||||
"spanNulls": false,
|
||||
"insertNulls": false,
|
||||
"hideFrom": {
|
||||
"tooltip": false,
|
||||
"viz": false,
|
||||
"legend": false
|
||||
},
|
||||
"axisPlacement": "auto"
|
||||
},
|
||||
"color": {
|
||||
"mode": "palette-classic"
|
||||
},
|
||||
"custom": {
|
||||
"axisPlacement": "auto",
|
||||
"fillOpacity": 70,
|
||||
"hideFrom": {
|
||||
"legend": false,
|
||||
"tooltip": false,
|
||||
"viz": false
|
||||
},
|
||||
"insertNulls": false,
|
||||
"lineWidth": 0,
|
||||
"spanNulls": false
|
||||
},
|
||||
"fieldMinMax": false,
|
||||
"mappings": [],
|
||||
"thresholds": {
|
||||
"mode": "absolute",
|
||||
@@ -1105,38 +1100,43 @@
|
||||
"color": "green"
|
||||
}
|
||||
]
|
||||
},
|
||||
"fieldMinMax": false
|
||||
}
|
||||
},
|
||||
"overrides": []
|
||||
},
|
||||
"gridPos": {
|
||||
"h": 9,
|
||||
"w": 6,
|
||||
"x": 18,
|
||||
"y": 18
|
||||
},
|
||||
"id": 15,
|
||||
"options": {
|
||||
"alignValue": "center",
|
||||
"legend": {
|
||||
"displayMode": "list",
|
||||
"placement": "bottom",
|
||||
"showLegend": true
|
||||
},
|
||||
"mergeValues": true,
|
||||
"rowHeight": 0.9,
|
||||
"showValue": "auto",
|
||||
"tooltip": {
|
||||
"hideZeros": false,
|
||||
"mode": "single",
|
||||
"sort": "none"
|
||||
}
|
||||
},
|
||||
"pluginVersion": "12.3.0-pre",
|
||||
"targets": [
|
||||
{
|
||||
"scenarioId": "random_walk",
|
||||
"refId": "A",
|
||||
"scenarioId": "random_walk",
|
||||
"seriesCount": 0
|
||||
}
|
||||
],
|
||||
"datasource": {
|
||||
"type": "grafana-testdata-datasource"
|
||||
},
|
||||
"options": {
|
||||
"mergeValues": true,
|
||||
"showValue": "auto",
|
||||
"alignValue": "center",
|
||||
"rowHeight": 0.9,
|
||||
"legend": {
|
||||
"showLegend": true,
|
||||
"displayMode": "list",
|
||||
"placement": "bottom"
|
||||
},
|
||||
"tooltip": {
|
||||
"mode": "single",
|
||||
"sort": "none",
|
||||
"hideZeros": false
|
||||
}
|
||||
}
|
||||
"title": "no data",
|
||||
"type": "state-timeline"
|
||||
}
|
||||
],
|
||||
"preload": false,
|
||||
@@ -1160,4 +1160,4 @@
|
||||
"title": "StateTimeline - Thresholds \u0026 Mappings",
|
||||
"uid": "Kce7z9TVz",
|
||||
"weekStart": ""
|
||||
}
|
||||
}
|
||||
@@ -40,13 +40,7 @@
|
||||
]
|
||||
},
|
||||
"annotations": {
|
||||
"list": [
|
||||
{
|
||||
"name": "Annotations & Alerts",
|
||||
"datasource": "grafana",
|
||||
"enable": true
|
||||
}
|
||||
]
|
||||
"list": []
|
||||
},
|
||||
"time": {
|
||||
"from": "now-6h",
|
||||
|
||||
@@ -43,7 +43,10 @@
|
||||
"list": [
|
||||
{
|
||||
"name": "Annotations & Alerts",
|
||||
"datasource": "grafana",
|
||||
"datasource": {
|
||||
"type": "grafana",
|
||||
"uid": "grafana"
|
||||
},
|
||||
"enable": true
|
||||
}
|
||||
]
|
||||
|
||||
+3
-1
@@ -110,7 +110,9 @@
|
||||
"enable": true,
|
||||
"iconColor": "purple",
|
||||
"datasource": {
|
||||
"uid": "prometheus"
|
||||
"uid": "default-ds-uid",
|
||||
"type": "prometheus",
|
||||
"apiVersion": "v1"
|
||||
}
|
||||
}
|
||||
]
|
||||
|
||||
@@ -34,6 +34,8 @@
|
||||
{
|
||||
"name": "Unknown Datasource Annotation - Tests unknown datasource preserved as UID",
|
||||
"datasource": {
|
||||
"type": "prometheus",
|
||||
"apiVersion": "v1",
|
||||
"uid": "unknown-datasource-name"
|
||||
}
|
||||
}
|
||||
@@ -119,7 +121,9 @@
|
||||
{
|
||||
"refId": "B",
|
||||
"datasource": {
|
||||
"uid": "existing-target-uid"
|
||||
"uid": "existing-target-uid",
|
||||
"type": "elasticsearch",
|
||||
"apiVersion": "v2"
|
||||
}
|
||||
}
|
||||
]
|
||||
@@ -137,7 +141,8 @@
|
||||
"refId": "A",
|
||||
"datasource": {
|
||||
"uid": "existing-target-uid",
|
||||
"type": "elasticsearch"
|
||||
"type": "elasticsearch",
|
||||
"apiVersion": "v2"
|
||||
}
|
||||
}
|
||||
]
|
||||
@@ -167,7 +172,9 @@
|
||||
{
|
||||
"refId": "A",
|
||||
"datasource": {
|
||||
"uid": "existing-target-uid"
|
||||
"uid": "existing-target-uid",
|
||||
"type": "elasticsearch",
|
||||
"apiVersion": "v2"
|
||||
}
|
||||
},
|
||||
{
|
||||
@@ -188,7 +195,9 @@
|
||||
{
|
||||
"refId": "A",
|
||||
"datasource": {
|
||||
"uid": "existing-target-uid"
|
||||
"uid": "existing-target-uid",
|
||||
"type": "elasticsearch",
|
||||
"apiVersion": "v2"
|
||||
}
|
||||
}
|
||||
]
|
||||
@@ -257,7 +266,9 @@
|
||||
{
|
||||
"refId": "A",
|
||||
"datasource": {
|
||||
"uid": "existing-target-uid"
|
||||
"uid": "existing-target-uid",
|
||||
"type": "elasticsearch",
|
||||
"apiVersion": "v2"
|
||||
}
|
||||
}
|
||||
]
|
||||
|
||||
@@ -0,0 +1,31 @@
|
||||
{
|
||||
"title": "v42 Migration Test - Harky Must",
|
||||
"schemaVersion": 41,
|
||||
"panels": [
|
||||
{
|
||||
"id": 1,
|
||||
"title": "Panel with hideFrom.viz = true",
|
||||
"type": "timeseries",
|
||||
"fieldConfig": {
|
||||
"defaults": {},
|
||||
"overrides": [
|
||||
{
|
||||
"matcher": {
|
||||
"id": "byName",
|
||||
"options": "Field1"
|
||||
},
|
||||
"properties": [
|
||||
{
|
||||
"id": "custom.hideFrom",
|
||||
"value": {
|
||||
"viz": true
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
|
||||
@@ -49,14 +49,22 @@
|
||||
]
|
||||
},
|
||||
{
|
||||
"__systemRef": "hideSeriesFrom",
|
||||
"matcher": {
|
||||
"id": "__systemRef",
|
||||
"options": "hiddenSeries"
|
||||
"id": "byNames",
|
||||
"options": {
|
||||
"mode": "exclude",
|
||||
"names": ["foo"],
|
||||
"prefix": "All except:",
|
||||
"readOnly": true
|
||||
}
|
||||
},
|
||||
"properties": [
|
||||
{
|
||||
"id": "custom.hideFrom",
|
||||
"value": {
|
||||
"legend": false,
|
||||
"tooltip": false,
|
||||
"viz": true
|
||||
}
|
||||
}
|
||||
@@ -103,6 +111,10 @@
|
||||
"defaults": {},
|
||||
"overrides": [
|
||||
{
|
||||
"matcher": {
|
||||
"id": "byName",
|
||||
"options": "Time"
|
||||
},
|
||||
"properties": [
|
||||
{
|
||||
"id": "unit",
|
||||
@@ -123,13 +135,18 @@
|
||||
"defaults": {},
|
||||
"overrides": [
|
||||
{
|
||||
"matcher": {
|
||||
"id": "byValue",
|
||||
"options": {
|
||||
"op": "gte",
|
||||
"reducer": "allIsZero",
|
||||
"value": 0
|
||||
}
|
||||
},
|
||||
"properties": [
|
||||
{
|
||||
"id": "custom.hideFrom",
|
||||
"value": {
|
||||
"viz": false,
|
||||
"tooltip": false
|
||||
}
|
||||
"id": "unit",
|
||||
"value": "short"
|
||||
}
|
||||
]
|
||||
}
|
||||
@@ -144,12 +161,17 @@
|
||||
"defaults": {},
|
||||
"overrides": [
|
||||
{
|
||||
"matcher": {
|
||||
"id": "byName",
|
||||
"options": "{__name__=\"ALERTS\", alertname=\"k6CloudServiceErrorsLogged\"}"
|
||||
},
|
||||
"properties": [
|
||||
{
|
||||
"id": "custom.hideFrom",
|
||||
"value": {
|
||||
"viz": true,
|
||||
"tooltip": false
|
||||
"legend": false,
|
||||
"tooltip": false,
|
||||
"viz": true
|
||||
}
|
||||
}
|
||||
]
|
||||
|
||||
+12
-4
@@ -12,14 +12,20 @@
|
||||
"annotations": [
|
||||
{
|
||||
"name": "deployment",
|
||||
"datasource": "prometheus",
|
||||
"datasource": {
|
||||
"uid": "default-ds-uid",
|
||||
"type": "prometheus"
|
||||
},
|
||||
"enable": true,
|
||||
"iconColor": "red",
|
||||
"query": "ALERTS{alertname=\"DeploymentStarted\"}"
|
||||
},
|
||||
{
|
||||
"name": "alerts",
|
||||
"datasource": "loki",
|
||||
"datasource": {
|
||||
"uid": "loki-uid",
|
||||
"type": "loki"
|
||||
},
|
||||
"enable": false,
|
||||
"iconColor": "yellow",
|
||||
"query": "{job=\"alertmanager\"}"
|
||||
@@ -32,12 +38,14 @@
|
||||
{
|
||||
"name": "environment",
|
||||
"type": "filter",
|
||||
"allFormat": null
|
||||
"allFormat": null,
|
||||
"query": "label_values(up, instance)"
|
||||
},
|
||||
{
|
||||
"name": "service",
|
||||
"datasource": "prometheus",
|
||||
"allFormat": "glob"
|
||||
"allFormat": "glob",
|
||||
"query": "label_values(up, instance)"
|
||||
},
|
||||
{
|
||||
"name": "region",
|
||||
|
||||
-7
@@ -12,13 +12,6 @@
|
||||
"iconColor": "rgba(0, 211, 255, 1)",
|
||||
"name": "Annotations \u0026 Alerts",
|
||||
"type": "dashboard"
|
||||
},
|
||||
{
|
||||
"datasource": {
|
||||
"uid": "grafana"
|
||||
},
|
||||
"enable": true,
|
||||
"name": "Annotations \u0026 Alerts"
|
||||
}
|
||||
]
|
||||
},
|
||||
|
||||
+1
@@ -15,6 +15,7 @@
|
||||
},
|
||||
{
|
||||
"datasource": {
|
||||
"type": "grafana",
|
||||
"uid": "grafana"
|
||||
},
|
||||
"enable": true,
|
||||
|
||||
Vendored
+4
-2
@@ -128,6 +128,7 @@
|
||||
"type": "table"
|
||||
},
|
||||
{
|
||||
"autoMigrateFrom": "graph",
|
||||
"gridPos": {
|
||||
"h": 6,
|
||||
"w": 12,
|
||||
@@ -137,9 +138,10 @@
|
||||
"height": 200,
|
||||
"id": 4,
|
||||
"title": "Network I/O",
|
||||
"type": "graph"
|
||||
"type": "timeseries"
|
||||
},
|
||||
{
|
||||
"autoMigrateFrom": "graph",
|
||||
"gridPos": {
|
||||
"h": 6,
|
||||
"w": 12,
|
||||
@@ -149,7 +151,7 @@
|
||||
"height": 200,
|
||||
"id": 5,
|
||||
"title": "Disk I/O",
|
||||
"type": "graph"
|
||||
"type": "timeseries"
|
||||
}
|
||||
],
|
||||
"targets": [
|
||||
|
||||
+2
-1
@@ -50,9 +50,10 @@
|
||||
"id": 4,
|
||||
"panels": [
|
||||
{
|
||||
"autoMigrateFrom": "graph",
|
||||
"id": 6,
|
||||
"title": "Normal nested panel",
|
||||
"type": "graph"
|
||||
"type": "timeseries"
|
||||
}
|
||||
],
|
||||
"targets": [
|
||||
|
||||
Vendored
+3
-1
@@ -115,7 +115,9 @@
|
||||
},
|
||||
{
|
||||
"datasource": {
|
||||
"uid": "prometheus"
|
||||
"apiVersion": "v1",
|
||||
"type": "prometheus",
|
||||
"uid": "default-ds-uid"
|
||||
},
|
||||
"enable": true,
|
||||
"iconColor": "purple",
|
||||
|
||||
+17
@@ -47,6 +47,8 @@
|
||||
},
|
||||
{
|
||||
"datasource": {
|
||||
"apiVersion": "v1",
|
||||
"type": "prometheus",
|
||||
"uid": "unknown-datasource-name"
|
||||
},
|
||||
"name": "Unknown Datasource Annotation - Tests unknown datasource preserved as UID"
|
||||
@@ -135,6 +137,8 @@
|
||||
},
|
||||
{
|
||||
"datasource": {
|
||||
"apiVersion": "v2",
|
||||
"type": "elasticsearch",
|
||||
"uid": "existing-target-uid"
|
||||
},
|
||||
"refId": "B"
|
||||
@@ -152,6 +156,7 @@
|
||||
"targets": [
|
||||
{
|
||||
"datasource": {
|
||||
"apiVersion": "v2",
|
||||
"type": "elasticsearch",
|
||||
"uid": "existing-target-uid"
|
||||
},
|
||||
@@ -178,6 +183,8 @@
|
||||
},
|
||||
{
|
||||
"datasource": {
|
||||
"apiVersion": "v2",
|
||||
"type": "elasticsearch",
|
||||
"uid": "existing-target-uid"
|
||||
},
|
||||
"description": "Tests panel with expression query - should not inherit expression as panel datasource",
|
||||
@@ -185,6 +192,8 @@
|
||||
"targets": [
|
||||
{
|
||||
"datasource": {
|
||||
"apiVersion": "v2",
|
||||
"type": "elasticsearch",
|
||||
"uid": "existing-target-uid"
|
||||
},
|
||||
"refId": "A"
|
||||
@@ -201,6 +210,8 @@
|
||||
},
|
||||
{
|
||||
"datasource": {
|
||||
"apiVersion": "v2",
|
||||
"type": "elasticsearch",
|
||||
"uid": "existing-target-uid"
|
||||
},
|
||||
"description": "Tests panel inheriting datasource from target when panel datasource was default",
|
||||
@@ -208,6 +219,8 @@
|
||||
"targets": [
|
||||
{
|
||||
"datasource": {
|
||||
"apiVersion": "v2",
|
||||
"type": "elasticsearch",
|
||||
"uid": "existing-target-uid"
|
||||
},
|
||||
"refId": "A"
|
||||
@@ -290,6 +303,8 @@
|
||||
"panels": [
|
||||
{
|
||||
"datasource": {
|
||||
"apiVersion": "v2",
|
||||
"type": "elasticsearch",
|
||||
"uid": "existing-target-uid"
|
||||
},
|
||||
"description": "Nested panel in collapsed row with default datasource",
|
||||
@@ -297,6 +312,8 @@
|
||||
"targets": [
|
||||
{
|
||||
"datasource": {
|
||||
"apiVersion": "v2",
|
||||
"type": "elasticsearch",
|
||||
"uid": "existing-target-uid"
|
||||
},
|
||||
"refId": "A"
|
||||
|
||||
Vendored
+2
-1
@@ -117,6 +117,7 @@
|
||||
"type": "timeseries"
|
||||
},
|
||||
{
|
||||
"autoMigrateFrom": "graph",
|
||||
"id": 12,
|
||||
"options": {
|
||||
"legend": {
|
||||
@@ -125,7 +126,7 @@
|
||||
}
|
||||
},
|
||||
"title": "Nested Panel with Hidden DisplayMode",
|
||||
"type": "graph"
|
||||
"type": "timeseries"
|
||||
},
|
||||
{
|
||||
"id": 13,
|
||||
|
||||
+62
@@ -0,0 +1,62 @@
|
||||
{
|
||||
"annotations": {
|
||||
"list": [
|
||||
{
|
||||
"builtIn": 1,
|
||||
"datasource": {
|
||||
"type": "grafana",
|
||||
"uid": "-- Grafana --"
|
||||
},
|
||||
"enable": true,
|
||||
"hide": true,
|
||||
"iconColor": "rgba(0, 211, 255, 1)",
|
||||
"name": "Annotations \u0026 Alerts",
|
||||
"type": "dashboard"
|
||||
}
|
||||
]
|
||||
},
|
||||
"editable": true,
|
||||
"fiscalYearStartMonth": 0,
|
||||
"graphTooltip": 0,
|
||||
"links": [],
|
||||
"panels": [
|
||||
{
|
||||
"fieldConfig": {
|
||||
"defaults": {},
|
||||
"overrides": [
|
||||
{
|
||||
"matcher": {
|
||||
"id": "byName",
|
||||
"options": "Field1"
|
||||
},
|
||||
"properties": [
|
||||
{
|
||||
"id": "custom.hideFrom",
|
||||
"value": {
|
||||
"tooltip": true,
|
||||
"viz": true
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
]
|
||||
},
|
||||
"id": 1,
|
||||
"title": "Panel with hideFrom.viz = true",
|
||||
"type": "timeseries"
|
||||
}
|
||||
],
|
||||
"schemaVersion": 42,
|
||||
"tags": [],
|
||||
"templating": {
|
||||
"list": []
|
||||
},
|
||||
"time": {
|
||||
"from": "now-6h",
|
||||
"to": "now"
|
||||
},
|
||||
"timepicker": {},
|
||||
"timezone": "",
|
||||
"title": "v42 Migration Test - Harky Must",
|
||||
"weekStart": ""
|
||||
}
|
||||
+30
-7
@@ -67,14 +67,23 @@
|
||||
]
|
||||
},
|
||||
{
|
||||
"__systemRef": "hideSeriesFrom",
|
||||
"matcher": {
|
||||
"id": "__systemRef",
|
||||
"options": "hiddenSeries"
|
||||
"id": "byNames",
|
||||
"options": {
|
||||
"mode": "exclude",
|
||||
"names": [
|
||||
"foo"
|
||||
],
|
||||
"prefix": "All except:",
|
||||
"readOnly": true
|
||||
}
|
||||
},
|
||||
"properties": [
|
||||
{
|
||||
"id": "custom.hideFrom",
|
||||
"value": {
|
||||
"legend": false,
|
||||
"tooltip": true,
|
||||
"viz": true
|
||||
}
|
||||
@@ -121,6 +130,10 @@
|
||||
"defaults": {},
|
||||
"overrides": [
|
||||
{
|
||||
"matcher": {
|
||||
"id": "byName",
|
||||
"options": "Time"
|
||||
},
|
||||
"properties": [
|
||||
{
|
||||
"id": "unit",
|
||||
@@ -143,13 +156,18 @@
|
||||
"defaults": {},
|
||||
"overrides": [
|
||||
{
|
||||
"matcher": {
|
||||
"id": "byValue",
|
||||
"options": {
|
||||
"op": "gte",
|
||||
"reducer": "allIsZero",
|
||||
"value": 0
|
||||
}
|
||||
},
|
||||
"properties": [
|
||||
{
|
||||
"id": "custom.hideFrom",
|
||||
"value": {
|
||||
"tooltip": false,
|
||||
"viz": false
|
||||
}
|
||||
"id": "unit",
|
||||
"value": "short"
|
||||
}
|
||||
]
|
||||
}
|
||||
@@ -164,10 +182,15 @@
|
||||
"defaults": {},
|
||||
"overrides": [
|
||||
{
|
||||
"matcher": {
|
||||
"id": "byName",
|
||||
"options": "{__name__=\"ALERTS\", alertname=\"k6CloudServiceErrorsLogged\"}"
|
||||
},
|
||||
"properties": [
|
||||
{
|
||||
"id": "custom.hideFrom",
|
||||
"value": {
|
||||
"legend": false,
|
||||
"tooltip": true,
|
||||
"viz": true
|
||||
}
|
||||
|
||||
Vendored
+6
-2
@@ -15,7 +15,8 @@
|
||||
},
|
||||
{
|
||||
"datasource": {
|
||||
"uid": "prometheus"
|
||||
"type": "prometheus",
|
||||
"uid": "default-ds-uid"
|
||||
},
|
||||
"enable": true,
|
||||
"iconColor": "red",
|
||||
@@ -24,7 +25,8 @@
|
||||
},
|
||||
{
|
||||
"datasource": {
|
||||
"uid": "loki"
|
||||
"type": "loki",
|
||||
"uid": "loki-uid"
|
||||
},
|
||||
"enable": false,
|
||||
"iconColor": "yellow",
|
||||
@@ -108,6 +110,7 @@
|
||||
},
|
||||
"name": "environment",
|
||||
"options": [],
|
||||
"query": "label_values(up, instance)",
|
||||
"refresh": 1,
|
||||
"type": "query"
|
||||
},
|
||||
@@ -116,6 +119,7 @@
|
||||
"datasource": "prometheus",
|
||||
"name": "service",
|
||||
"options": [],
|
||||
"query": "label_values(up, instance)",
|
||||
"refresh": 1,
|
||||
"type": "query"
|
||||
},
|
||||
|
||||
-5
@@ -12,11 +12,6 @@
|
||||
"iconColor": "rgba(0, 211, 255, 1)",
|
||||
"name": "Annotations \u0026 Alerts",
|
||||
"type": "dashboard"
|
||||
},
|
||||
{
|
||||
"datasource": "grafana",
|
||||
"enable": true,
|
||||
"name": "Annotations \u0026 Alerts"
|
||||
}
|
||||
]
|
||||
},
|
||||
|
||||
+4
-1
@@ -14,7 +14,10 @@
|
||||
"type": "dashboard"
|
||||
},
|
||||
{
|
||||
"datasource": "grafana",
|
||||
"datasource": {
|
||||
"type": "grafana",
|
||||
"uid": "grafana"
|
||||
},
|
||||
"enable": true,
|
||||
"name": "Annotations \u0026 Alerts"
|
||||
}
|
||||
|
||||
Vendored
+4
-2
@@ -78,6 +78,7 @@
|
||||
"type": "table"
|
||||
},
|
||||
{
|
||||
"autoMigrateFrom": "graph",
|
||||
"gridPos": {
|
||||
"h": 6,
|
||||
"w": 12,
|
||||
@@ -87,9 +88,10 @@
|
||||
"height": 200,
|
||||
"id": 4,
|
||||
"title": "Network I/O",
|
||||
"type": "graph"
|
||||
"type": "timeseries"
|
||||
},
|
||||
{
|
||||
"autoMigrateFrom": "graph",
|
||||
"gridPos": {
|
||||
"h": 6,
|
||||
"w": 12,
|
||||
@@ -99,7 +101,7 @@
|
||||
"height": 200,
|
||||
"id": 5,
|
||||
"title": "Disk I/O",
|
||||
"type": "graph"
|
||||
"type": "timeseries"
|
||||
}
|
||||
],
|
||||
"title": "Collapsed Row",
|
||||
|
||||
+2
-1
@@ -30,9 +30,10 @@
|
||||
"id": 4,
|
||||
"panels": [
|
||||
{
|
||||
"autoMigrateFrom": "graph",
|
||||
"id": 6,
|
||||
"title": "Normal nested panel",
|
||||
"type": "graph"
|
||||
"type": "timeseries"
|
||||
}
|
||||
],
|
||||
"title": "Row with repeated panels",
|
||||
|
||||
Vendored
+3
-1
@@ -115,7 +115,9 @@
|
||||
},
|
||||
{
|
||||
"datasource": {
|
||||
"uid": "prometheus"
|
||||
"apiVersion": "v1",
|
||||
"type": "prometheus",
|
||||
"uid": "default-ds-uid"
|
||||
},
|
||||
"enable": true,
|
||||
"iconColor": "purple",
|
||||
|
||||
+17
@@ -47,6 +47,8 @@
|
||||
},
|
||||
{
|
||||
"datasource": {
|
||||
"apiVersion": "v1",
|
||||
"type": "prometheus",
|
||||
"uid": "unknown-datasource-name"
|
||||
},
|
||||
"name": "Unknown Datasource Annotation - Tests unknown datasource preserved as UID"
|
||||
@@ -135,6 +137,8 @@
|
||||
},
|
||||
{
|
||||
"datasource": {
|
||||
"apiVersion": "v2",
|
||||
"type": "elasticsearch",
|
||||
"uid": "existing-target-uid"
|
||||
},
|
||||
"refId": "B"
|
||||
@@ -152,6 +156,7 @@
|
||||
"targets": [
|
||||
{
|
||||
"datasource": {
|
||||
"apiVersion": "v2",
|
||||
"type": "elasticsearch",
|
||||
"uid": "existing-target-uid"
|
||||
},
|
||||
@@ -178,6 +183,8 @@
|
||||
},
|
||||
{
|
||||
"datasource": {
|
||||
"apiVersion": "v2",
|
||||
"type": "elasticsearch",
|
||||
"uid": "existing-target-uid"
|
||||
},
|
||||
"description": "Tests panel with expression query - should not inherit expression as panel datasource",
|
||||
@@ -185,6 +192,8 @@
|
||||
"targets": [
|
||||
{
|
||||
"datasource": {
|
||||
"apiVersion": "v2",
|
||||
"type": "elasticsearch",
|
||||
"uid": "existing-target-uid"
|
||||
},
|
||||
"refId": "A"
|
||||
@@ -201,6 +210,8 @@
|
||||
},
|
||||
{
|
||||
"datasource": {
|
||||
"apiVersion": "v2",
|
||||
"type": "elasticsearch",
|
||||
"uid": "existing-target-uid"
|
||||
},
|
||||
"description": "Tests panel inheriting datasource from target when panel datasource was default",
|
||||
@@ -208,6 +219,8 @@
|
||||
"targets": [
|
||||
{
|
||||
"datasource": {
|
||||
"apiVersion": "v2",
|
||||
"type": "elasticsearch",
|
||||
"uid": "existing-target-uid"
|
||||
},
|
||||
"refId": "A"
|
||||
@@ -290,6 +303,8 @@
|
||||
"panels": [
|
||||
{
|
||||
"datasource": {
|
||||
"apiVersion": "v2",
|
||||
"type": "elasticsearch",
|
||||
"uid": "existing-target-uid"
|
||||
},
|
||||
"description": "Nested panel in collapsed row with default datasource",
|
||||
@@ -297,6 +312,8 @@
|
||||
"targets": [
|
||||
{
|
||||
"datasource": {
|
||||
"apiVersion": "v2",
|
||||
"type": "elasticsearch",
|
||||
"uid": "existing-target-uid"
|
||||
},
|
||||
"refId": "A"
|
||||
|
||||
Vendored
+2
-1
@@ -117,6 +117,7 @@
|
||||
"type": "timeseries"
|
||||
},
|
||||
{
|
||||
"autoMigrateFrom": "graph",
|
||||
"id": 12,
|
||||
"options": {
|
||||
"legend": {
|
||||
@@ -125,7 +126,7 @@
|
||||
}
|
||||
},
|
||||
"title": "Nested Panel with Hidden DisplayMode",
|
||||
"type": "graph"
|
||||
"type": "timeseries"
|
||||
},
|
||||
{
|
||||
"id": 13,
|
||||
|
||||
+62
@@ -0,0 +1,62 @@
|
||||
{
|
||||
"annotations": {
|
||||
"list": [
|
||||
{
|
||||
"builtIn": 1,
|
||||
"datasource": {
|
||||
"type": "grafana",
|
||||
"uid": "-- Grafana --"
|
||||
},
|
||||
"enable": true,
|
||||
"hide": true,
|
||||
"iconColor": "rgba(0, 211, 255, 1)",
|
||||
"name": "Annotations \u0026 Alerts",
|
||||
"type": "dashboard"
|
||||
}
|
||||
]
|
||||
},
|
||||
"editable": true,
|
||||
"fiscalYearStartMonth": 0,
|
||||
"graphTooltip": 0,
|
||||
"links": [],
|
||||
"panels": [
|
||||
{
|
||||
"fieldConfig": {
|
||||
"defaults": {},
|
||||
"overrides": [
|
||||
{
|
||||
"matcher": {
|
||||
"id": "byName",
|
||||
"options": "Field1"
|
||||
},
|
||||
"properties": [
|
||||
{
|
||||
"id": "custom.hideFrom",
|
||||
"value": {
|
||||
"tooltip": true,
|
||||
"viz": true
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
]
|
||||
},
|
||||
"id": 1,
|
||||
"title": "Panel with hideFrom.viz = true",
|
||||
"type": "timeseries"
|
||||
}
|
||||
],
|
||||
"schemaVersion": 42,
|
||||
"tags": [],
|
||||
"templating": {
|
||||
"list": []
|
||||
},
|
||||
"time": {
|
||||
"from": "now-6h",
|
||||
"to": "now"
|
||||
},
|
||||
"timepicker": {},
|
||||
"timezone": "",
|
||||
"title": "v42 Migration Test - Harky Must",
|
||||
"weekStart": ""
|
||||
}
|
||||
+30
-7
@@ -67,14 +67,23 @@
|
||||
]
|
||||
},
|
||||
{
|
||||
"__systemRef": "hideSeriesFrom",
|
||||
"matcher": {
|
||||
"id": "__systemRef",
|
||||
"options": "hiddenSeries"
|
||||
"id": "byNames",
|
||||
"options": {
|
||||
"mode": "exclude",
|
||||
"names": [
|
||||
"foo"
|
||||
],
|
||||
"prefix": "All except:",
|
||||
"readOnly": true
|
||||
}
|
||||
},
|
||||
"properties": [
|
||||
{
|
||||
"id": "custom.hideFrom",
|
||||
"value": {
|
||||
"legend": false,
|
||||
"tooltip": true,
|
||||
"viz": true
|
||||
}
|
||||
@@ -121,6 +130,10 @@
|
||||
"defaults": {},
|
||||
"overrides": [
|
||||
{
|
||||
"matcher": {
|
||||
"id": "byName",
|
||||
"options": "Time"
|
||||
},
|
||||
"properties": [
|
||||
{
|
||||
"id": "unit",
|
||||
@@ -143,13 +156,18 @@
|
||||
"defaults": {},
|
||||
"overrides": [
|
||||
{
|
||||
"matcher": {
|
||||
"id": "byValue",
|
||||
"options": {
|
||||
"op": "gte",
|
||||
"reducer": "allIsZero",
|
||||
"value": 0
|
||||
}
|
||||
},
|
||||
"properties": [
|
||||
{
|
||||
"id": "custom.hideFrom",
|
||||
"value": {
|
||||
"tooltip": false,
|
||||
"viz": false
|
||||
}
|
||||
"id": "unit",
|
||||
"value": "short"
|
||||
}
|
||||
]
|
||||
}
|
||||
@@ -164,10 +182,15 @@
|
||||
"defaults": {},
|
||||
"overrides": [
|
||||
{
|
||||
"matcher": {
|
||||
"id": "byName",
|
||||
"options": "{__name__=\"ALERTS\", alertname=\"k6CloudServiceErrorsLogged\"}"
|
||||
},
|
||||
"properties": [
|
||||
{
|
||||
"id": "custom.hideFrom",
|
||||
"value": {
|
||||
"legend": false,
|
||||
"tooltip": true,
|
||||
"viz": true
|
||||
}
|
||||
|
||||
Vendored
+10
-2
@@ -14,14 +14,20 @@
|
||||
"type": "dashboard"
|
||||
},
|
||||
{
|
||||
"datasource": "prometheus",
|
||||
"datasource": {
|
||||
"type": "prometheus",
|
||||
"uid": "default-ds-uid"
|
||||
},
|
||||
"enable": true,
|
||||
"iconColor": "red",
|
||||
"name": "deployment",
|
||||
"query": "ALERTS{alertname=\"DeploymentStarted\"}"
|
||||
},
|
||||
{
|
||||
"datasource": "loki",
|
||||
"datasource": {
|
||||
"type": "loki",
|
||||
"uid": "loki-uid"
|
||||
},
|
||||
"enable": false,
|
||||
"iconColor": "yellow",
|
||||
"name": "alerts",
|
||||
@@ -79,6 +85,7 @@
|
||||
{
|
||||
"name": "environment",
|
||||
"options": [],
|
||||
"query": "label_values(up, instance)",
|
||||
"type": "query"
|
||||
},
|
||||
{
|
||||
@@ -86,6 +93,7 @@
|
||||
"datasource": "prometheus",
|
||||
"name": "service",
|
||||
"options": [],
|
||||
"query": "label_values(up, instance)",
|
||||
"type": "query"
|
||||
},
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user