Dashboard Migrations: v27 repeated panels and constant variable (#108644)

This commit is contained in:
Haris Rozajac
2025-08-06 10:22:11 -06:00
committed by GitHub
parent d0d8b8f82d
commit fdfe123305
8 changed files with 917 additions and 1 deletions
@@ -0,0 +1,43 @@
{
"title": "V27 Repeated Panels and Constant Variable Migration Test Dashboard",
"schemaVersion": 26,
"panels": [
{
"id": 1,
"type": "graph",
"repeatPanelId": "panel1"
},
{
"id": 2,
"type": "graph",
"title": "Normal Panel"
},
{
"id": 4,
"type": "row",
"title": "Row with repeated panels",
"panels": [
{
"id": 5,
"type": "graph",
"repeatPanelId": "panel2"
},
{
"id": 6,
"type": "graph",
"title": "Normal nested panel"
}
]
}
],
"templating": {
"list": [
{
"name": "constant_var",
"type": "constant",
"query": "default_value",
"hide": 0
}
]
}
}
@@ -0,0 +1,105 @@
{
"title": "V28 Singlestat and Variable Properties Migration Test Dashboard",
"schemaVersion": 27,
"panels": [
{
"type": "singlestat",
"legend": true,
"thresholds": "10,20,30",
"colors": ["#FF0000", "green", "orange"],
"grid": { "min": 1, "max": 10 },
"targets": [{ "refId": "A" }, {}]
},
{
"type": "singlestat",
"thresholds": "10,20,30",
"colors": ["#FF0000", "green", "orange"],
"gauge": {
"show": true,
"thresholdMarkers": true,
"thresholdLabels": false
},
"grid": { "min": 1, "max": 10 }
},
{
"type": "singlestat",
"legend": true,
"thresholds": "10,20,30",
"colors": ["#FF0000", "green", "orange"],
"grid": { "min": 1, "max": 10 },
"targets": [{ "refId": "A" }, {}],
"mappingTypes": [
{
"name": "value to text",
"value": 1
}
],
"valueMaps": [
{
"op": "=",
"text": "test",
"value": "20"
},
{
"op": "=",
"text": "test1",
"value": "30"
},
{
"op": "=",
"text": "50",
"value": "40"
}
]
},
{
"type": "timeseries",
"targets": [
{
"refId": "A",
"expr": "rate(http_requests_total[5m])"
}
]
}
],
"templating": {
"list": [
{
"name": "query_variable_with_tags",
"type": "query",
"datasource": "prometheus",
"query": "label_values(up, instance)",
"tags": ["instance", "job"],
"tagsQuery": "label_values(up, job)",
"tagValuesQuery": "label_values(up{job=\"$job\"}, instance)",
"useTags": true,
"refresh": 1
},
{
"name": "custom_variable_with_tags",
"type": "custom",
"options": [
{"text": "Option 1", "value": "opt1"},
{"text": "Option 2", "value": "opt2"}
],
"tags": ["custom_tag"],
"tagsQuery": "custom query",
"useTags": false
},
{
"name": "clean_variable",
"type": "textbox",
"options": [
{"text": "Hello", "value": "World"}
]
}
]
},
"time": {
"from": "now-6h",
"to": "now"
},
"timepicker": {
"refresh_intervals": ["5s", "10s", "30s", "1m", "5m", "15m", "30m", "1h", "2h", "1d"]
}
}
@@ -0,0 +1,91 @@
{
"panels": [
{
"datasource": {
"apiVersion": "v1",
"type": "prometheus",
"uid": "default-ds-uid"
},
"id": 2,
"targets": [
{
"datasource": {
"apiVersion": "v1",
"type": "prometheus",
"uid": "default-ds-uid"
},
"refId": "A"
}
],
"title": "Normal Panel",
"type": "graph"
},
{
"datasource": {
"apiVersion": "v1",
"type": "prometheus",
"uid": "default-ds-uid"
},
"id": 4,
"panels": [
{
"datasource": {
"apiVersion": "v1",
"type": "prometheus",
"uid": "default-ds-uid"
},
"id": 6,
"targets": [
{
"datasource": {
"apiVersion": "v1",
"type": "prometheus",
"uid": "default-ds-uid"
},
"refId": "A"
}
],
"title": "Normal nested panel",
"type": "graph"
}
],
"targets": [
{
"datasource": {
"apiVersion": "v1",
"type": "prometheus",
"uid": "default-ds-uid"
},
"refId": "A"
}
],
"title": "Row with repeated panels",
"type": "row"
}
],
"refresh": "",
"schemaVersion": 41,
"templating": {
"list": [
{
"current": {
"selected": true,
"text": "default_value",
"value": "default_value"
},
"hide": 0,
"name": "constant_var",
"options": [
{
"selected": true,
"text": "default_value",
"value": "default_value"
}
],
"query": "default_value",
"type": "textbox"
}
]
},
"title": "V27 Repeated Panels and Constant Variable Migration Test Dashboard"
}
@@ -0,0 +1,322 @@
{
"panels": [
{
"datasource": {
"apiVersion": "v1",
"type": "prometheus",
"uid": "default-ds-uid"
},
"fieldConfig": {
"defaults": {
"mappings": [],
"thresholds": {
"mode": "absolute",
"steps": [
{
"color": "#FF0000",
"value": null
},
{
"color": "green",
"value": 10
},
{
"color": "orange",
"value": 20
}
]
}
},
"overrides": []
},
"grid": {
"max": 10,
"min": 1
},
"legend": true,
"options": {
"colorMode": "none",
"graphMode": "none",
"justifyMode": "auto",
"orientation": "horizontal",
"percentChangeColorMode": "standard",
"reduceOptions": {
"calcs": [
"mean"
],
"fields": "",
"values": false
},
"showPercentChange": false,
"textMode": "auto",
"wideLayout": true
},
"pluginVersion": "1.0.0",
"targets": [
{
"datasource": {
"apiVersion": "v1",
"type": "prometheus",
"uid": "default-ds-uid"
},
"refId": "A"
},
{
"datasource": {
"apiVersion": "v1",
"type": "prometheus",
"uid": "default-ds-uid"
}
}
],
"type": "stat"
},
{
"datasource": {
"apiVersion": "v1",
"type": "prometheus",
"uid": "default-ds-uid"
},
"fieldConfig": {
"defaults": {
"mappings": [],
"max": null,
"min": null,
"thresholds": {
"mode": "absolute",
"steps": [
{
"color": "#FF0000",
"value": null
},
{
"color": "green",
"value": 10
},
{
"color": "orange",
"value": 20
}
]
}
},
"overrides": []
},
"grid": {
"max": 10,
"min": 1
},
"options": {
"colorMode": "none",
"graphMode": "none",
"justifyMode": "auto",
"orientation": "horizontal",
"percentChangeColorMode": "standard",
"reduceOptions": {
"calcs": [
"mean"
],
"fields": "",
"values": false
},
"showPercentChange": false,
"textMode": "auto",
"wideLayout": true
},
"pluginVersion": "1.0.0",
"targets": [
{
"datasource": {
"apiVersion": "v1",
"type": "prometheus",
"uid": "default-ds-uid"
},
"refId": "A"
}
],
"type": "stat"
},
{
"datasource": {
"apiVersion": "v1",
"type": "prometheus",
"uid": "default-ds-uid"
},
"fieldConfig": {
"defaults": {
"mappings": [
{
"options": {
"20": {
"color": null,
"text": "test"
}
},
"type": "value"
},
{
"options": {
"30": {
"color": null,
"text": "test1"
}
},
"type": "value"
},
{
"options": {
"40": {
"color": "orange",
"text": "50"
}
},
"type": "value"
}
],
"thresholds": {
"mode": "absolute",
"steps": [
{
"color": "#FF0000",
"value": null
},
{
"color": "green",
"value": 10
},
{
"color": "orange",
"value": 20
}
]
}
},
"overrides": []
},
"grid": {
"max": 10,
"min": 1
},
"legend": true,
"mappingTypes": [
{
"name": "value to text",
"value": 1
}
],
"options": {
"colorMode": "none",
"graphMode": "none",
"justifyMode": "auto",
"orientation": "horizontal",
"percentChangeColorMode": "standard",
"reduceOptions": {
"calcs": [
"mean"
],
"fields": "",
"values": false
},
"showPercentChange": false,
"textMode": "auto",
"wideLayout": true
},
"pluginVersion": "1.0.0",
"targets": [
{
"datasource": {
"apiVersion": "v1",
"type": "prometheus",
"uid": "default-ds-uid"
},
"refId": "A"
},
{
"datasource": {
"apiVersion": "v1",
"type": "prometheus",
"uid": "default-ds-uid"
}
}
],
"type": "stat"
},
{
"datasource": {
"apiVersion": "v1",
"type": "prometheus",
"uid": "default-ds-uid"
},
"targets": [
{
"datasource": {
"apiVersion": "v1",
"type": "prometheus",
"uid": "default-ds-uid"
},
"expr": "rate(http_requests_total[5m])",
"refId": "A"
}
],
"type": "timeseries"
}
],
"refresh": "",
"schemaVersion": 41,
"templating": {
"list": [
{
"datasource": {
"uid": "prometheus"
},
"name": "query_variable_with_tags",
"query": "label_values(up, instance)",
"refresh": 1,
"type": "query"
},
{
"name": "custom_variable_with_tags",
"options": [
{
"text": "Option 1",
"value": "opt1"
},
{
"text": "Option 2",
"value": "opt2"
}
],
"type": "custom"
},
{
"name": "clean_variable",
"options": [
{
"text": "Hello",
"value": "World"
}
],
"type": "textbox"
}
]
},
"time": {
"from": "now-6h",
"to": "now"
},
"timepicker": {
"refresh_intervals": [
"5s",
"10s",
"30s",
"1m",
"5m",
"15m",
"30m",
"1h",
"2h",
"1d"
]
},
"title": "V28 Singlestat and Variable Properties Migration Test Dashboard"
}