diff --git a/devenv/dev-dashboards/panel-bargauge/panel_tests_bar_gauge.json b/devenv/dev-dashboards/panel-bargauge/panel_tests_bar_gauge.json index 6230bb6c305..9366c4dc238 100644 --- a/devenv/dev-dashboards/panel-bargauge/panel_tests_bar_gauge.json +++ b/devenv/dev-dashboards/panel-bargauge/panel_tests_bar_gauge.json @@ -3,24 +3,74 @@ "list": [ { "builtIn": 1, - "datasource": "-- Grafana --", + "datasource": { + "type": "datasource", + "uid": "grafana" + }, "enable": true, "hide": true, "iconColor": "rgba(0, 211, 255, 1)", "name": "Annotations & Alerts", + "target": { + "limit": 100, + "matchAny": false, + "tags": [], + "type": "dashboard" + }, "type": "dashboard" } ] }, "editable": true, - "gnetId": null, + "fiscalYearStartMonth": 0, "graphTooltip": 0, "links": [], + "liveNow": false, "panels": [ { + "datasource": { + "type": "testdata", + "uid": "PD8C576611E62080A" + }, + "fieldConfig": { + "defaults": { + "color": { + "mode": "thresholds" + }, + "mappings": [], + "max": 100, + "min": 0, + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "blue", + "index": 0 + }, + { + "color": "green", + "index": 1, + "value": 20 + }, + { + "color": "orange", + "index": 2, + "value": 40 + }, + { + "color": "red", + "index": 3, + "value": 80 + } + ] + }, + "unit": "celsius" + }, + "overrides": [] + }, "gridPos": { "h": 7, - "w": 6, + "w": 9, "x": 0, "y": 0 }, @@ -28,789 +78,1333 @@ "links": [], "options": { "displayMode": "gradient", - "fieldOptions": { - "calcs": ["mean"], - "defaults": { - "decimals": null, - "max": 100, - "min": 0, - "unit": "celsius" - }, - "mappings": [], - "override": {}, - "thresholds": [ - { - "color": "blue", - "index": 0, - "value": null - }, - { - "color": "green", - "index": 1, - "value": 20 - }, - { - "color": "orange", - "index": 2, - "value": 40 - }, - { - "color": "red", - "index": 3, - "value": 80 - } + "minVizHeight": 10, + "minVizWidth": 0, + "orientation": "horizontal", + "reduceOptions": { + "calcs": [ + "mean" ], + "fields": "", "values": false }, - "orientation": "horizontal" + "showUnfilled": true, + "valueMode": "color" }, - "pluginVersion": "6.2.0-pre", + "pluginVersion": "9.4.0-pre", "targets": [ { "alias": "Inside", + "datasource": { + "type": "testdata", + "uid": "PD8C576611E62080A" + }, "refId": "H", "scenarioId": "csv_metric_values", "stringInput": "100,100,100" }, { "alias": "Outhouse", + "datasource": { + "type": "testdata", + "uid": "PD8C576611E62080A" + }, "refId": "A", "scenarioId": "random_walk" }, { + "datasource": { + "type": "testdata", + "uid": "PD8C576611E62080A" + }, "refId": "F", "scenarioId": "random_walk" } ], - "timeFrom": null, - "timeShift": null, "title": "Title above bar", "type": "bargauge" }, { + "datasource": { + "type": "testdata", + "uid": "PD8C576611E62080A" + }, + "fieldConfig": { + "defaults": { + "color": { + "mode": "thresholds" + }, + "mappings": [], + "max": 100, + "min": 0, + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "blue", + "index": 0 + }, + { + "color": "green", + "index": 1, + "value": 20 + }, + { + "color": "orange", + "index": 2, + "value": 40 + }, + { + "color": "red", + "index": 3, + "value": 80 + } + ] + }, + "unit": "celsius" + }, + "overrides": [] + }, "gridPos": { "h": 7, - "w": 5, - "x": 6, + "w": 8, + "x": 9, "y": 0 }, "id": 12, "links": [], "options": { "displayMode": "gradient", - "fieldOptions": { - "calcs": ["mean"], - "defaults": { - "decimals": null, - "max": 100, - "min": 0, - "unit": "celsius" - }, - "mappings": [], - "override": {}, - "thresholds": [ - { - "color": "blue", - "index": 0, - "value": null - }, - { - "color": "green", - "index": 1, - "value": 20 - }, - { - "color": "orange", - "index": 2, - "value": 40 - }, - { - "color": "red", - "index": 3, - "value": 80 - } + "minVizHeight": 10, + "minVizWidth": 0, + "orientation": "horizontal", + "reduceOptions": { + "calcs": [ + "mean" ], + "fields": "", "values": false }, - "orientation": "horizontal" + "showUnfilled": true, + "valueMode": "color" }, - "pluginVersion": "6.2.0-pre", + "pluginVersion": "9.4.0-pre", "targets": [ { "alias": "Inside", + "datasource": { + "type": "testdata", + "uid": "PD8C576611E62080A" + }, "refId": "H", "scenarioId": "csv_metric_values", "stringInput": "100,100,100" }, { "alias": "Outhouse", + "datasource": { + "type": "testdata", + "uid": "PD8C576611E62080A" + }, "refId": "A", "scenarioId": "random_walk" }, { + "datasource": { + "type": "testdata", + "uid": "PD8C576611E62080A" + }, "refId": "F", "scenarioId": "random_walk" }, { + "datasource": { + "type": "testdata", + "uid": "PD8C576611E62080A" + }, "refId": "B", "scenarioId": "random_walk" }, { + "datasource": { + "type": "testdata", + "uid": "PD8C576611E62080A" + }, "refId": "C", "scenarioId": "random_walk" } ], - "timeFrom": null, - "timeShift": null, "title": "Title to left of bar", "type": "bargauge" }, { + "datasource": { + "type": "testdata", + "uid": "PD8C576611E62080A" + }, + "fieldConfig": { + "defaults": { + "color": { + "mode": "thresholds" + }, + "mappings": [], + "max": 100, + "min": 0, + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "blue", + "index": 0 + }, + { + "color": "green", + "index": 1, + "value": 20 + }, + { + "color": "orange", + "index": 2, + "value": 40 + }, + { + "color": "red", + "index": 3, + "value": 80 + } + ] + }, + "unit": "celsius" + }, + "overrides": [] + }, "gridPos": { "h": 7, "w": 7, - "x": 11, + "x": 17, "y": 0 }, - "id": 13, + "id": 23, "links": [], "options": { - "displayMode": "basic", - "fieldOptions": { - "calcs": ["mean"], - "defaults": { - "decimals": null, - "max": 100, - "min": 0, - "unit": "celsius" - }, - "mappings": [], - "override": {}, - "thresholds": [ - { - "color": "blue", - "index": 0, - "value": null - }, - { - "color": "green", - "index": 1, - "value": 20 - }, - { - "color": "orange", - "index": 2, - "value": 40 - }, - { - "color": "red", - "index": 3, - "value": 80 - } + "displayMode": "gradient", + "minVizHeight": 10, + "minVizWidth": 0, + "orientation": "horizontal", + "reduceOptions": { + "calcs": [ + "mean" ], + "fields": "", "values": false }, - "orientation": "horizontal" + "showUnfilled": true, + "valueMode": "hidden" }, - "pluginVersion": "6.2.0-pre", + "pluginVersion": "9.4.0-pre", "targets": [ { "alias": "Inside", + "datasource": { + "type": "testdata", + "uid": "PD8C576611E62080A" + }, "refId": "H", "scenarioId": "csv_metric_values", "stringInput": "100,100,100" }, { "alias": "Outhouse", + "datasource": { + "type": "testdata", + "uid": "PD8C576611E62080A" + }, "refId": "A", "scenarioId": "random_walk" }, { + "datasource": { + "type": "testdata", + "uid": "PD8C576611E62080A" + }, "refId": "F", "scenarioId": "random_walk" }, { + "datasource": { + "type": "testdata", + "uid": "PD8C576611E62080A" + }, "refId": "B", "scenarioId": "random_walk" }, { + "datasource": { + "type": "testdata", + "uid": "PD8C576611E62080A" + }, "refId": "C", "scenarioId": "random_walk" } ], - "timeFrom": null, - "timeShift": null, - "title": "Basic mode", + "title": "Gradient hidden value", "type": "bargauge" }, { + "datasource": { + "type": "testdata", + "uid": "PD8C576611E62080A" + }, + "fieldConfig": { + "defaults": { + "color": { + "mode": "thresholds" + }, + "mappings": [], + "max": 100, + "min": 0, + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "blue", + "index": 0 + }, + { + "color": "green", + "index": 1, + "value": 20 + }, + { + "color": "orange", + "index": 2, + "value": 40 + }, + { + "color": "red", + "index": 3, + "value": 80 + } + ] + }, + "unit": "celsius" + }, + "overrides": [] + }, "gridPos": { "h": 7, - "w": 6, - "x": 18, - "y": 0 + "w": 9, + "x": 0, + "y": 7 + }, + "id": 21, + "links": [], + "options": { + "displayMode": "basic", + "minVizHeight": 10, + "minVizWidth": 0, + "orientation": "horizontal", + "reduceOptions": { + "calcs": [ + "mean" + ], + "fields": "", + "values": false + }, + "showUnfilled": true, + "valueMode": "text" + }, + "pluginVersion": "9.4.0-pre", + "targets": [ + { + "alias": "Inside", + "datasource": { + "type": "testdata", + "uid": "PD8C576611E62080A" + }, + "refId": "H", + "scenarioId": "csv_metric_values", + "stringInput": "100,100,100" + }, + { + "alias": "Outhouse", + "datasource": { + "type": "testdata", + "uid": "PD8C576611E62080A" + }, + "refId": "A", + "scenarioId": "random_walk" + }, + { + "datasource": { + "type": "testdata", + "uid": "PD8C576611E62080A" + }, + "refId": "F", + "scenarioId": "random_walk" + }, + { + "datasource": { + "type": "testdata", + "uid": "PD8C576611E62080A" + }, + "refId": "B", + "scenarioId": "random_walk" + }, + { + "datasource": { + "type": "testdata", + "uid": "PD8C576611E62080A" + }, + "refId": "C", + "scenarioId": "random_walk" + } + ], + "title": "Basic mode + text color", + "type": "bargauge" + }, + { + "datasource": { + "type": "testdata", + "uid": "PD8C576611E62080A" + }, + "fieldConfig": { + "defaults": { + "color": { + "mode": "thresholds" + }, + "mappings": [], + "max": 100, + "min": 0, + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "blue", + "index": 0 + }, + { + "color": "green", + "index": 1, + "value": 20 + }, + { + "color": "orange", + "index": 2, + "value": 40 + }, + { + "color": "red", + "index": 3, + "value": 80 + } + ] + }, + "unit": "celsius" + }, + "overrides": [] + }, + "gridPos": { + "h": 7, + "w": 8, + "x": 9, + "y": 7 + }, + "id": 13, + "links": [], + "options": { + "displayMode": "gradient", + "minVizHeight": 10, + "minVizWidth": 0, + "orientation": "horizontal", + "reduceOptions": { + "calcs": [ + "mean" + ], + "fields": "", + "values": false + }, + "showUnfilled": true, + "valueMode": "text" + }, + "pluginVersion": "9.4.0-pre", + "targets": [ + { + "alias": "Inside", + "datasource": { + "type": "testdata", + "uid": "PD8C576611E62080A" + }, + "refId": "H", + "scenarioId": "csv_metric_values", + "stringInput": "100,100,100" + }, + { + "alias": "Outhouse", + "datasource": { + "type": "testdata", + "uid": "PD8C576611E62080A" + }, + "refId": "A", + "scenarioId": "random_walk" + }, + { + "datasource": { + "type": "testdata", + "uid": "PD8C576611E62080A" + }, + "refId": "F", + "scenarioId": "random_walk" + }, + { + "datasource": { + "type": "testdata", + "uid": "PD8C576611E62080A" + }, + "refId": "B", + "scenarioId": "random_walk" + }, + { + "datasource": { + "type": "testdata", + "uid": "PD8C576611E62080A" + }, + "refId": "C", + "scenarioId": "random_walk" + } + ], + "title": "gradient + text color", + "type": "bargauge" + }, + { + "datasource": { + "type": "testdata", + "uid": "PD8C576611E62080A" + }, + "fieldConfig": { + "defaults": { + "color": { + "mode": "thresholds" + }, + "mappings": [], + "max": 100, + "min": 0, + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "blue", + "index": 0 + }, + { + "color": "green", + "index": 1, + "value": 20 + }, + { + "color": "orange", + "index": 2, + "value": 40 + }, + { + "color": "red", + "index": 3, + "value": 80 + } + ] + }, + "unit": "celsius" + }, + "overrides": [] + }, + "gridPos": { + "h": 7, + "w": 7, + "x": 17, + "y": 7 }, "id": 14, "links": [], "options": { "displayMode": "lcd", - "fieldOptions": { - "calcs": ["mean"], - "defaults": { - "decimals": null, - "max": 100, - "min": 0, - "unit": "celsius" - }, - "mappings": [], - "override": {}, - "thresholds": [ - { - "color": "blue", - "index": 0, - "value": null - }, - { - "color": "green", - "index": 1, - "value": 20 - }, - { - "color": "orange", - "index": 2, - "value": 40 - }, - { - "color": "red", - "index": 3, - "value": 80 - } + "minVizHeight": 10, + "minVizWidth": 0, + "orientation": "horizontal", + "reduceOptions": { + "calcs": [ + "mean" ], + "fields": "", "values": false }, - "orientation": "horizontal" + "showUnfilled": true, + "valueMode": "hidden" }, - "pluginVersion": "6.2.0-pre", + "pluginVersion": "9.4.0-pre", "targets": [ { "alias": "Inside", + "datasource": { + "type": "testdata", + "uid": "PD8C576611E62080A" + }, "refId": "H", "scenarioId": "csv_metric_values", "stringInput": "100,100,100" }, { "alias": "Outhouse", + "datasource": { + "type": "testdata", + "uid": "PD8C576611E62080A" + }, "refId": "A", "scenarioId": "random_walk" }, { + "datasource": { + "type": "testdata", + "uid": "PD8C576611E62080A" + }, "refId": "F", "scenarioId": "random_walk" }, { + "datasource": { + "type": "testdata", + "uid": "PD8C576611E62080A" + }, "refId": "B", "scenarioId": "random_walk" }, { + "datasource": { + "type": "testdata", + "uid": "PD8C576611E62080A" + }, "refId": "C", "scenarioId": "random_walk" } ], - "timeFrom": null, - "timeShift": null, - "title": "LED", + "title": "LED + hidden value", "type": "bargauge" }, { + "datasource": { + "type": "testdata", + "uid": "PD8C576611E62080A" + }, + "fieldConfig": { + "defaults": { + "color": { + "mode": "thresholds" + }, + "mappings": [], + "max": 100, + "min": 0, + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "green", + "index": 0 + }, + { + "color": "orange", + "index": 1, + "value": 40 + }, + { + "color": "red", + "index": 2, + "value": 80 + } + ] + }, + "unit": "watt" + }, + "overrides": [] + }, "gridPos": { "h": 9, "w": 11, "x": 0, - "y": 7 + "y": 14 }, "id": 7, "links": [], "options": { "displayMode": "lcd", - "fieldOptions": { - "calcs": ["mean"], - "defaults": { - "decimals": null, - "max": 100, - "min": 0, - "unit": "watt" - }, - "mappings": [], - "override": {}, - "thresholds": [ - { - "color": "green", - "index": 0, - "value": null - }, - { - "color": "orange", - "index": 1, - "value": 40 - }, - { - "color": "red", - "index": 2, - "value": 80 - } + "minVizHeight": 10, + "minVizWidth": 0, + "orientation": "vertical", + "reduceOptions": { + "calcs": [ + "mean" ], + "fields": "", "values": false }, - "orientation": "vertical" + "showUnfilled": true, + "valueMode": "color" }, - "pluginVersion": "6.2.0-pre", + "pluginVersion": "9.4.0-pre", "targets": [ { + "datasource": { + "type": "testdata", + "uid": "PD8C576611E62080A" + }, "refId": "E", "scenarioId": "csv_metric_values", "stringInput": "10003,33333" }, { + "datasource": { + "type": "testdata", + "uid": "PD8C576611E62080A" + }, "refId": "F", "scenarioId": "random_walk" }, { + "datasource": { + "type": "testdata", + "uid": "PD8C576611E62080A" + }, "refId": "G", "scenarioId": "random_walk" }, { + "datasource": { + "type": "testdata", + "uid": "PD8C576611E62080A" + }, "refId": "H", "scenarioId": "csv_metric_values", "stringInput": "100,100,100" }, { + "datasource": { + "type": "testdata", + "uid": "PD8C576611E62080A" + }, "refId": "I", "scenarioId": "random_walk" }, { + "datasource": { + "type": "testdata", + "uid": "PD8C576611E62080A" + }, "refId": "J", "scenarioId": "random_walk" }, { + "datasource": { + "type": "testdata", + "uid": "PD8C576611E62080A" + }, "refId": "K", "scenarioId": "random_walk" }, { + "datasource": { + "type": "testdata", + "uid": "PD8C576611E62080A" + }, "refId": "L", "scenarioId": "random_walk" }, { + "datasource": { + "type": "testdata", + "uid": "PD8C576611E62080A" + }, "refId": "M", "scenarioId": "random_walk" }, { + "datasource": { + "type": "testdata", + "uid": "PD8C576611E62080A" + }, "refId": "N", "scenarioId": "random_walk" }, { + "datasource": { + "type": "testdata", + "uid": "PD8C576611E62080A" + }, "refId": "O", "scenarioId": "random_walk" - }, - { - "refId": "P", - "scenarioId": "random_walk" - }, - { - "refId": "Q", - "scenarioId": "random_walk" } ], - "timeFrom": null, - "timeShift": null, "title": "LED Vertical", "type": "bargauge" }, { + "datasource": { + "type": "testdata", + "uid": "PD8C576611E62080A" + }, + "fieldConfig": { + "defaults": { + "color": { + "mode": "thresholds" + }, + "mappings": [], + "max": 100, + "min": 0, + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "green", + "index": 0 + }, + { + "color": "purple", + "index": 1, + "value": 50 + }, + { + "color": "blue", + "index": 2, + "value": 70 + } + ] + }, + "unit": "watt" + }, + "overrides": [] + }, "gridPos": { "h": 9, "w": 13, "x": 11, - "y": 7 + "y": 14 }, "id": 8, "links": [], "options": { "displayMode": "basic", - "fieldOptions": { - "calcs": ["mean"], - "defaults": { - "decimals": null, - "max": 100, - "min": 0, - "unit": "watt" - }, - "mappings": [], - "override": {}, - "thresholds": [ - { - "color": "green", - "index": 0, - "value": null - }, - { - "color": "purple", - "index": 1, - "value": 50 - }, - { - "color": "blue", - "index": 2, - "value": 70 - } + "minVizHeight": 10, + "minVizWidth": 0, + "orientation": "vertical", + "reduceOptions": { + "calcs": [ + "mean" ], + "fields": "", "values": false }, - "orientation": "vertical" + "showUnfilled": true, + "valueMode": "color" }, - "pluginVersion": "6.2.0-pre", + "pluginVersion": "9.4.0-pre", "targets": [ { + "datasource": { + "type": "testdata", + "uid": "PD8C576611E62080A" + }, "refId": "H", "scenarioId": "csv_metric_values", "stringInput": "100,100,100" }, { + "datasource": { + "type": "testdata", + "uid": "PD8C576611E62080A" + }, "refId": "A", "scenarioId": "random_walk" }, { + "datasource": { + "type": "testdata", + "uid": "PD8C576611E62080A" + }, "refId": "B", "scenarioId": "random_walk" }, { + "datasource": { + "type": "testdata", + "uid": "PD8C576611E62080A" + }, "refId": "C", "scenarioId": "random_walk" }, { + "datasource": { + "type": "testdata", + "uid": "PD8C576611E62080A" + }, "refId": "D", "scenarioId": "random_walk" }, { + "datasource": { + "type": "testdata", + "uid": "PD8C576611E62080A" + }, "refId": "I", "scenarioId": "random_walk" }, { + "datasource": { + "type": "testdata", + "uid": "PD8C576611E62080A" + }, "refId": "J", "scenarioId": "random_walk" }, { + "datasource": { + "type": "testdata", + "uid": "PD8C576611E62080A" + }, "refId": "K", "scenarioId": "random_walk" }, { + "datasource": { + "type": "testdata", + "uid": "PD8C576611E62080A" + }, "refId": "L", "scenarioId": "random_walk" }, { + "datasource": { + "type": "testdata", + "uid": "PD8C576611E62080A" + }, "refId": "M", "scenarioId": "random_walk" }, { + "datasource": { + "type": "testdata", + "uid": "PD8C576611E62080A" + }, "refId": "N", "scenarioId": "random_walk" }, { + "datasource": { + "type": "testdata", + "uid": "PD8C576611E62080A" + }, "refId": "O", "scenarioId": "random_walk" }, { + "datasource": { + "type": "testdata", + "uid": "PD8C576611E62080A" + }, "refId": "P", "scenarioId": "random_walk" }, { + "datasource": { + "type": "testdata", + "uid": "PD8C576611E62080A" + }, "refId": "Q", "scenarioId": "random_walk" } ], - "timeFrom": null, - "timeShift": null, "title": "Basic vertical ", "type": "bargauge" }, { + "datasource": { + "type": "testdata", + "uid": "PD8C576611E62080A" + }, + "fieldConfig": { + "defaults": { + "color": { + "mode": "thresholds" + }, + "mappings": [], + "max": 100, + "min": 0, + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "green", + "index": 0 + }, + { + "color": "blue", + "index": 1, + "value": 40 + }, + { + "color": "red", + "index": 2, + "value": 80 + } + ] + } + }, + "overrides": [] + }, "gridPos": { "h": 7, "w": 11, "x": 0, - "y": 16 + "y": 23 }, "id": 16, "links": [], "options": { "displayMode": "lcd", - "fieldOptions": { - "calcs": ["last"], - "defaults": { - "max": 100, - "min": 0 - }, - "mappings": [], - "override": {}, - "thresholds": [ - { - "color": "green", - "index": 0, - "value": null - }, - { - "color": "blue", - "index": 1, - "value": 40 - }, - { - "color": "red", - "index": 2, - "value": 80 - } + "minVizHeight": 10, + "minVizWidth": 0, + "orientation": "horizontal", + "reduceOptions": { + "calcs": [ + "last" ], + "fields": "", "values": false }, - "orientation": "horizontal" + "showUnfilled": true, + "valueMode": "color" }, - "pluginVersion": "6.3.0-pre", + "pluginVersion": "9.4.0-pre", "targets": [ { + "datasource": { + "type": "testdata", + "uid": "PD8C576611E62080A" + }, "refId": "A", "scenarioId": "csv_metric_values", "stringInput": "1,20,90,30,5,0,-100" } ], - "timeFrom": null, - "timeShift": null, "title": "Negative value below min", "type": "bargauge" }, { + "datasource": { + "type": "testdata", + "uid": "PD8C576611E62080A" + }, + "fieldConfig": { + "defaults": { + "color": { + "mode": "thresholds" + }, + "mappings": [], + "max": 100, + "min": 0, + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "green", + "index": 0 + }, + { + "color": "blue", + "index": 1, + "value": 40 + }, + { + "color": "red", + "index": 2, + "value": 80 + } + ] + } + }, + "overrides": [] + }, "gridPos": { "h": 7, "w": 3, "x": 11, - "y": 16 + "y": 23 }, "id": 17, "links": [], "options": { "displayMode": "lcd", - "fieldOptions": { - "calcs": ["last"], - "defaults": { - "max": 100, - "min": 0 - }, - "mappings": [], - "override": {}, - "thresholds": [ - { - "color": "green", - "index": 0, - "value": null - }, - { - "color": "blue", - "index": 1, - "value": 40 - }, - { - "color": "red", - "index": 2, - "value": 80 - } + "minVizHeight": 10, + "minVizWidth": 0, + "orientation": "vertical", + "reduceOptions": { + "calcs": [ + "last" ], + "fields": "", "values": false }, - "orientation": "vertical" + "showUnfilled": true, + "valueMode": "color" }, - "pluginVersion": "6.3.0-pre", + "pluginVersion": "9.4.0-pre", "targets": [ { + "datasource": { + "type": "testdata", + "uid": "PD8C576611E62080A" + }, "refId": "A", "scenarioId": "csv_metric_values", "stringInput": "1,20,90,30,5,0,-100" } ], - "timeFrom": null, - "timeShift": null, "title": "Negative value below min", "type": "bargauge" }, { + "datasource": { + "type": "testdata", + "uid": "PD8C576611E62080A" + }, + "fieldConfig": { + "defaults": { + "color": { + "mode": "thresholds" + }, + "mappings": [], + "max": 100, + "min": -10, + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "green", + "index": 0 + }, + { + "color": "blue", + "index": 1, + "value": 40 + }, + { + "color": "red", + "index": 2, + "value": 80 + } + ] + } + }, + "overrides": [] + }, "gridPos": { "h": 7, "w": 3, "x": 14, - "y": 16 + "y": 23 }, "id": 18, "links": [], "options": { "displayMode": "lcd", - "fieldOptions": { - "calcs": ["last"], - "defaults": { - "max": 100, - "min": -10 - }, - "mappings": [], - "override": {}, - "thresholds": [ - { - "color": "green", - "index": 0, - "value": null - }, - { - "color": "blue", - "index": 1, - "value": 40 - }, - { - "color": "red", - "index": 2, - "value": 80 - } + "minVizHeight": 10, + "minVizWidth": 0, + "orientation": "vertical", + "reduceOptions": { + "calcs": [ + "last" ], + "fields": "", "values": false }, - "orientation": "vertical" + "showUnfilled": true, + "valueMode": "color" }, - "pluginVersion": "6.3.0-pre", + "pluginVersion": "9.4.0-pre", "targets": [ { + "datasource": { + "type": "testdata", + "uid": "PD8C576611E62080A" + }, "refId": "A", "scenarioId": "csv_metric_values", "stringInput": "1,20,90,30,5,6" } ], - "timeFrom": null, - "timeShift": null, "title": "Positive value above min", "type": "bargauge" }, { + "datasource": { + "type": "testdata", + "uid": "PD8C576611E62080A" + }, + "fieldConfig": { + "defaults": { + "color": { + "mode": "thresholds" + }, + "mappings": [], + "max": 35, + "min": -20, + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "blue", + "index": 0 + }, + { + "color": "green", + "index": 1, + "value": 5 + }, + { + "color": "#EAB839", + "index": 2, + "value": 25 + }, + { + "color": "red", + "index": 3, + "value": 30 + } + ] + } + }, + "overrides": [] + }, "gridPos": { "h": 7, "w": 3, "x": 17, - "y": 16 + "y": 23 }, "id": 19, "links": [], "options": { "displayMode": "lcd", - "fieldOptions": { - "calcs": ["last"], - "defaults": { - "max": 35, - "min": -20 - }, - "mappings": [], - "override": {}, - "thresholds": [ - { - "color": "blue", - "index": 0, - "value": null - }, - { - "color": "green", - "index": 1, - "value": 5 - }, - { - "color": "#EAB839", - "index": 2, - "value": 25 - }, - { - "color": "red", - "index": 3, - "value": 30 - } + "minVizHeight": 10, + "minVizWidth": 0, + "orientation": "vertical", + "reduceOptions": { + "calcs": [ + "last" ], + "fields": "", "values": false }, - "orientation": "vertical" + "showUnfilled": true, + "valueMode": "color" }, - "pluginVersion": "6.3.0-pre", + "pluginVersion": "9.4.0-pre", "targets": [ { + "datasource": { + "type": "testdata", + "uid": "PD8C576611E62080A" + }, "refId": "A", "scenarioId": "csv_metric_values", "stringInput": "1,20,90,30,5,6" } ], - "timeFrom": null, - "timeShift": null, "title": "Negative min ", "type": "bargauge" }, { + "datasource": { + "type": "testdata", + "uid": "PD8C576611E62080A" + }, + "fieldConfig": { + "defaults": { + "color": { + "mode": "thresholds" + }, + "mappings": [], + "max": 35, + "min": -20, + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "blue", + "index": 0 + }, + { + "color": "green", + "index": 1, + "value": 5 + }, + { + "color": "#EAB839", + "index": 2, + "value": 25 + }, + { + "color": "red", + "index": 3, + "value": 30 + } + ] + } + }, + "overrides": [] + }, "gridPos": { "h": 7, "w": 4, "x": 20, - "y": 16 + "y": 23 }, "id": 20, "links": [], "options": { "displayMode": "gradient", - "fieldOptions": { - "calcs": ["last"], - "defaults": { - "max": 35, - "min": -20 - }, - "mappings": [], - "override": {}, - "thresholds": [ - { - "color": "blue", - "index": 0, - "value": null - }, - { - "color": "green", - "index": 1, - "value": 5 - }, - { - "color": "#EAB839", - "index": 2, - "value": 25 - }, - { - "color": "red", - "index": 3, - "value": 30 - } + "minVizHeight": 10, + "minVizWidth": 0, + "orientation": "vertical", + "reduceOptions": { + "calcs": [ + "last" ], + "fields": "", "values": false }, - "orientation": "vertical" + "showUnfilled": true, + "valueMode": "color" }, - "pluginVersion": "6.3.0-pre", + "pluginVersion": "9.4.0-pre", "targets": [ { + "datasource": { + "type": "testdata", + "uid": "PD8C576611E62080A" + }, "refId": "A", "scenarioId": "csv_metric_values", "stringInput": "30,30" } ], - "timeFrom": null, - "timeShift": null, "title": "Negative min", "type": "bargauge" } ], - "schemaVersion": 18, + "revision": 1, + "schemaVersion": 38, "style": "dark", - "tags": ["gdev", "panel-tests"], + "tags": [ + "gdev", + "panel-tests" + ], "templating": { "list": [] }, @@ -819,11 +1413,33 @@ "to": "now" }, "timepicker": { - "refresh_intervals": ["5s", "10s", "30s", "1m", "5m", "15m", "30m", "1h", "2h", "1d"], - "time_options": ["5m", "15m", "1h", "6h", "12h", "24h", "2d", "7d", "30d"] + "refresh_intervals": [ + "5s", + "10s", + "30s", + "1m", + "5m", + "15m", + "30m", + "1h", + "2h", + "1d" + ], + "time_options": [ + "5m", + "15m", + "1h", + "6h", + "12h", + "24h", + "2d", + "7d", + "30d" + ] }, "timezone": "", "title": "Panel Tests - Bar Gauge", "uid": "O6f11TZWk", - "version": 12 + "version": 1, + "weekStart": "" } diff --git a/devenv/dev-dashboards/panel-table/table_tests_new.json b/devenv/dev-dashboards/panel-table/table_tests_new.json index 11c6c8c0eb8..92143922121 100644 --- a/devenv/dev-dashboards/panel-table/table_tests_new.json +++ b/devenv/dev-dashboards/panel-table/table_tests_new.json @@ -3,7 +3,10 @@ "list": [ { "builtIn": 1, - "datasource": "-- Grafana --", + "datasource": { + "type": "datasource", + "uid": "grafana" + }, "enable": true, "hide": true, "iconColor": "rgba(0, 211, 255, 1)", @@ -13,12 +16,16 @@ ] }, "editable": true, - "gnetId": null, + "fiscalYearStartMonth": 0, "graphTooltip": 0, "links": [], + "liveNow": false, "panels": [ { - "datasource": null, + "datasource": { + "type": "datasource", + "uid": "grafana" + }, "gridPos": { "h": 1, "w": 24, @@ -26,11 +33,23 @@ "y": 0 }, "id": 7, + "targets": [ + { + "datasource": { + "type": "datasource", + "uid": "grafana" + }, + "refId": "A" + } + ], "title": "Cell styles", "type": "row" }, { - "datasource": "gdev-testdata", + "datasource": { + "type": "testdata", + "uid": "gdev-testdata" + }, "fieldConfig": { "defaults": { "color": { @@ -38,16 +57,19 @@ }, "custom": { "align": "center", - "displayMode": "color-background", - "filterable": false + "cellOptions": { + "mode": "gradient", + "type": "color-background" + }, + "filterable": false, + "inspect": false }, "mappings": [], "thresholds": { "mode": "percentage", "steps": [ { - "color": "green", - "value": null + "color": "green" }, { "color": "blue", @@ -124,7 +146,17 @@ }, "id": 4, "options": { + "cellHeight": "md", + "footer": { + "countRows": false, + "fields": "", + "reducer": [ + "sum" + ], + "show": false + }, "showHeader": true, + "showRowNums": false, "sortBy": [ { "desc": true, @@ -132,17 +164,19 @@ } ] }, - "pluginVersion": "", + "pluginVersion": "9.5.0-pre", "targets": [ { + "datasource": { + "type": "testdata", + "uid": "gdev-testdata" + }, "refId": "A", "scenarioId": "random_walk", "seriesCount": 15, "stringInput": "" } ], - "timeFrom": null, - "timeShift": null, "title": "Colored background", "transformations": [ { @@ -159,23 +193,29 @@ "type": "table" }, { - "datasource": "gdev-testdata", + "datasource": { + "type": "testdata", + "uid": "PD8C576611E62080A" + }, "fieldConfig": { "defaults": { "color": { "mode": "thresholds" }, "custom": { - "align": null, - "filterable": false + "align": "center", + "cellOptions": { + "type": "auto" + }, + "filterable": false, + "inspect": false }, "mappings": [], "thresholds": { "mode": "percentage", "steps": [ { - "color": "orange", - "value": null + "color": "orange" }, { "color": "red", @@ -188,60 +228,51 @@ { "matcher": { "id": "byName", - "options": "A" + "options": "Basic " }, "properties": [ { - "id": "custom.displayMode", - "value": "gradient-gauge" + "id": "custom.cellOptions", + "value": { + "mode": "basic", + "type": "gauge" + } + }, + { + "id": "custom.inspect", + "value": false } ] }, { "matcher": { "id": "byName", - "options": "Info" + "options": "Gradient text color value" }, "properties": [ { - "id": "custom.width", - "value": 92 + "id": "custom.cellOptions", + "value": { + "mode": "gradient", + "type": "gauge", + "valueMode": "text" + } } ] }, { "matcher": { "id": "byName", - "options": "Min" + "options": "LCD hidden value" }, "properties": [ { - "id": "custom.width", - "value": 76 - } - ] - }, - { - "matcher": { - "id": "byName", - "options": "Max" - }, - "properties": [ - { - "id": "custom.width", - "value": 89 - } - ] - }, - { - "matcher": { - "id": "byName", - "options": "Time" - }, - "properties": [ - { - "id": "custom.width", - "value": 165 + "id": "custom.cellOptions", + "value": { + "mode": "lcd", + "type": "gauge", + "valueMode": "hidden" + } } ] } @@ -249,13 +280,22 @@ }, "gridPos": { "h": 16, - "w": 8, + "w": 17, "x": 7, "y": 1 }, "id": 2, "options": { + "footer": { + "countRows": false, + "fields": "", + "reducer": [ + "sum" + ], + "show": false + }, "showHeader": true, + "showRowNums": false, "sortBy": [ { "desc": false, @@ -263,22 +303,25 @@ } ] }, - "pluginVersion": "", + "pluginVersion": "9.5.0-pre", "targets": [ { + "datasource": { + "type": "testdata", + "uid": "PD8C576611E62080A" + }, "refId": "A", "scenarioId": "random_walk_table", "stringInput": "" } ], - "timeFrom": null, - "timeShift": null, "title": "Bar gauge cells", "transformations": [ { "id": "organize", "options": { "excludeByName": { + "Info": true, "Time": true }, "indexByName": { @@ -288,35 +331,43 @@ "Time": 0, "Value": 4 }, - "renameByName": {} + "renameByName": { + "A": "LCD hidden value", + "Max": "Gradient text color value", + "Min": "Basic " + } } } ], "type": "table" }, { - "datasource": "gdev-testdata", - "description": "", + "datasource": { + "type": "testdata", + "uid": "PD8C576611E62080A" + }, "fieldConfig": { "defaults": { "color": { "mode": "thresholds" }, "custom": { - "align": null, - "filterable": false + "align": "auto", + "cellOptions": { + "type": "auto" + }, + "inspect": false }, "mappings": [], "thresholds": { - "mode": "percentage", + "mode": "absolute", "steps": [ { - "color": "blue", - "value": null + "color": "green" }, { - "color": "green", - "value": 50 + "color": "red", + "value": 80 } ] } @@ -325,82 +376,329 @@ { "matcher": { "id": "byName", - "options": "A" + "options": "rate" }, "properties": [ { - "id": "custom.displayMode", - "value": "lcd-gauge" + "id": "custom.cellOptions", + "value": { + "fillOpacity": 29, + "gradientMode": "opacity", + "lineWidth": 1, + "type": "sparkline" + } }, { - "id": "custom.align", - "value": "center" + "id": "color", + "value": { + "mode": "continuous-GrYlRd" + } + } + ] + }, + { + "matcher": { + "id": "byName", + "options": "cluster" + }, + "properties": [ + { + "id": "custom.width", + "value": 120 + } + ] + }, + { + "matcher": { + "id": "byName", + "options": "service" + }, + "properties": [ + { + "id": "custom.width", + "value": 120 } ] } ] }, "gridPos": { - "h": 16, + "h": 7, "w": 9, - "x": 15, - "y": 1 + "x": 0, + "y": 17 }, - "id": 5, + "id": 14, + "maxDataPoints": 50, "options": { + "cellHeight": "md", + "footer": { + "countRows": false, + "fields": "", + "reducer": [ + "sum" + ], + "show": false + }, "showHeader": true, + "showRowNums": false, "sortBy": [] }, - "pluginVersion": "", + "pluginVersion": "9.5.0-pre", "targets": [ { + "datasource": { + "type": "testdata", + "uid": "gdev-testdata" + }, + "labels": "cluster=eu,service=checkout", + "min": 0.1, "refId": "A", - "scenarioId": "random_walk_table", - "stringInput": "" + "scenarioId": "random_walk", + "seriesCount": 3 } ], - "timeFrom": null, - "timeShift": null, - "title": "Retro LCD cell", + "title": "Sparkline cell", "transformations": [ + { + "id": "timeSeriesTable", + "options": {} + }, { "id": "organize", "options": { - "excludeByName": { - "Info": false, - "Max": true, - "Min": true, - "Time": false - }, - "indexByName": { - "Info": 1, - "Max": 3, - "Min": 2, - "Time": 0, - "Value": 4 - }, - "renameByName": {} + "excludeByName": {}, + "indexByName": {}, + "renameByName": { + "Trend": "rate" + } } } ], "type": "table" }, { - "collapsed": false, - "datasource": "gdev-testdata", + "datasource": { + "type": "testdata", + "uid": "PD8C576611E62080A" + }, + "fieldConfig": { + "defaults": { + "color": { + "mode": "thresholds" + }, + "custom": { + "align": "auto", + "cellOptions": { + "type": "auto" + }, + "inspect": false + }, + "mappings": [], + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "green" + }, + { + "color": "red", + "value": 80 + } + ] + } + }, + "overrides": [ + { + "matcher": { + "id": "byName", + "options": "rate" + }, + "properties": [ + { + "id": "custom.cellOptions", + "value": { + "drawStyle": "bars", + "fillOpacity": 100, + "gradientMode": "hue", + "lineWidth": 0, + "showPoints": "auto", + "type": "sparkline" + } + }, + { + "id": "color", + "value": { + "mode": "continuous-GrYlRd" + } + }, + { + "id": "color", + "value": { + "fixedColor": "red", + "mode": "fixed" + } + } + ] + }, + { + "matcher": { + "id": "byName", + "options": "latency" + }, + "properties": [ + { + "id": "custom.cellOptions", + "value": { + "fillOpacity": 40, + "gradientMode": "opacity", + "lineInterpolation": "stepBefore", + "lineWidth": 1, + "type": "sparkline" + } + }, + { + "id": "color", + "value": { + "fixedColor": "purple", + "mode": "fixed" + } + } + ] + }, + { + "matcher": { + "id": "byName", + "options": "service" + }, + "properties": [ + { + "id": "custom.width", + "value": 120 + } + ] + }, + { + "matcher": { + "id": "byName", + "options": "cluster" + }, + "properties": [ + { + "id": "custom.width", + "value": 120 + } + ] + } + ] + }, + "gridPos": { + "h": 7, + "w": 15, + "x": 9, + "y": 17 + }, + "id": 15, + "maxDataPoints": 30, + "options": { + "cellHeight": "md", + "footer": { + "countRows": false, + "fields": "", + "reducer": [ + "sum" + ], + "show": false + }, + "showHeader": true, + "showRowNums": false + }, + "pluginVersion": "9.5.0-pre", + "targets": [ + { + "datasource": { + "type": "testdata", + "uid": "gdev-testdata" + }, + "labels": "cluster=eu,service=checkout", + "min": 0.1, + "refId": "A", + "scenarioId": "random_walk", + "seriesCount": 3 + }, + { + "datasource": { + "type": "testdata", + "uid": "gdev-testdata" + }, + "hide": false, + "labels": "cluster=eu,service=checkout", + "min": 0.1, + "refId": "B", + "scenarioId": "random_walk", + "seriesCount": 3 + } + ], + "title": "Multiple sparkline cells per row", + "transformations": [ + { + "id": "timeSeriesTable", + "options": {} + }, + { + "id": "joinByField", + "options": { + "byField": "service", + "mode": "outer" + } + }, + { + "id": "organize", + "options": { + "excludeByName": { + "cluster 2": true + }, + "indexByName": {}, + "renameByName": { + "Trend": "rate", + "Trend #A": "rate", + "Trend #B": "latency", + "cluster 1": "cluster" + } + } + } + ], + "type": "table" + }, + { + "datasource": { + "type": "testdata", + "uid": "gdev-testdata" + }, "gridPos": { "h": 1, "w": 24, "x": 0, - "y": 17 + "y": 24 }, "id": 9, - "panels": [], + "targets": [ + { + "datasource": { + "type": "testdata", + "uid": "gdev-testdata" + }, + "refId": "A" + } + ], "title": "Data links", "type": "row" }, { - "datasource": "gdev-testdata", + "datasource": { + "type": "testdata", + "uid": "gdev-testdata" + }, "fieldConfig": { "defaults": { "color": { @@ -408,8 +706,11 @@ }, "custom": { "align": "center", - "displayMode": "color-text", - "filterable": false + "cellOptions": { + "type": "color-text" + }, + "filterable": false, + "inspect": false }, "decimals": 2, "mappings": [], @@ -417,8 +718,7 @@ "mode": "percentage", "steps": [ { - "color": "green", - "value": null + "color": "green" }, { "color": "blue", @@ -444,8 +744,7 @@ }, "properties": [ { - "id": "custom.align", - "value": null + "id": "custom.align" } ] }, @@ -472,17 +771,30 @@ "h": 8, "w": 12, "x": 0, - "y": 18 + "y": 25 }, "id": 3, - "maxDataPoints": "10", "options": { - "showHeader": true + "cellHeight": "md", + "footer": { + "countRows": false, + "fields": "", + "reducer": [ + "sum" + ], + "show": false + }, + "showHeader": true, + "showRowNums": false }, - "pluginVersion": "", + "pluginVersion": "9.5.0-pre", "targets": [ { "alias": "S1", + "datasource": { + "type": "testdata", + "uid": "gdev-testdata" + }, "labels": "server=A", "refId": "A", "scenarioId": "random_walk", @@ -491,6 +803,10 @@ }, { "alias": "S2", + "datasource": { + "type": "testdata", + "uid": "gdev-testdata" + }, "labels": "server=B", "refId": "B", "scenarioId": "random_walk", @@ -499,6 +815,10 @@ }, { "alias": "S3", + "datasource": { + "type": "testdata", + "uid": "gdev-testdata" + }, "labels": "server=C", "refId": "C", "scenarioId": "random_walk", @@ -506,8 +826,6 @@ "stringInput": "" } ], - "timeFrom": null, - "timeShift": null, "title": "Data link with labels and numeric value", "transformations": [ { @@ -518,7 +836,10 @@ "type": "table" }, { - "datasource": "gdev-testdata", + "datasource": { + "type": "testdata", + "uid": "gdev-testdata" + }, "fieldConfig": { "defaults": { "color": { @@ -526,16 +847,18 @@ }, "custom": { "align": "center", - "displayMode": "auto", - "filterable": false + "cellOptions": { + "type": "auto" + }, + "filterable": false, + "inspect": false }, "mappings": [], "thresholds": { "mode": "percentage", "steps": [ { - "color": "green", - "value": null + "color": "green" }, { "color": "blue", @@ -559,11 +882,21 @@ "h": 8, "w": 5, "x": 12, - "y": 18 + "y": 25 }, "id": 10, "options": { + "cellHeight": "md", + "footer": { + "countRows": false, + "fields": "", + "reducer": [ + "sum" + ], + "show": false + }, "showHeader": false, + "showRowNums": false, "sortBy": [ { "desc": true, @@ -571,17 +904,19 @@ } ] }, - "pluginVersion": "", + "pluginVersion": "9.5.0-pre", "targets": [ { + "datasource": { + "type": "testdata", + "uid": "gdev-testdata" + }, "refId": "A", "scenarioId": "random_walk_table", "seriesCount": 5, "stringInput": "" } ], - "timeFrom": null, - "timeShift": null, "title": "No header", "transformations": [ { @@ -606,7 +941,10 @@ "type": "table" }, { - "datasource": "gdev-testdata", + "datasource": { + "type": "testdata", + "uid": "gdev-testdata" + }, "fieldConfig": { "defaults": { "color": { @@ -614,15 +952,17 @@ }, "custom": { "align": "auto", - "displayMode": "auto" + "cellOptions": { + "type": "auto" + }, + "inspect": false }, "mappings": [], "thresholds": { "mode": "absolute", "steps": [ { - "color": "green", - "value": 0 + "color": "green" }, { "color": "red", @@ -637,25 +977,39 @@ "h": 8, "w": 12, "x": 0, - "y": 26 + "y": 33 }, "id": 12, "options": { + "cellHeight": "md", "footer": { - "show": true, + "countRows": false, "fields": "", "reducer": [ "sum" - ] + ], + "show": true }, - "showHeader": true + "showHeader": true, + "showRowNums": false }, - "pluginVersion": "", + "pluginVersion": "9.5.0-pre", + "targets": [ + { + "datasource": { + "type": "testdata", + "uid": "gdev-testdata" + }, + "refId": "A" + } + ], "title": "Footer", "type": "table" } ], - "schemaVersion": 27, + "refresh": "", + "revision": 1, + "schemaVersion": 38, "style": "dark", "tags": [ "gdev", @@ -684,5 +1038,6 @@ "timezone": "", "title": "Panel Tests - React Table", "uid": "U_bZIMRMk", - "version": 6 + "version": 7, + "weekStart": "" } \ No newline at end of file diff --git a/devenv/docker/blocks/loki/data/data.js b/devenv/docker/blocks/loki/data/data.js index 7ab907c0797..8462deed770 100644 --- a/devenv/docker/blocks/loki/data/data.js +++ b/devenv/docker/blocks/loki/data/data.js @@ -47,10 +47,7 @@ async function sleep(duration) { }); } -async function lokiSendLogLine(timestampMs, line, tags) { - // we keep nanosecond-timestamp in a string because - // as a number it would be too large - const timestampNs = `${timestampMs}000000`; +async function lokiSendLogLine(timestampNs, line, tags) { const data = { streams: [ { @@ -136,6 +133,24 @@ function calculateDelays(pointsCount) { return delays; } +function getRandomNanosecPart() { + // we want to have cases with milliseconds-only, with microsec and nanosec. + const mode = Math.random(); + + if (mode < 0.333) { + // only milisec precision + return '000000'; + } + + if (mode < 0.666) { + // microsec precision + return Math.trunc(Math.random()*1000).toString().padStart(3, '0') + '000' + } + + // nanosec precision + return Math.trunc(Math.random()*1000000).toString().padStart(6, '0') +} + async function main() { const delays = calculateDelays(DAYS * POINTS_PER_DAY); @@ -144,9 +159,10 @@ async function main() { for(let i =0; i < delays.length; i++ ) { // i cannot do a forEach because of the `await` inside const delay = delays[i]; timestampMs += Math.trunc(delay * timeRange); + const timestampNs = `${timestampMs}${getRandomNanosecPart()}`; const item = getRandomLogItem(i + 1) - await lokiSendLogLine(timestampMs, JSON.stringify(item), {place:'moon', source: 'data', instance: 'server\\1', job: '"grafana/data"'}); - await lokiSendLogLine(timestampMs, logFmtLine(item), {place:'luna', source: 'data', instance: 'server\\2', job: '"grafana/data"'}); + await lokiSendLogLine(timestampNs, JSON.stringify(item), {place:'moon', source: 'data', instance: 'server\\1', job: '"grafana/data"'}); + await lokiSendLogLine(timestampNs, logFmtLine(item), {place:'luna', source: 'data', instance: 'server\\2', job: '"grafana/data"'}); }; } diff --git a/docs/sources/alerting/_index.md b/docs/sources/alerting/_index.md index 71d1cb2ae9e..cb6bc13f9ec 100644 --- a/docs/sources/alerting/_index.md +++ b/docs/sources/alerting/_index.md @@ -2,6 +2,11 @@ aliases: - about-alerting/ - unified-alerting/alerting/ +cascade: + labels: + products: + - cloud + - oss title: Alerting weight: 114 --- diff --git a/docs/sources/dashboards/dashboard-public/index.md b/docs/sources/dashboards/dashboard-public/index.md index 5563ca7683b..d6b85e8ea1b 100644 --- a/docs/sources/dashboards/dashboard-public/index.md +++ b/docs/sources/dashboards/dashboard-public/index.md @@ -38,7 +38,7 @@ If you are using Docker, use an environment variable to enable public dashboards --env GF_FEATURE_TOGGLES_ENABLE=publicDashboards ``` -> **Note:** For Grafana Cloud, you will need to contact support to have the feature enabled. +> **Note:** For Grafana Cloud, contact support to have the feature enabled. ## Make a dashboard public @@ -64,7 +64,63 @@ The dashboard is no longer accessible, even with the link, until you make it sha The link no longer works. You must create a new public URL as in [Make a dashboard public](#make-a-dashboard-public). -## Supported datasources +## Email sharing + +> **Note:** Available in [Grafana Enterprise]({{< relref "../../introduction/grafana-enterprise/" >}}) and [Grafana Cloud Pro and Advanced](/docs/grafana-cloud). + +Email sharing allows you to share your public dashboard with only specific people via email, instead of having it accessible to anyone with the URL. + +### Enable email sharing + +> **Note:** For Grafana Cloud, contact support to have the feature enabled. + +Add the `publicDashboardsEmailSharing` feature toggle to your `custom.ini` file. + +``` +[feature_toggles] +publicDashboardsEmailSharing = true +``` + +### Invite a viewer + +1. Click the sharing icon to the right of the dashboard title. +1. Click the **Public dashboard** tab. +1. Click **Only specified people**. +1. Enter the email you want to share the public dashboard with. +1. Click **Invite**. +1. The recipient(s) will receive an email with a one-time use link. This link must be used within **one hour** or it expires. Once the link is used, the viewer has access to the public dashboard for **30 days**. + +### Viewers requesting access + +If a viewer without access tries to navigate to the public dashboard, they'll be asked to request access by providing their email. They will receive an email with a new one-time use link if the email they provided has already been invited to view the public dashboard and has not been revoked. + +If the viewer doesn't have an invitation or it's been revoked, you won't be notified and no link is sent. + +### Revoke access for a viewer + +1. Click the sharing icon to the right of the dashboard title. +1. Click the **Public dashboard** tab. +1. Click **Revoke** on the viewer you'd like to revoke access for. + +Immediately, the viewer no longer has access to the public dashboard, nor can they use any existing one-time use links they may have. + +### Reinvite a viewer + +1. Click the sharing icon to the right of the dashboard title. +1. Click the **Public dashboard** tab. +1. Click **Resend** on the viewer you'd like to re-share the public dashboard with. + +The viewer will receive an email with a new one-time use link. This will invalidate all previously issued links for that viewer. + +### Access limitations + +One-time use links use browser cookies, so when a viewer is granted access via one of these links, they will only have access through the browser they used to claim the link. + +A single viewer cannot generate multiple valid one-time use links. When a new one-time use link is issued for a viewer, all previous ones are invalidated. + +If a Grafana user has read access to the parent dashboard, they can view the public dashboard without needing to have access granted. + +## Supported data sources Public dashboards _should_ work with any datasource that has the properties `backend` and `alerting` both set to true in it's `package.json`. However, this cannot always be guaranteed because plugin developers can override this functionality. The following lists include data sources confirmed to work with public dashboards and data sources that should work but have not been confirmed as compatible. @@ -166,7 +222,6 @@ guaranteed because plugin developers can override this functionality. The follow - Panels that use frontend datasources will fail to fetch data. - Template variables are currently not supported, but are planned to be in the future. -- The time range is permanently set to the default time range on the dashboard. If you update the default time range for a dashboard, it will be reflected in the public dashboard. - Exemplars will be omitted from the panel. - Only annotations that query the `-- Grafana --` datasource are supported. - Organization annotations are not supported. diff --git a/docs/sources/datasources/testdata/_index.md b/docs/sources/datasources/testdata/_index.md index d81f41d6f85..de1e9953e0d 100644 --- a/docs/sources/datasources/testdata/_index.md +++ b/docs/sources/datasources/testdata/_index.md @@ -60,6 +60,7 @@ You can assign an **Alias** to each scenario, and many have their own options th - **CSV Metric Values** - **Datapoints Outside Range** - **Exponential heatmap bucket data** +- **Flame Graph** - **Grafana API** - **Grafana Live** - **Linear heatmap bucket data** @@ -77,6 +78,7 @@ You can assign an **Alias** to each scenario, and many have their own options th - **Slow Query** - **Streaming Client** - **Table Static** +- **Trace** - **USA generated data** ## Import a pre-configured dashboard diff --git a/docs/sources/developers/angular_deprecation.md b/docs/sources/developers/angular_deprecation.md index 8051888a8ba..7b2e48433be 100644 --- a/docs/sources/developers/angular_deprecation.md +++ b/docs/sources/developers/angular_deprecation.md @@ -10,26 +10,30 @@ weight: 500 # Angular support deprecation -Angular plugin support is deprecated, and it will be removed in a future release. There are still many community plugins that depend on Grafana’s angular plugin support for them to work. The same is true for many internal (private) plugins developed over the years by Grafana users. Grafana version 9 will have a server configuration option, global for the whole instance, that will control if angular plugin support is available or not. By default angular support is still enabled but this will soon change as we complete the migration of all angular code in the core product. +Angular plugin support is deprecated and will be removed in a future release. There are still many community plugins that rely on Grafana's Angular plugin support to work. The same is true for many internal (private) plugins that have been developed by Grafana users over the years. Grafana version 9 has a server configuration option that is global to the entire instance and controls whether Angular plugin support is available or not. By default, Angular support is still enabled, but that will change soon once we complete the migration of all Angular code in the core product. -## Why are we deprecating angular support? +## Why are we deprecating Angular support? -AngularJS is an old frontend framework that stopped active development many years ago. As a result, it is a security risk. AngularJS also requires unsafe-eval in the CSP (Content Security Policy) settings which also reduces the security level of how javascript is executed in the browser. +AngularJS is an old frontend framework whose active development stopped many years ago. Therefore, it poses a security risk. As Grafana itself had already started migrating to React in v5, this presented the most logical framework for our plugin platform. AngularJS also requires unsafe-eval in the CSP (Content Security Policy) settings, which also reduces the security of running JavaScript in the browser. -## When will angular plugins stop working? +## When will Angular plugins stop working? -We hope to migrate the last remaining angular code in core Grafana later this year. Then the setting enable_angular_support can be disable by default. This will make all angular plugins stop working. If you still depend on community or internally developed plugins that require AngularJS then you will have to enable this option. +Our goal is to transfer all the remaining Angular code to the core of Grafana before Grafana 10 is released in Summer 2023. Once this is done, the option "[angular_support_enabled](https://github.com/grafana/grafana/blob/d61bcdf4ca5e69489e0067c56fbe7f0bfdf84ee4/conf/defaults.ini#L362)" will be disabled by default, resulting in the deactivation of all Angular plugins. In case you still rely on AngularJS-based plugins developed internally or by the community, you will need to enable this option to continue using them. -This is a good time to start working on migrating plugins to React. +## When will we remove Angular support completely? -Our plan is to fully remove angular plugin support in version 10 released in 2023. Meaning all plugins that do depend on angular will stop working and this temporary option to enable it introduced in v9 will be removed. +Our plan is to completely remove support for Angular plugins in version 11, which will be released in 2024. This means that all plugins that depend on Angular will stop working and the temporary option introduced in version 10 to enable Angular will be removed. -## How do I migrate an angular plugin to React? +## How do I migrate an Angular plugin to React? Depending on if it’s a data source plugin, panel plugin, or app plugin the process will differ. For panels, the rendering logic could in some cases be easily preserved but all options need to be redone to use the declarative options framework. For data source plugins the query editor and config options will likely need a total rewrite. +## How do I encourage a community plugin to migrate? + +We encourage you to locate the repository of the corresponding plugin and create or upvote an Issue within it if you are using a plugin that is still based on Angular. + ### Links - [Migrate Angular to React](https://grafana.com/docs/grafana/latest/developers/plugins/migration-guide/#migrate-a-plugin-from-angular-to-react) diff --git a/docs/sources/developers/kinds/composable/bargaugepanelcfg/schema-reference.md b/docs/sources/developers/kinds/composable/bargaugepanelcfg/schema-reference.md index 1e8bf65de88..a4ecf690870 100644 --- a/docs/sources/developers/kinds/composable/bargaugepanelcfg/schema-reference.md +++ b/docs/sources/developers/kinds/composable/bargaugepanelcfg/schema-reference.md @@ -27,6 +27,7 @@ It extends [SingleStatBaseOptions](#singlestatbaseoptions). | `minVizHeight` | uint32 | **Yes** | Default: `10`. | | `minVizWidth` | uint32 | **Yes** | Default: `0`. | | `showUnfilled` | boolean | **Yes** | Default: `true`. | +| `valueMode` | string | **Yes** | Allows for the table cell gauge display type to set the gauge mode.
Possible values are: `color`, `text`, `hidden`. | | `orientation` | string | No | *(Inherited from [SingleStatBaseOptions](#singlestatbaseoptions))*
TODO docs
Possible values are: `auto`, `vertical`, `horizontal`. | | `reduceOptions` | [ReduceDataOptions](#reducedataoptions) | No | *(Inherited from [SingleStatBaseOptions](#singlestatbaseoptions))*
TODO docs | | `text` | [VizTextDisplayOptions](#viztextdisplayoptions) | No | *(Inherited from [SingleStatBaseOptions](#singlestatbaseoptions))*
TODO docs | diff --git a/docs/sources/developers/kinds/composable/tablepanelcfg/schema-reference.md b/docs/sources/developers/kinds/composable/tablepanelcfg/schema-reference.md index 33e565a7039..f012f709d25 100644 --- a/docs/sources/developers/kinds/composable/tablepanelcfg/schema-reference.md +++ b/docs/sources/developers/kinds/composable/tablepanelcfg/schema-reference.md @@ -23,6 +23,7 @@ title: TablePanelCfg kind |-----------------|---------------------------------------------------|----------|--------------------------------------------------------------------------------------| | `frameIndex` | number | **Yes** | Represents the index of the selected frame Default: `0`. | | `showHeader` | boolean | **Yes** | Controls whether the panel should show the header Default: `true`. | +| `cellHeight` | string | No | Height of a table cell
Possible values are: `sm`, `md`, `lg`. | | `footer` | [object](#footer) | No | Controls footer options Default: `map[countRows:false reducer:[] show:false]`. | | `showRowNums` | boolean | No | Controls whether the columns should be numbered Default: `false`. | | `showTypeIcons` | boolean | No | Controls whether the header should show icons for the column types Default: `false`. | diff --git a/docs/sources/developers/kinds/core/dashboard/schema-reference.md b/docs/sources/developers/kinds/core/dashboard/schema-reference.md index 2733eb423c0..92f5834fd29 100644 --- a/docs/sources/developers/kinds/core/dashboard/schema-reference.md +++ b/docs/sources/developers/kinds/core/dashboard/schema-reference.md @@ -195,11 +195,12 @@ TODO docs TODO docs -| Property | Type | Required | Description | -|----------|--------|----------|-----------------------------------------------------------------------------------------------------------------------------------------------------| -| `color` | string | **Yes** | TODO docs | -| `state` | string | No | TODO docs
TODO are the values here enumerable into a disjunction?
Some seem to be listed in typescript comment | -| `value` | number | No | TODO docs
FIXME the corresponding typescript field is required/non-optional, but nulls currently appear here when serializing -Infinity to JSON | +| Property | Type | Required | Description | +|----------|---------|----------|-----------------------------------------------------------------------------------------------------------------------------------------------------| +| `color` | string | **Yes** | TODO docs | +| `index` | integer | No | Threshold index, an old property that is not needed an should only appear in older dashboards | +| `state` | string | No | TODO docs
TODO are the values here enumerable into a disjunction?
Some seem to be listed in typescript comment | +| `value` | number | No | TODO docs
FIXME the corresponding typescript field is required/non-optional, but nulls currently appear here when serializing -Infinity to JSON | ### ValueMapping diff --git a/docs/sources/developers/plugins/metadata.md b/docs/sources/developers/plugins/metadata.md index 2b2b343499f..9a6628e4173 100644 --- a/docs/sources/developers/plugins/metadata.md +++ b/docs/sources/developers/plugins/metadata.md @@ -22,25 +22,23 @@ The plugin.json file is required for all plugins. When Grafana starts, it scans | `info` | [object](#info) | **Yes** | Metadata for the plugin. Some fields are used on the plugins page in Grafana and others on grafana.com if the plugin is published. | | `dependencies` | [object](#dependencies) | **Yes** | Dependency information related to Grafana and other plugins. | | `$schema` | string | No | Schema definition for the plugin.json file. Used primarily for schema validation. | -| `alerting` | boolean | No | For data source plugins, if the plugin supports alerting. | +| `alerting` | boolean | No | For data source plugins, if the plugin supports alerting. Requires `backend` to be set to `true`. | | `annotations` | boolean | No | For data source plugins, if the plugin supports annotation queries. | -| `autoEnabled` | boolean | No | Set to true for app plugins that should be enabled by default in all orgs | +| `autoEnabled` | boolean | No | Set to true for app plugins that should be enabled and pinned to the navigation bar in all orgs. | | `backend` | boolean | No | If the plugin has a backend component. | -| `category` | string | No | Plugin category used on the Add data source page. Possible values are: `tsdb`, `logging`, `cloud`, `tracing`, `sql`, `enterprise`, `other`. | -| `enterpriseFeatures` | [object](#enterprisefeatures) | No | Grafana Enerprise specific features. | +| `category` | string | No | Plugin category used on the "Add data source" page. Possible values are: `tsdb`, `logging`, `cloud`, `tracing`, `profiling`, `sql`, `enterprise`, `iot`, `other`. | +| `enterpriseFeatures` | [object](#enterprisefeatures) | No | Grafana Enterprise specific features | | `executable` | string | No | The first part of the file name of the backend component executable. There can be multiple executables built for different operating system and architecture. Grafana will check for executables named `_<$GOOS>_<.exe for Windows>`, e.g. `plugin_linux_amd64`. Combination of $GOOS and $GOARCH can be found here: https://golang.org/doc/install/source#environment. | -| `hiddenQueries` | boolean | No | For data source plugins, include hidden queries in the data request. | | `includes` | [object](#includes)[] | No | Resources to include in plugin. | -| `logs` | boolean | No | For data source plugins, if the plugin supports logs. | -| `metrics` | boolean | No | For data source plugins, if the plugin supports metric queries. Used in Explore. | -| `preload` | boolean | No | Initialize plugin on startup. By default, the plugin initializes on first use. | +| `logs` | boolean | No | For data source plugins, if the plugin supports logs. It may be used to filter logs only features. | +| `metrics` | boolean | No | For data source plugins, if the plugin supports metric queries. Used to enable the plugin in the panel editor. | +| `preload` | boolean | No | Initialize plugin on startup. By default, the plugin initializes on first use. Useful for app plugins that should load without user interaction. | | `queryOptions` | [object](#queryoptions) | No | For data source plugins. There is a query options section in the plugin's query editor and these options can be turned on if needed. | | `routes` | [object](#routes)[] | No | For data source plugins. Proxy routes used for plugin authentication and adding headers to HTTP requests made by the plugin. For more information, refer to [Authentication for data source plugins](https://grafana.com/docs/grafana/latest/developers/plugins/authentication/). | | `skipDataQuery` | boolean | No | For panel plugins. Hides the query editor. | | `state` | string | No | Marks a plugin as a pre-release. Possible values are: `alpha`, `beta`. | -| `streaming` | boolean | No | For data source plugins, if the plugin supports streaming. | -| `tables` | boolean | No | This is an undocumented feature. | -| `tracing` | boolean | No | For data source plugins, if the plugin supports tracing. | +| `streaming` | boolean | No | For data source plugins, if the plugin supports streaming. Used in Explore to start live streaming. | +| `tracing` | boolean | No | For data source plugins, if the plugin supports tracing. Used for example to link logs (e.g. Loki logs) with tracing plugins. | ## dependencies @@ -69,7 +67,7 @@ Plugin dependency. Used to display information about plugin dependencies in the ## enterpriseFeatures -Grafana Enerprise specific features. +Grafana Enterprise specific features. ### Properties diff --git a/docs/sources/developers/plugins/plugin.schema.json b/docs/sources/developers/plugins/plugin.schema.json index 374d11028af..b90c6addc15 100644 --- a/docs/sources/developers/plugins/plugin.schema.json +++ b/docs/sources/developers/plugins/plugin.schema.json @@ -17,166 +17,6 @@ "description": "Plugin type.", "enum": ["app", "datasource", "panel", "renderer", "secretsmanager"] }, - "name": { - "type": "string", - "description": "Human-readable name of the plugin that is shown to the user in the UI." - }, - "dependencies": { - "type": "object", - "description": "Dependency information related to Grafana and other plugins.", - "required": ["grafanaDependency"], - "additionalProperties": false, - "properties": { - "grafanaVersion": { - "type": "string", - "description": "(Deprecated) Required Grafana version for this plugin, e.g. `6.x.x 7.x.x` to denote plugin requires Grafana v6.x.x or v7.x.x.", - "pattern": "^([0-9]+)(\\.[0-9x]+)?(\\.[0-9x])?$" - }, - "grafanaDependency": { - "type": "string", - "description": "Required Grafana version for this plugin. Validated using https://github.com/npm/node-semver.", - "pattern": "^(<=|>=|<|>|=|~|\\^)?([0-9]+)(\\.[0-9x\\*]+)(\\.[0-9x\\*]+)?(\\s(<=|>=|<|=>)?([0-9]+)(\\.[0-9x]+)(\\.[0-9x]+))?$" - }, - "plugins": { - "type": "array", - "description": "An array of required plugins on which this plugin depends.", - "additionalItems": false, - "items": { - "type": "object", - "description": "Plugin dependency. Used to display information about plugin dependencies in the Grafana UI.", - "required": ["id", "name", "type", "version"], - "properties": { - "id": { - "type": "string", - "pattern": "^[0-9a-z]+\\-([0-9a-z]+\\-)?(app|panel|datasource|secretsmanager)$" - }, - "type": { - "type": "string", - "enum": ["app", "datasource", "panel", "secretsmanager"] - }, - "name": { - "type": "string" - }, - "version": { - "type": "string" - } - } - } - } - } - }, - "$schema": { - "type": "string", - "description": "Schema definition for the plugin.json file. Used primarily for schema validation." - }, - "category": { - "type": "string", - "description": "Plugin category used on the Add data source page.", - "enum": ["tsdb", "logging", "cloud", "tracing", "sql", "enterprise", "other"] - }, - "annotations": { - "type": "boolean", - "description": "For data source plugins, if the plugin supports annotation queries." - }, - "alerting": { - "type": "boolean", - "description": "For data source plugins, if the plugin supports alerting." - }, - "backend": { - "type": "boolean", - "description": "If the plugin has a backend component." - }, - "executable": { - "type": "string", - "description": "The first part of the file name of the backend component executable. There can be multiple executables built for different operating system and architecture. Grafana will check for executables named `_<$GOOS>_<.exe for Windows>`, e.g. `plugin_linux_amd64`. Combination of $GOOS and $GOARCH can be found here: https://golang.org/doc/install/source#environment." - }, - "preload": { - "type": "boolean", - "description": "Initialize plugin on startup. By default, the plugin initializes on first use." - }, - "state": { - "type": "string", - "description": "Marks a plugin as a pre-release.", - "enum": ["alpha", "beta"] - }, - "includes": { - "type": "array", - "description": "Resources to include in plugin.", - "items": { - "type": "object", - "additionalItems": false, - "properties": { - "uid": { - "type": "string", - "description": "Unique identifier of the included resource" - }, - "type": { - "type": "string", - "enum": ["dashboard", "page", "panel", "datasource", "secretsmanager"] - }, - "name": { - "type": "string" - }, - "component": { - "type": "string", - "description": "(Legacy) The Angular component to use for a page." - }, - "role": { - "type": "string", - "description": "The minimum role a user must have to see this page in the navigation menu.", - "enum": ["Admin", "Editor", "Viewer"] - }, - "path": { - "type": "string", - "description": "Used for app plugins." - }, - "addToNav": { - "type": "boolean", - "description": "Add the include to the navigation menu." - }, - "defaultNav": { - "type": "boolean", - "description": "Page or dashboard when user clicks the icon in the side menu." - }, - "icon": { - "type": "string", - "description": "Icon to use in the side menu. For information on available icon, refer to [Icons Overview](https://developers.grafana.com/ui/latest/index.html?path=/story/docs-overview-icon--icons-overview)." - } - } - } - }, - "logs": { - "type": "boolean", - "description": "For data source plugins, if the plugin supports logs." - }, - "skipDataQuery": { - "type": "boolean", - "description": "For panel plugins. Hides the query editor." - }, - "metrics": { - "type": "boolean", - "description": "For data source plugins, if the plugin supports metric queries. Used in Explore." - }, - "streaming": { - "type": "boolean", - "description": "For data source plugins, if the plugin supports streaming." - }, - "tables": { - "type": "boolean", - "description": "This is an undocumented feature." - }, - "tracing": { - "type": "boolean", - "description": "For data source plugins, if the plugin supports tracing." - }, - "hiddenQueries": { - "type": "boolean", - "description": "For data source plugins, include hidden queries in the data request." - }, - "autoEnabled": { - "type": "boolean", - "description": "Set to true for app plugins that should be enabled by default in all orgs" - }, "info": { "type": "object", "description": "Metadata for the plugin. Some fields are used on the plugins page in Grafana and others on grafana.com if the plugin is published.", @@ -308,6 +148,166 @@ } } }, + "name": { + "type": "string", + "description": "Human-readable name of the plugin that is shown to the user in the UI." + }, + "dependencies": { + "type": "object", + "description": "Dependency information related to Grafana and other plugins.", + "required": ["grafanaDependency"], + "additionalProperties": false, + "properties": { + "grafanaVersion": { + "type": "string", + "description": "(Deprecated) Required Grafana version for this plugin, e.g. `6.x.x 7.x.x` to denote plugin requires Grafana v6.x.x or v7.x.x.", + "pattern": "^([0-9]+)(\\.[0-9x]+)?(\\.[0-9x])?$" + }, + "grafanaDependency": { + "type": "string", + "description": "Required Grafana version for this plugin. Validated using https://github.com/npm/node-semver.", + "pattern": "^(<=|>=|<|>|=|~|\\^)?([0-9]+)(\\.[0-9x\\*]+)(\\.[0-9x\\*]+)?(\\s(<=|>=|<|=>)?([0-9]+)(\\.[0-9x]+)(\\.[0-9x]+))?$" + }, + "plugins": { + "type": "array", + "description": "An array of required plugins on which this plugin depends.", + "additionalItems": false, + "items": { + "type": "object", + "description": "Plugin dependency. Used to display information about plugin dependencies in the Grafana UI.", + "required": ["id", "name", "type", "version"], + "properties": { + "id": { + "type": "string", + "pattern": "^[0-9a-z]+\\-([0-9a-z]+\\-)?(app|panel|datasource|secretsmanager)$" + }, + "type": { + "type": "string", + "enum": ["app", "datasource", "panel", "secretsmanager"] + }, + "name": { + "type": "string" + }, + "version": { + "type": "string" + } + } + } + } + } + }, + "$schema": { + "type": "string", + "description": "Schema definition for the plugin.json file. Used primarily for schema validation." + }, + "alerting": { + "type": "boolean", + "description": "For data source plugins, if the plugin supports alerting. Requires `backend` to be set to `true`." + }, + "annotations": { + "type": "boolean", + "description": "For data source plugins, if the plugin supports annotation queries." + }, + "autoEnabled": { + "type": "boolean", + "description": "Set to true for app plugins that should be enabled and pinned to the navigation bar in all orgs." + }, + "backend": { + "type": "boolean", + "description": "If the plugin has a backend component." + }, + "builtIn": { + "type": "boolean", + "description": "[internal only] Indicates whether the plugin is developed and shipped as part of Grafana. Also known as a 'core plugin'." + }, + "category": { + "type": "string", + "description": "Plugin category used on the Add data source page.", + "enum": ["tsdb", "logging", "cloud", "tracing", "profiling", "sql", "enterprise", "iot", "other"] + }, + "enterpriseFeatures": { + "type": "object", + "description": "Grafana Enterprise specific features", + "additionalProperties": true, + "properties": { + "healthDiagnosticsErrors": { + "type": "boolean", + "description": "Enable/Disable health diagnostics errors. Requires Grafana >=7.5.5.", + "default": false + } + } + }, + "executable": { + "type": "string", + "description": "The first part of the file name of the backend component executable. There can be multiple executables built for different operating system and architecture. Grafana will check for executables named `_<$GOOS>_<.exe for Windows>`, e.g. `plugin_linux_amd64`. Combination of $GOOS and $GOARCH can be found here: https://golang.org/doc/install/source#environment." + }, + "hideFromList": { + "type": "boolean", + "description": "[internal only] Excludes the plugin from listings in Grafana's UI. Only allowed for `builtIn` plugins." + }, + "includes": { + "type": "array", + "description": "Resources to include in plugin.", + "items": { + "type": "object", + "additionalItems": false, + "properties": { + "uid": { + "type": "string", + "description": "Unique identifier of the included resource" + }, + "type": { + "type": "string", + "enum": ["dashboard", "page", "panel", "datasource", "secretsmanager"] + }, + "name": { + "type": "string" + }, + "component": { + "type": "string", + "description": "(Legacy) The Angular component to use for a page." + }, + "role": { + "type": "string", + "description": "The minimum role a user must have to see this page in the navigation menu.", + "enum": ["Admin", "Editor", "Viewer"] + }, + "path": { + "type": "string", + "description": "Used for app plugins." + }, + "addToNav": { + "type": "boolean", + "description": "Add the include to the navigation menu." + }, + "defaultNav": { + "type": "boolean", + "description": "Page or dashboard when user clicks the icon in the side menu." + }, + "icon": { + "type": "string", + "description": "Icon to use in the side menu. For information on available icon, refer to [Icons Overview](https://developers.grafana.com/ui/latest/index.html?path=/story/docs-overview-icon--icons-overview)." + } + } + } + }, + "logs": { + "type": "boolean", + "description": "For data source plugins, if the plugin supports logs. It may be used to filter logs only features." + }, + "metrics": { + "type": "boolean", + "description": "For data source plugins, if the plugin supports metric queries. Used to enable the plugin in the panel editor." + }, + "pascalName": { + "type": "string", + "description": "[internal only] The PascalCase name for the plugin. Used for creating machine-friendly identifiers, typically in code generation. If not provided, defaults to name, but title-cased and sanitized (only alphabetical characters allowed).", + "pattern": "^([A-Z][a-zA-Z]{1,62})$" + }, + "preload": { + "type": "boolean", + "description": "Initialize plugin on startup. By default, the plugin initializes on first use. Useful for app plugins that should load without user interaction." + }, "queryOptions": { "type": "object", "description": "For data source plugins. There is a query options section in the plugin's query editor and these options can be turned on if needed.", @@ -461,17 +461,22 @@ } } }, - "enterpriseFeatures": { - "type": "object", - "description": "Grafana Enterprise specific features.", - "additionalProperties": true, - "properties": { - "healthDiagnosticsErrors": { - "type": "boolean", - "description": "Enable/Disable health diagnostics errors. Requires Grafana >=7.5.5.", - "default": false - } - } + "skipDataQuery": { + "type": "boolean", + "description": "For panel plugins. Hides the query editor." + }, + "state": { + "type": "string", + "description": "Marks a plugin as a pre-release.", + "enum": ["alpha", "beta"] + }, + "streaming": { + "type": "boolean", + "description": "For data source plugins, if the plugin supports streaming. Used in Explore to start live streaming." + }, + "tracing": { + "type": "boolean", + "description": "For data source plugins, if the plugin supports tracing. Used for example to link logs (e.g. Loki logs) with tracing plugins." } } } diff --git a/docs/sources/introduction/grafana-cloud.md b/docs/sources/introduction/grafana-cloud.md index ce4b6cee99d..62dae9e5baa 100644 --- a/docs/sources/introduction/grafana-cloud.md +++ b/docs/sources/introduction/grafana-cloud.md @@ -1,4 +1,7 @@ --- +labels: + products: + - cloud title: Grafana Cloud weight: 300 --- diff --git a/docs/sources/introduction/grafana-enterprise.md b/docs/sources/introduction/grafana-enterprise.md index de578294c91..32f91ef4478 100644 --- a/docs/sources/introduction/grafana-enterprise.md +++ b/docs/sources/introduction/grafana-enterprise.md @@ -1,6 +1,9 @@ --- aliases: - ../enterprise/ +labels: + products: + - enterprise description: Grafana Enterprise overview title: Grafana Enterprise weight: 200 diff --git a/docs/sources/panels-visualizations/query-transform-data/transform-data/index.md b/docs/sources/panels-visualizations/query-transform-data/transform-data/index.md index 8fa2a5dd58e..0099b631dfb 100644 --- a/docs/sources/panels-visualizations/query-transform-data/transform-data/index.md +++ b/docs/sources/panels-visualizations/query-transform-data/transform-data/index.md @@ -732,3 +732,9 @@ Here is the result after adding a Limit transformation with a value of '3': | 2020-07-07 11:34:20 | Temperature | 25 | | 2020-07-07 11:34:20 | Humidity | 22 | | 2020-07-07 10:32:20 | Humidity | 29 | + +### Time series to table transform + +> **Note:** This transformation is available in Grafana 9.5+ as an opt-in beta feature. Modify Grafana [configuration file]({{< relref "../../../setup-grafana/configure-grafana/#configuration-file-location" >}}) to enable the `timeSeriesTable` [feature toggle]({{< relref "../../../setup-grafana/configure-grafana/#feature_toggles" >}}) to use it. + +Use this transformation to convert time series result into a table, converting time series data frame into a "Trend" field. "Trend" field can then be rendered using [sparkline cell type]({{< relref "../../visualizations/table/#sparkline" >}}), producing an inline sparkline for each table row. If there are multiple time series queries, each will result in a separate table data frame. These can be joined using join or merge transforms to produce a single table with multiple sparklines per row. diff --git a/docs/sources/panels-visualizations/visualizations/table/index.md b/docs/sources/panels-visualizations/visualizations/table/index.md index 8e3e6b13d6c..c4b22966547 100644 --- a/docs/sources/panels-visualizations/visualizations/table/index.md +++ b/docs/sources/panels-visualizations/visualizations/table/index.md @@ -108,6 +108,22 @@ The gauge is split up in small cells that are lit or unlit. {{< figure src="/static/img/docs/tables/lcd-gauge.png" max-width="500px" caption="LCD gauge" class="docs-image--no-shadow" >}} +#### Label Options + +Additionally, labels displayed alongside of the gauges can be set to be colored by value, match the theme text color, or be hidden. + +**Value Color** + +{{< figure src="/static/img/docs/tables/value-color-mode.png" max-width="500px" caption="Color Label by Value" class="docs-image--no-shadow" >}} + +**Text Color** + +{{< figure src="/static/img/docs/tables/text-color-mode.png" max-width="500px" caption="Color Label by theme color" class="docs-image--no-shadow" >}} + +**Hidden** + +{{< figure src="/static/img/docs/tables/hidden-mode.png" max-width="500px" caption="Hide Label" class="docs-image--no-shadow" >}} + ### JSON view Shows value formatted as code. If a value is an object the JSON view allowing browsing the JSON object will appear on hover. @@ -122,6 +138,14 @@ If you have a field value that is an image URL or a base64 encoded image you can {{< figure src="/static/img/docs/v73/table_hover.gif" max-width="900px" caption="Table hover" >}} +### Sparkline + +> **Note:** This cell type is available in Grafana 9.5+ as an opt-in beta feature. Modify Grafana [configuration file]({{< relref "../../../setup-grafana/configure-grafana/#configuration-file-location" >}}) to enable the `timeSeriesTable` [feature toggle]({{< relref "../../../setup-grafana/configure-grafana/#feature_toggles" >}}) to use it. + +Shows value rendered as a sparkline. Requires [time series to table]({{< relref "../../query-transform-data/transform-data/#time-series-to-table-transform" >}}) data transform. + +{{< figure src="/static/img/docs/tables/sparkline.png" max-width="500px" caption="Sparkline" class="docs-image--no-shadow" >}} + ## Cell value inspect Enables value inspection from table cell. The raw value is presented in a modal window. diff --git a/docs/sources/setup-grafana/configure-grafana/feature-toggles/index.md b/docs/sources/setup-grafana/configure-grafana/feature-toggles/index.md index 75a0e5119f9..deb9903ffa8 100644 --- a/docs/sources/setup-grafana/configure-grafana/feature-toggles/index.md +++ b/docs/sources/setup-grafana/configure-grafana/feature-toggles/index.md @@ -94,6 +94,7 @@ Alpha features might be changed or removed without prior notice. | `drawerDataSourcePicker` | Changes the user experience for data source selection to a drawer. | | `traceqlSearch` | Enables the 'TraceQL Search' tab for the Tempo datasource which provides a UI to generate TraceQL queries | | `prometheusMetricEncyclopedia` | Replaces the Prometheus query builder metric select option with a paginated and filterable component | +| `timeSeriesTable` | Enable time series table transformer & sparkline cell type | ## Development feature toggles diff --git a/docs/sources/shared/tutorials/create-plugin.md b/docs/sources/shared/tutorials/create-plugin.md index 937f2ee86d4..671154e09ba 100755 --- a/docs/sources/shared/tutorials/create-plugin.md +++ b/docs/sources/shared/tutorials/create-plugin.md @@ -6,7 +6,7 @@ Tooling for modern web development can be tricky to wrap your head around. While Grafana [create-plugin tool](https://www.npmjs.com/package/@grafana/create-plugin) is a CLI application that simplifies Grafana plugin development, so that you can focus on code. The tool scaffolds a starter plugin and all the required configuration for you. -1. In the plugin directory, create a plugin from template using create-plugin. Select `datasource` when asked the kind of plugin: +1. In the plugin directory, create a plugin from template using create-plugin. When prompted for the kind of plugin, select `datasource`: ``` npx @grafana/create-plugin@latest diff --git a/docs/sources/tutorials/build-a-streaming-data-source-plugin/index.md b/docs/sources/tutorials/build-a-streaming-data-source-plugin/index.md index bb7eece2d80..7260287ca25 100644 --- a/docs/sources/tutorials/build-a-streaming-data-source-plugin/index.md +++ b/docs/sources/tutorials/build-a-streaming-data-source-plugin/index.md @@ -42,7 +42,7 @@ In this tutorial, you'll: To build a backend for your data source plugin, Grafana requires a binary that it can execute when it loads the plugin during start-up. In this guide, we will build a binary using the [Grafana plugin SDK for Go](/docs/grafana/latest/developers/plugins/backend/grafana-plugin-sdk-for-go/). -The easiest way to get started is to use the Grafana [create-plugin tool](https://www.npmjs.com/package/@grafana/create-plugin). Navigate to the plugin folder that you configured in step 1 and type: +The easiest way to get started is to use the Grafana [create-plugin tool](https://www.npmjs.com/package/@grafana/create-plugin). Navigate to the plugin folder that you configured in step 1 and enter: ``` npx @grafana/create-plugin@latest diff --git a/docs/sources/whatsnew/whats-new-in-v9-4.md b/docs/sources/whatsnew/whats-new-in-v9-4.md index a7a980be37f..d47d7a20c23 100644 --- a/docs/sources/whatsnew/whats-new-in-v9-4.md +++ b/docs/sources/whatsnew/whats-new-in-v9-4.md @@ -254,12 +254,6 @@ We've added Discord as a contact point receiver for Grafana Cloud alert rules. We've made the following changes to alert administration. -#### Better guidance to configure your Alertmanagers - -Get additional help while configuring your Alertmanager. If you enter an invalid Alertmanager configuration, an error message displays, and you can choose from a previous working configuration to restart it. - -{{< figure src="/media/docs/alerting/alertmanager-config.png" max-width="750px" caption="Better guidance to configure your Alertmanager" >}} - #### Alerting landing page Introduces a new landing page that helps you get started quickly with Alerting. It also provides you with at a glance information on how Alerting works and a video to introduce you to key concepts. diff --git a/kinds/dashboard/dashboard_kind.cue b/kinds/dashboard/dashboard_kind.cue index f399d9a0d38..72d44fa1798 100644 --- a/kinds/dashboard/dashboard_kind.cue +++ b/kinds/dashboard/dashboard_kind.cue @@ -25,8 +25,8 @@ lineage: seqs: [ // Description of dashboard. description?: string // This property should only be used in dashboards defined by plugins. It is a quick check - // to see if the version has changed since the last time. Unclear why using the version property - // is insufficient. + // to see if the version has changed since the last time. Unclear why using the version property + // is insufficient. revision?: int64 @grafanamaturity(NeedsExpertReview) // For dashboards imported from the https://grafana.com/grafana/dashboards/ portal gnetId?: string @grafanamaturity(NeedsExpertReview) @@ -220,6 +220,8 @@ lineage: seqs: [ value?: number @grafanamaturity(NeedsExpertReview) // TODO docs color: string @grafanamaturity(NeedsExpertReview) + // Threshold index, an old property that is not needed an should only appear in older dashboards + index?: int32 @grafanamaturity(NeedsExpertReview) // TODO docs // TODO are the values here enumerable into a disjunction? // Some seem to be listed in typescript comment diff --git a/package.json b/package.json index 448494bac54..a19ce9d26a4 100644 --- a/package.json +++ b/package.json @@ -199,7 +199,7 @@ "eslint-webpack-plugin": "4.0.0", "expose-loader": "4.0.0", "fork-ts-checker-webpack-plugin": "8.0.0", - "glob": "9.1.2", + "glob": "9.2.1", "html-loader": "4.2.0", "html-webpack-plugin": "5.5.0", "http-server": "14.1.1", @@ -229,7 +229,7 @@ "react-simple-compat": "1.2.3", "react-test-renderer": "17.0.2", "redux-mock-store": "1.5.4", - "rimraf": "4.2.0", + "rimraf": "4.4.0", "rudder-sdk-js": "2.25.0", "sass": "1.58.3", "sass-loader": "13.2.0", @@ -245,7 +245,7 @@ "ts-node": "10.9.1", "typescript": "4.8.4", "wait-on": "7.0.1", - "webpack": "5.75.0", + "webpack": "5.76.0", "webpack-bundle-analyzer": "4.8.0", "webpack-cli": "5.0.1", "webpack-dev-server": "4.11.1", @@ -267,11 +267,11 @@ "@grafana/lezer-logql": "0.1.2", "@grafana/monaco-logql": "^0.0.7", "@grafana/runtime": "workspace:*", - "@grafana/scenes": "^0.0.16", + "@grafana/scenes": "^0.0.18", "@grafana/schema": "workspace:*", "@grafana/ui": "workspace:*", "@kusto/monaco-kusto": "5.3.6", - "@leeoniya/ufuzzy": "1.0.2", + "@leeoniya/ufuzzy": "1.0.6", "@lezer/common": "1.0.2", "@lezer/highlight": "1.1.3", "@lezer/lr": "1.3.3", @@ -429,16 +429,16 @@ "@rushstack/ts-command-line": "4.13.2", "@storybook/builder-webpack4/css-loader": "6.7.3", "@storybook/builder-webpack4/html-webpack-plugin": "5.5.0", - "@storybook/builder-webpack4/webpack": "5.75.0", - "@storybook/core-common/webpack": "5.75.0", - "@storybook/core-server/webpack": "5.75.0", + "@storybook/builder-webpack4/webpack": "5.76.0", + "@storybook/core-common/webpack": "5.76.0", + "@storybook/core-server/webpack": "5.76.0", "@storybook/manager-webpack4/css-loader": "6.7.3", "@storybook/manager-webpack4/html-webpack-plugin": "5.5.0", - "@storybook/manager-webpack4/webpack": "5.75.0", - "@storybook/builder-webpack5/webpack": "5.75.0", - "@storybook/manager-webpack5/webpack": "5.75.0", + "@storybook/manager-webpack4/webpack": "5.76.0", + "@storybook/builder-webpack5/webpack": "5.76.0", + "@storybook/manager-webpack5/webpack": "5.76.0", "ngtemplate-loader/loader-utils": "^2.0.0", - "trim@0.0.1": "0.0.3", + "trim": "0.0.3", "slate-dev-environment@^0.2.2": "patch:slate-dev-environment@npm:0.2.5#.yarn/patches/slate-dev-environment-npm-0.2.5-9aeb7da7b5.patch" }, "workspaces": { diff --git a/packages/grafana-data/package.json b/packages/grafana-data/package.json index 9d3d21e7ce8..ff16037a19c 100644 --- a/packages/grafana-data/package.json +++ b/packages/grafana-data/package.json @@ -83,7 +83,7 @@ "react": "17.0.2", "react-dom": "17.0.2", "react-test-renderer": "17.0.2", - "rimraf": "4.2.0", + "rimraf": "4.4.0", "rollup": "2.79.1", "rollup-plugin-dts": "^5.0.0", "rollup-plugin-esbuild": "5.0.0", diff --git a/packages/grafana-data/src/dataframe/index.ts b/packages/grafana-data/src/dataframe/index.ts index 3267885b2c0..3213eb70dab 100644 --- a/packages/grafana-data/src/dataframe/index.ts +++ b/packages/grafana-data/src/dataframe/index.ts @@ -7,4 +7,4 @@ export * from './dimensions'; export * from './ArrayDataFrame'; export * from './DataFrameJSON'; export * from './frameComparisons'; -export { anySeriesWithTimeField } from './utils'; +export { anySeriesWithTimeField, isTimeSeriesFrame, isTimeSeriesFrames } from './utils'; diff --git a/packages/grafana-data/src/dataframe/utils.ts b/packages/grafana-data/src/dataframe/utils.ts index 0869d2ec135..774c6cd4b6d 100644 --- a/packages/grafana-data/src/dataframe/utils.ts +++ b/packages/grafana-data/src/dataframe/utils.ts @@ -2,15 +2,15 @@ import { DataFrame, FieldType } from '../types/dataFrame'; import { getTimeField } from './processDataFrame'; -export function isTimeSerie(frame: DataFrame) { +export function isTimeSeriesFrame(frame: DataFrame) { if (frame.fields.length > 2) { return false; } return Boolean(frame.fields.find((field) => field.type === FieldType.time)); } -export function isTimeSeries(data: DataFrame[]) { - return !data.find((frame) => !isTimeSerie(frame)); +export function isTimeSeriesFrames(data: DataFrame[]) { + return !data.find((frame) => !isTimeSeriesFrame(frame)); } /** diff --git a/packages/grafana-data/src/field/index.ts b/packages/grafana-data/src/field/index.ts index 8ae807d42bc..9462ca10687 100644 --- a/packages/grafana-data/src/field/index.ts +++ b/packages/grafana-data/src/field/index.ts @@ -15,4 +15,4 @@ export { sortThresholds, getActiveThreshold } from './thresholds'; export { applyFieldOverrides, validateFieldConfig, applyRawFieldOverrides, useFieldOverrides } from './fieldOverrides'; export { getFieldDisplayValuesProxy } from './getFieldDisplayValuesProxy'; export { getFieldDisplayName, getFrameDisplayName } from './fieldState'; -export { getScaleCalculator, getFieldConfigWithMinMax } from './scale'; +export { getScaleCalculator, getFieldConfigWithMinMax, getMinMaxAndDelta } from './scale'; diff --git a/packages/grafana-data/src/transformations/transformers/ids.ts b/packages/grafana-data/src/transformations/transformers/ids.ts index 968958d9668..bce099ea1ca 100644 --- a/packages/grafana-data/src/transformations/transformers/ids.ts +++ b/packages/grafana-data/src/transformations/transformers/ids.ts @@ -36,4 +36,5 @@ export enum DataTransformerID { groupingToMatrix = 'groupingToMatrix', limit = 'limit', partitionByValues = 'partitionByValues', + timeSeriesTable = 'timeSeriesTable', } diff --git a/packages/grafana-data/src/transformations/transformers/seriesToRows.ts b/packages/grafana-data/src/transformations/transformers/seriesToRows.ts index 8121784b476..3e32de48faa 100644 --- a/packages/grafana-data/src/transformations/transformers/seriesToRows.ts +++ b/packages/grafana-data/src/transformations/transformers/seriesToRows.ts @@ -2,7 +2,7 @@ import { omit } from 'lodash'; import { map } from 'rxjs/operators'; import { MutableDataFrame, sortDataFrame } from '../../dataframe'; -import { isTimeSeries } from '../../dataframe/utils'; +import { isTimeSeriesFrames } from '../../dataframe/utils'; import { getFrameDisplayName } from '../../field/fieldState'; import { Field, @@ -30,7 +30,7 @@ export const seriesToRowsTransformer: DataTransformerInfo