801 lines
23 KiB
JSON
801 lines
23 KiB
JSON
{
|
|
"kind": "Dashboard",
|
|
"apiVersion": "dashboard.grafana.app/v2beta1",
|
|
"metadata": {
|
|
"name": "test-v2beta1-datasource-resolution"
|
|
},
|
|
"spec": {
|
|
"annotations": [
|
|
{
|
|
"kind": "AnnotationQuery",
|
|
"spec": {
|
|
"query": {
|
|
"kind": "DataQuery",
|
|
"group": "grafana",
|
|
"version": "v0",
|
|
"datasource": {
|
|
"name": "-- Grafana --"
|
|
},
|
|
"spec": {
|
|
"limit": 100,
|
|
"matchAny": false,
|
|
"tags": [],
|
|
"type": "dashboard"
|
|
}
|
|
},
|
|
"enable": true,
|
|
"hide": false,
|
|
"iconColor": "rgba(0, 211, 255, 1)",
|
|
"name": "Annotations \u0026 Alerts",
|
|
"builtIn": true,
|
|
"legacyOptions": {
|
|
"type": "dashboard"
|
|
}
|
|
}
|
|
},
|
|
{
|
|
"kind": "AnnotationQuery",
|
|
"spec": {
|
|
"query": {
|
|
"kind": "DataQuery",
|
|
"group": "prometheus",
|
|
"version": "v0",
|
|
"datasource": {
|
|
"name": "existing-ref-uid"
|
|
},
|
|
"spec": {
|
|
"expr": "ALERTS{alertstate=\"firing\"}",
|
|
"interval": "1m",
|
|
"refId": "Anno",
|
|
"step": 60
|
|
}
|
|
},
|
|
"enable": true,
|
|
"hide": false,
|
|
"iconColor": "red",
|
|
"name": "Annotation with DS UID defined",
|
|
"builtIn": false,
|
|
"legacyOptions": {
|
|
"type": "prometheus"
|
|
}
|
|
}
|
|
},
|
|
{
|
|
"kind": "AnnotationQuery",
|
|
"spec": {
|
|
"query": {
|
|
"kind": "DataQuery",
|
|
"group": "elasticsearch",
|
|
"version": "v0",
|
|
"spec": {
|
|
"query": "tags:deployment",
|
|
"refId": "Anno",
|
|
"timeField": "@timestamp"
|
|
}
|
|
},
|
|
"enable": true,
|
|
"hide": false,
|
|
"iconColor": "yellow",
|
|
"name": "Annotations only with group defined",
|
|
"builtIn": false,
|
|
"legacyOptions": {
|
|
"tagsField": "tags",
|
|
"textField": "message",
|
|
"timeEndField": "end_time",
|
|
"timeField": "@timestamp",
|
|
"type": "elasticsearch"
|
|
}
|
|
}
|
|
},
|
|
{
|
|
"kind": "AnnotationQuery",
|
|
"spec": {
|
|
"query": {
|
|
"kind": "DataQuery",
|
|
"group": "",
|
|
"version": "v0",
|
|
"spec": {
|
|
"format": "table",
|
|
"rawSql": "SELECT time, title, text, tags FROM annotations WHERE $__timeFilter(time)",
|
|
"refId": "Anno"
|
|
}
|
|
},
|
|
"enable": true,
|
|
"hide": false,
|
|
"iconColor": "green",
|
|
"name": "Annotation without group or UID defined " ,
|
|
"builtIn": false
|
|
}
|
|
}
|
|
],
|
|
"cursorSync": "Tooltip",
|
|
"elements": {
|
|
"panel-1": {
|
|
"kind": "Panel",
|
|
"spec": {
|
|
"id": 1,
|
|
"title": "Panel with group and name defined",
|
|
"description": "This should resolve to the grafana-testdata-datasource datasource",
|
|
"links": [],
|
|
"data": {
|
|
"kind": "QueryGroup",
|
|
"spec": {
|
|
"queries": [
|
|
{
|
|
"kind": "PanelQuery",
|
|
"spec": {
|
|
"query": {
|
|
"kind": "DataQuery",
|
|
"group": "grafana-testdata-datasource",
|
|
"version": "v0",
|
|
"datasource": {
|
|
"name": "gdev-testdata"
|
|
},
|
|
"spec": {
|
|
"scenarioId": "random_walk",
|
|
"seriesCount": 3
|
|
}
|
|
},
|
|
"refId": "A",
|
|
"hidden": false
|
|
}
|
|
}
|
|
],
|
|
"transformations": [],
|
|
"queryOptions": {}
|
|
}
|
|
},
|
|
"vizConfig": {
|
|
"kind": "VizConfig",
|
|
"group": "timeseries",
|
|
"version": "12.1.0-pre",
|
|
"spec": {
|
|
"options": {
|
|
"legend": {
|
|
"calcs": [],
|
|
"displayMode": "list",
|
|
"placement": "bottom",
|
|
"showLegend": true
|
|
},
|
|
"tooltip": {
|
|
"hideZeros": false,
|
|
"mode": "single",
|
|
"sort": "none"
|
|
}
|
|
},
|
|
"fieldConfig": {
|
|
"defaults": {
|
|
"thresholds": {
|
|
"mode": "absolute",
|
|
"steps": [
|
|
{
|
|
"value": 0,
|
|
"color": "green"
|
|
},
|
|
{
|
|
"value": 80,
|
|
"color": "red"
|
|
}
|
|
]
|
|
},
|
|
"color": {
|
|
"mode": "palette-classic"
|
|
},
|
|
"custom": {
|
|
"axisBorderShow": false,
|
|
"axisCenteredZero": false,
|
|
"axisColorMode": "text",
|
|
"axisLabel": "",
|
|
"axisPlacement": "auto",
|
|
"barAlignment": 0,
|
|
"barWidthFactor": 0.6,
|
|
"drawStyle": "line",
|
|
"fillOpacity": 0,
|
|
"gradientMode": "none",
|
|
"hideFrom": {
|
|
"legend": false,
|
|
"tooltip": false,
|
|
"viz": false
|
|
},
|
|
"insertNulls": false,
|
|
"lineInterpolation": "linear",
|
|
"lineWidth": 1,
|
|
"pointSize": 5,
|
|
"scaleDistribution": {
|
|
"type": "linear"
|
|
},
|
|
"showPoints": "auto",
|
|
"spanNulls": false,
|
|
"stacking": {
|
|
"group": "A",
|
|
"mode": "none"
|
|
},
|
|
"thresholdsStyle": {
|
|
"mode": "off"
|
|
}
|
|
}
|
|
},
|
|
"overrides": []
|
|
}
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"panel-2": {
|
|
"kind": "Panel",
|
|
"spec": {
|
|
"id": 2,
|
|
"title": "Panel with group defined but no name",
|
|
"description": "This should resolve to the first elasticsearch datasource",
|
|
"links": [],
|
|
"data": {
|
|
"kind": "QueryGroup",
|
|
"spec": {
|
|
"queries": [
|
|
{
|
|
"kind": "PanelQuery",
|
|
"spec": {
|
|
"query": {
|
|
"kind": "DataQuery",
|
|
"group": "elasticsearch",
|
|
"version": "v0",
|
|
"spec": {
|
|
"alias": "",
|
|
"bucketAggs": [],
|
|
"metrics": [],
|
|
"query": "",
|
|
"timeField": "@timestamp"
|
|
}
|
|
},
|
|
"refId": "A",
|
|
"hidden": false
|
|
}
|
|
}
|
|
],
|
|
"transformations": [],
|
|
"queryOptions": {}
|
|
}
|
|
},
|
|
"vizConfig": {
|
|
"kind": "VizConfig",
|
|
"group": "timeseries",
|
|
"version": "12.1.0-pre",
|
|
"spec": {
|
|
"options": {
|
|
"legend": {
|
|
"calcs": [],
|
|
"displayMode": "list",
|
|
"placement": "bottom",
|
|
"showLegend": true
|
|
},
|
|
"tooltip": {
|
|
"hideZeros": false,
|
|
"mode": "single",
|
|
"sort": "none"
|
|
}
|
|
},
|
|
"fieldConfig": {
|
|
"defaults": {
|
|
"thresholds": {
|
|
"mode": "absolute",
|
|
"steps": [
|
|
{
|
|
"value": 0,
|
|
"color": "green"
|
|
},
|
|
{
|
|
"value": 80,
|
|
"color": "red"
|
|
}
|
|
]
|
|
},
|
|
"color": {
|
|
"mode": "palette-classic"
|
|
},
|
|
"custom": {
|
|
"axisBorderShow": false,
|
|
"axisCenteredZero": false,
|
|
"axisColorMode": "text",
|
|
"axisLabel": "",
|
|
"axisPlacement": "auto",
|
|
"barAlignment": 0,
|
|
"barWidthFactor": 0.6,
|
|
"drawStyle": "line",
|
|
"fillOpacity": 0,
|
|
"gradientMode": "none",
|
|
"hideFrom": {
|
|
"legend": false,
|
|
"tooltip": false,
|
|
"viz": false
|
|
},
|
|
"insertNulls": false,
|
|
"lineInterpolation": "linear",
|
|
"lineWidth": 1,
|
|
"pointSize": 5,
|
|
"scaleDistribution": {
|
|
"type": "linear"
|
|
},
|
|
"showPoints": "auto",
|
|
"spanNulls": false,
|
|
"stacking": {
|
|
"group": "A",
|
|
"mode": "none"
|
|
},
|
|
"thresholdsStyle": {
|
|
"mode": "off"
|
|
}
|
|
}
|
|
},
|
|
"overrides": []
|
|
}
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"panel-3": {
|
|
"kind": "Panel",
|
|
"spec": {
|
|
"id": 3,
|
|
"title": "Panel with no group defined",
|
|
"description": "This should resolve to the default datasource",
|
|
"links": [],
|
|
"data": {
|
|
"kind": "QueryGroup",
|
|
"spec": {
|
|
"queries": [
|
|
{
|
|
"kind": "PanelQuery",
|
|
"spec": {
|
|
"query": {
|
|
"kind": "DataQuery",
|
|
"group": "",
|
|
"version": "v0",
|
|
"spec": {
|
|
"scenarioId": "random_walk",
|
|
"seriesCount": 3
|
|
}
|
|
},
|
|
"refId": "A",
|
|
"hidden": false
|
|
}
|
|
}
|
|
],
|
|
"transformations": [],
|
|
"queryOptions": {}
|
|
}
|
|
},
|
|
"vizConfig": {
|
|
"kind": "VizConfig",
|
|
"group": "timeseries",
|
|
"version": "12.1.0-pre",
|
|
"spec": {
|
|
"options": {
|
|
"legend": {
|
|
"calcs": [],
|
|
"displayMode": "list",
|
|
"placement": "bottom",
|
|
"showLegend": true
|
|
},
|
|
"tooltip": {
|
|
"hideZeros": false,
|
|
"mode": "single",
|
|
"sort": "none"
|
|
}
|
|
},
|
|
"fieldConfig": {
|
|
"defaults": {
|
|
"thresholds": {
|
|
"mode": "absolute",
|
|
"steps": [
|
|
{
|
|
"value": 0,
|
|
"color": "green"
|
|
},
|
|
{
|
|
"value": 80,
|
|
"color": "red"
|
|
}
|
|
]
|
|
},
|
|
"color": {
|
|
"mode": "palette-classic"
|
|
},
|
|
"custom": {
|
|
"axisBorderShow": false,
|
|
"axisCenteredZero": false,
|
|
"axisColorMode": "text",
|
|
"axisLabel": "",
|
|
"axisPlacement": "auto",
|
|
"barAlignment": 0,
|
|
"barWidthFactor": 0.6,
|
|
"drawStyle": "line",
|
|
"fillOpacity": 0,
|
|
"gradientMode": "none",
|
|
"hideFrom": {
|
|
"legend": false,
|
|
"tooltip": false,
|
|
"viz": false
|
|
},
|
|
"insertNulls": false,
|
|
"lineInterpolation": "linear",
|
|
"lineWidth": 1,
|
|
"pointSize": 5,
|
|
"scaleDistribution": {
|
|
"type": "linear"
|
|
},
|
|
"showPoints": "auto",
|
|
"spanNulls": false,
|
|
"stacking": {
|
|
"group": "A",
|
|
"mode": "none"
|
|
},
|
|
"thresholdsStyle": {
|
|
"mode": "off"
|
|
}
|
|
}
|
|
},
|
|
"overrides": []
|
|
}
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"panel-4": {
|
|
"kind": "Panel",
|
|
"spec": {
|
|
"id": 4,
|
|
"title": "Panel mixed Datasource and Group defined",
|
|
"description": "This should resolve to a mixed datasource",
|
|
"links": [],
|
|
"data": {
|
|
"kind": "QueryGroup",
|
|
"spec": {
|
|
"queries": [
|
|
{
|
|
"kind": "PanelQuery",
|
|
"spec": {
|
|
"query": {
|
|
"kind": "DataQuery",
|
|
"group": "prometheus",
|
|
"version": "v0",
|
|
"datasource": {
|
|
"name": "existing-ref-uid"
|
|
},
|
|
"spec": {
|
|
"query": "up"
|
|
}
|
|
},
|
|
"refId": "A",
|
|
"hidden": false
|
|
}
|
|
},
|
|
{
|
|
"kind": "PanelQuery",
|
|
"spec": {
|
|
"query": {
|
|
"kind": "DataQuery",
|
|
"group": "elasticsearch",
|
|
"version": "v0",
|
|
"spec": {
|
|
"bucketAggs": [
|
|
{
|
|
"field": "@host",
|
|
"id": "2",
|
|
"type": "terms"
|
|
}
|
|
],
|
|
"query": "*",
|
|
"size": 100
|
|
}
|
|
},
|
|
"refId": "B",
|
|
"hidden": false
|
|
}
|
|
},
|
|
{
|
|
"kind": "PanelQuery",
|
|
"spec": {
|
|
"query": {
|
|
"kind": "DataQuery",
|
|
"group": "",
|
|
"version": "v0",
|
|
"spec": {
|
|
"scenarioId": "random_walk",
|
|
"seriesCount": 3
|
|
}
|
|
},
|
|
"refId": "C",
|
|
"hidden": false
|
|
}
|
|
}
|
|
],
|
|
"transformations": [],
|
|
"queryOptions": {}
|
|
}
|
|
},
|
|
"vizConfig": {
|
|
"kind": "VizConfig",
|
|
"group": "timeseries",
|
|
"version": "12.1.0-pre",
|
|
"spec": {
|
|
"options": {
|
|
"legend": {
|
|
"calcs": [],
|
|
"displayMode": "list",
|
|
"placement": "bottom",
|
|
"showLegend": true
|
|
},
|
|
"tooltip": {
|
|
"hideZeros": false,
|
|
"mode": "single",
|
|
"sort": "none"
|
|
}
|
|
},
|
|
"fieldConfig": {
|
|
"defaults": {
|
|
"thresholds": {
|
|
"mode": "absolute",
|
|
"steps": [
|
|
{
|
|
"value": 0,
|
|
"color": "green"
|
|
},
|
|
{
|
|
"value": 80,
|
|
"color": "red"
|
|
}
|
|
]
|
|
},
|
|
"color": {
|
|
"mode": "palette-classic"
|
|
},
|
|
"custom": {
|
|
"axisBorderShow": false,
|
|
"axisCenteredZero": false,
|
|
"axisColorMode": "text",
|
|
"axisLabel": "",
|
|
"axisPlacement": "auto",
|
|
"barAlignment": 0,
|
|
"barWidthFactor": 0.6,
|
|
"drawStyle": "line",
|
|
"fillOpacity": 0,
|
|
"gradientMode": "none",
|
|
"hideFrom": {
|
|
"legend": false,
|
|
"tooltip": false,
|
|
"viz": false
|
|
},
|
|
"insertNulls": false,
|
|
"lineInterpolation": "linear",
|
|
"lineWidth": 1,
|
|
"pointSize": 5,
|
|
"scaleDistribution": {
|
|
"type": "linear"
|
|
},
|
|
"showPoints": "auto",
|
|
"spanNulls": false,
|
|
"stacking": {
|
|
"group": "A",
|
|
"mode": "none"
|
|
},
|
|
"thresholdsStyle": {
|
|
"mode": "off"
|
|
}
|
|
}
|
|
},
|
|
"overrides": []
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"layout": {
|
|
"kind": "RowsLayout",
|
|
"spec": {
|
|
"rows": [
|
|
{
|
|
"kind": "Row",
|
|
"spec": {
|
|
"title": "",
|
|
"collapse": false,
|
|
"hideHeader": true,
|
|
"fillScreen": false,
|
|
"layout": {
|
|
"kind": "GridLayout",
|
|
"spec": {
|
|
"items": [
|
|
{
|
|
"kind": "GridLayoutItem",
|
|
"spec": {
|
|
"x": 0,
|
|
"y": 0,
|
|
"width": 8,
|
|
"height": 3,
|
|
"element": {
|
|
"kind": "ElementReference",
|
|
"name": "panel-1"
|
|
}
|
|
}
|
|
},
|
|
{
|
|
"kind": "GridLayoutItem",
|
|
"spec": {
|
|
"x": 0,
|
|
"y": 3,
|
|
"width": 8,
|
|
"height": 3,
|
|
"element": {
|
|
"kind": "ElementReference",
|
|
"name": "panel-2"
|
|
}
|
|
}
|
|
},
|
|
{
|
|
"kind": "GridLayoutItem",
|
|
"spec": {
|
|
"x": 0,
|
|
"y": 6,
|
|
"width": 8,
|
|
"height": 3,
|
|
"element": {
|
|
"kind": "ElementReference",
|
|
"name": "panel-3"
|
|
}
|
|
}
|
|
},
|
|
{
|
|
"kind": "GridLayoutItem",
|
|
"spec": {
|
|
"x": 0,
|
|
"y": 9,
|
|
"width": 8,
|
|
"height": 3,
|
|
"element": {
|
|
"kind": "ElementReference",
|
|
"name": "panel-4"
|
|
}
|
|
}
|
|
}
|
|
]
|
|
}
|
|
}
|
|
}
|
|
}
|
|
]
|
|
}
|
|
},
|
|
"links": [],
|
|
"liveNow": false,
|
|
"preload": false,
|
|
"tags": [],
|
|
"timeSettings": {
|
|
"timezone": "browser",
|
|
"from": "now-6h",
|
|
"to": "now",
|
|
"autoRefresh": "",
|
|
"autoRefreshIntervals": [
|
|
"5s",
|
|
"10s",
|
|
"30s",
|
|
"1m",
|
|
"5m",
|
|
"15m",
|
|
"30m",
|
|
"1h",
|
|
"2h",
|
|
"1d"
|
|
],
|
|
"hideTimepicker": false,
|
|
"fiscalYearStartMonth": 0
|
|
},
|
|
"title": "Test: V2beta1 dashboard with datasource resolution",
|
|
"variables": [
|
|
{
|
|
"kind": "QueryVariable",
|
|
"spec": {
|
|
"name": "group_and_uid_defined",
|
|
"current": {
|
|
"text": "legacy_value",
|
|
"value": "legacy_string_content"
|
|
},
|
|
"label": "Group and UID defined",
|
|
"hide": "dontHide",
|
|
"refresh": "onDashboardLoad",
|
|
"skipUrlSync": false,
|
|
"description": "Variable with group and UID defined",
|
|
"query": {
|
|
"kind": "DataQuery",
|
|
"group": "prometheus",
|
|
"version": "v0",
|
|
"datasource": {
|
|
"name": "existing-ref-uid"
|
|
},
|
|
"spec": {
|
|
"__legacyStringValue": "up"
|
|
}
|
|
},
|
|
"regex": "",
|
|
"sort": "disabled",
|
|
"options": [],
|
|
"multi": false,
|
|
"includeAll": false,
|
|
"allowCustomValue": true
|
|
}
|
|
},
|
|
{
|
|
"kind": "QueryVariable",
|
|
"spec": {
|
|
"name": "group_defined_but_no_name",
|
|
"current": {
|
|
"text": "legacy_value",
|
|
"value": "legacy_string_content"
|
|
},
|
|
"label": "Group defined but no name",
|
|
"hide": "dontHide",
|
|
"refresh": "onDashboardLoad",
|
|
"skipUrlSync": false,
|
|
"description": "Variable with group defined but no name",
|
|
"query": {
|
|
"kind": "DataQuery",
|
|
"group": "elasticsearch",
|
|
"version": "v0",
|
|
"spec": {
|
|
"bucketAggs": [
|
|
{
|
|
"field": "@host",
|
|
"id": "2",
|
|
"type": "terms"
|
|
}
|
|
],
|
|
"query": "*",
|
|
"size": 100
|
|
}
|
|
},
|
|
"regex": "",
|
|
"sort": "disabled",
|
|
"options": [],
|
|
"multi": false,
|
|
"includeAll": false,
|
|
"allowCustomValue": true
|
|
}
|
|
},
|
|
{
|
|
"kind": "QueryVariable",
|
|
"spec": {
|
|
"name": "no_group_defined",
|
|
"current": {
|
|
"text": "legacy_value",
|
|
"value": "legacy_string_content"
|
|
},
|
|
"label": "No group defined",
|
|
"hide": "dontHide",
|
|
"refresh": "onDashboardLoad",
|
|
"skipUrlSync": false,
|
|
"description": "Variable with no group defined",
|
|
"query": {
|
|
"kind": "DataQuery",
|
|
"group": "",
|
|
"version": "v0",
|
|
"spec": {
|
|
"scenarioId": "random_walk",
|
|
"seriesCount": 3
|
|
}
|
|
},
|
|
"regex": "",
|
|
"sort": "disabled",
|
|
"options": [],
|
|
"multi": false,
|
|
"includeAll": false,
|
|
"allowCustomValue": true
|
|
}
|
|
}
|
|
]
|
|
},
|
|
"status": {
|
|
"conversion": {
|
|
"failed": false,
|
|
"storedVersion": "v2beta1"
|
|
}
|
|
}
|
|
} |