From 3c2e71bf804ae71abef87e94bf37161f95764281 Mon Sep 17 00:00:00 2001 From: Nathan Marrs Date: Wed, 3 May 2023 17:10:10 -0600 Subject: [PATCH] Canvas: Add gdev dashboard for connections (#67792) --- .../canvas-connection-examples.json | 1441 +++++++++++++++++ devenv/jsonnet/dev-dashboards.libsonnet | 7 + 2 files changed, 1448 insertions(+) create mode 100644 devenv/dev-dashboards/panel-canvas/canvas-connection-examples.json diff --git a/devenv/dev-dashboards/panel-canvas/canvas-connection-examples.json b/devenv/dev-dashboards/panel-canvas/canvas-connection-examples.json new file mode 100644 index 00000000000..19fbe0b3325 --- /dev/null +++ b/devenv/dev-dashboards/panel-canvas/canvas-connection-examples.json @@ -0,0 +1,1441 @@ +{ + "annotations": { + "list": [ + { + "builtIn": 1, + "datasource": { + "type": "grafana", + "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, + "fiscalYearStartMonth": 0, + "graphTooltip": 0, + "links": [], + "liveNow": false, + "panels": [ + { + "datasource": { + "type": "testdata", + "uid": "PD8C576611E62080A" + }, + "fieldConfig": { + "defaults": { + "color": { + "mode": "thresholds" + }, + "mappings": [], + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "green", + "value": null + }, + { + "color": "#6ED0E0", + "value": 30 + }, + { + "color": "#EAB839", + "value": 50 + }, + { + "color": "#EF843C", + "value": 80 + } + ] + }, + "unit": "none" + }, + "overrides": [] + }, + "gridPos": { + "h": 11, + "w": 15, + "x": 5, + "y": 0 + }, + "id": 4, + "options": { + "inlineEditing": true, + "root": { + "background": { + "color": { + "fixed": "transparent" + } + }, + "border": { + "color": { + "fixed": "dark-green" + } + }, + "elements": [ + { + "background": { + "color": { + "fixed": "#D9D9D9" + } + }, + "border": { + "color": { + "fixed": "dark-green" + } + }, + "config": { + "align": "center", + "color": { + "fixed": "#000000" + }, + "text": { + "fixed": "gateway" + }, + "valign": "middle" + }, + "connections": [ + { + "color": { + "field": "gateway", + "fixed": "rgb(204, 204, 220)" + }, + "path": "straight", + "size": { + "fixed": 2, + "max": 10, + "min": 1 + }, + "source": { + "x": 1, + "y": 0 + }, + "target": { + "x": -1.02020202020202, + "y": 0.041666666666666664 + }, + "targetName": "Element 2" + } + ], + "constraint": { + "horizontal": "left", + "vertical": "top" + }, + "name": "Element 1", + "placement": { + "height": 48, + "left": 117, + "top": 168, + "width": 99 + }, + "type": "rectangle" + }, + { + "background": { + "color": { + "fixed": "#D9D9D9" + } + }, + "border": { + "color": { + "fixed": "dark-green" + } + }, + "config": { + "align": "center", + "color": { + "fixed": "#000000" + }, + "text": { + "fixed": "productpage" + }, + "valign": "middle" + }, + "connections": [ + { + "color": { + "field": "product-details", + "fixed": "white" + }, + "path": "straight", + "size": { + "fixed": 2, + "max": 10, + "min": 1 + }, + "source": { + "x": 1, + "y": 1 + }, + "target": { + "x": -0.9797979797979798, + "y": 0 + }, + "targetName": "Element 3" + }, + { + "color": { + "field": "product-reviews", + "fixed": "white" + }, + "path": "straight", + "size": { + "fixed": 2, + "max": 10, + "min": 1 + }, + "source": { + "x": 1, + "y": -1 + }, + "target": { + "x": -1, + "y": 0.041666666666666664 + }, + "targetName": "Element 4" + } + ], + "constraint": { + "horizontal": "left", + "vertical": "top" + }, + "name": "Element 2", + "placement": { + "height": 48, + "left": 327, + "top": 168, + "width": 99 + }, + "type": "rectangle" + }, + { + "background": { + "color": { + "fixed": "#D9D9D9" + } + }, + "border": { + "color": { + "fixed": "dark-green" + } + }, + "config": { + "align": "center", + "color": { + "fixed": "#000000" + }, + "text": { + "fixed": "details" + }, + "valign": "middle" + }, + "connections": [ + { + "color": { + "field": "details-checkout", + "fixed": "white" + }, + "path": "straight", + "size": { + "fixed": 2, + "max": 10, + "min": 1 + }, + "source": { + "x": 1, + "y": 0 + }, + "target": { + "x": -0.9595959595959596, + "y": -0.041666666666666664 + }, + "targetName": "Element 11" + } + ], + "constraint": { + "horizontal": "left", + "vertical": "top" + }, + "name": "Element 3", + "placement": { + "height": 48, + "left": 548, + "top": 69, + "width": 99 + }, + "type": "rectangle" + }, + { + "background": { + "color": { + "fixed": "#D9D9D9" + } + }, + "border": { + "color": { + "fixed": "dark-green" + } + }, + "config": { + "align": "center", + "color": { + "fixed": "#000000" + }, + "text": { + "fixed": "reviews" + }, + "valign": "middle" + }, + "connections": [ + { + "color": { + "field": "reviews-ratings", + "fixed": "white" + }, + "path": "straight", + "size": { + "fixed": 2, + "max": 10, + "min": 1 + }, + "source": { + "x": 1, + "y": 0 + }, + "target": { + "x": -0.9797979797979798, + "y": 0.041666666666666664 + }, + "targetName": "Element 5" + } + ], + "constraint": { + "horizontal": "left", + "vertical": "top" + }, + "name": "Element 4", + "placement": { + "height": 48, + "left": 549, + "top": 274, + "width": 99 + }, + "type": "rectangle" + }, + { + "background": { + "color": { + "fixed": "#D9D9D9" + } + }, + "border": { + "color": { + "fixed": "dark-green" + } + }, + "config": { + "align": "center", + "color": { + "fixed": "#000000" + }, + "text": { + "fixed": "ratings" + }, + "valign": "middle" + }, + "constraint": { + "horizontal": "left", + "vertical": "top" + }, + "name": "Element 5", + "placement": { + "height": 48, + "left": 797, + "top": 275, + "width": 99 + }, + "type": "rectangle" + }, + { + "background": { + "color": { + "field": "gateway", + "fixed": "#D9D9D9" + } + }, + "border": { + "color": { + "fixed": "dark-green" + } + }, + "config": { + "align": "center", + "color": { + "fixed": "#000000" + }, + "size": 20, + "text": { + "field": "gateway", + "fixed": "", + "mode": "field" + }, + "valign": "middle" + }, + "constraint": { + "horizontal": "left", + "vertical": "top" + }, + "name": "Element 6", + "placement": { + "height": 36, + "left": 235, + "top": 148, + "width": 64 + }, + "type": "metric-value" + }, + { + "background": { + "color": { + "field": "product-details", + "fixed": "#D9D9D9" + } + }, + "border": { + "color": { + "fixed": "dark-green" + } + }, + "config": { + "align": "center", + "color": { + "fixed": "#000000" + }, + "size": 20, + "text": { + "field": "product-details", + "fixed": "", + "mode": "field" + }, + "valign": "middle" + }, + "constraint": { + "horizontal": "left", + "vertical": "top" + }, + "name": "Element 7", + "placement": { + "height": 36, + "left": 415, + "top": 89, + "width": 64 + }, + "type": "metric-value" + }, + { + "background": { + "color": { + "field": "product-reviews", + "fixed": "#D9D9D9" + } + }, + "border": { + "color": { + "fixed": "dark-green" + } + }, + "config": { + "align": "center", + "color": { + "fixed": "#000000" + }, + "size": 20, + "text": { + "field": "product-reviews", + "fixed": "", + "mode": "field" + }, + "valign": "middle" + }, + "constraint": { + "horizontal": "left", + "vertical": "top" + }, + "name": "Element 8", + "placement": { + "height": 36, + "left": 411, + "top": 258, + "width": 64 + }, + "type": "metric-value" + }, + { + "background": { + "color": { + "field": "reviews-ratings", + "fixed": "#D9D9D9" + } + }, + "border": { + "color": { + "fixed": "dark-green" + } + }, + "config": { + "align": "center", + "color": { + "fixed": "#000000" + }, + "size": 20, + "text": { + "field": "reviews-ratings", + "fixed": "", + "mode": "field" + }, + "valign": "middle" + }, + "constraint": { + "horizontal": "left", + "vertical": "top" + }, + "name": "Element 9", + "placement": { + "height": 36, + "left": 686, + "top": 250, + "width": 64 + }, + "type": "metric-value" + }, + { + "background": { + "color": { + "fixed": "transparent" + } + }, + "border": { + "color": { + "fixed": "dark-green" + } + }, + "config": { + "align": "center", + "color": { + "fixed": "rgb(204, 204, 220)" + }, + "size": 16, + "text": { + "fixed": "# of requests" + }, + "valign": "middle" + }, + "constraint": { + "horizontal": "left", + "vertical": "top" + }, + "name": "Element 10", + "placement": { + "height": 50, + "left": 13, + "top": 309, + "width": 100 + }, + "type": "text" + }, + { + "background": { + "color": { + "fixed": "#D9D9D9" + } + }, + "border": { + "color": { + "fixed": "dark-green" + } + }, + "config": { + "align": "center", + "color": { + "fixed": "#000000" + }, + "text": { + "fixed": "checkout" + }, + "valign": "middle" + }, + "constraint": { + "horizontal": "left", + "vertical": "top" + }, + "name": "Element 11", + "placement": { + "height": 48, + "left": 797, + "top": 68, + "width": 99 + }, + "type": "rectangle" + }, + { + "background": { + "color": { + "field": "details-checkout", + "fixed": "#D9D9D9" + } + }, + "border": { + "color": { + "fixed": "dark-green" + } + }, + "config": { + "align": "center", + "color": { + "fixed": "#000000" + }, + "size": 20, + "text": { + "field": "details-checkout", + "fixed": "0", + "mode": "field" + }, + "valign": "middle" + }, + "constraint": { + "horizontal": "left", + "vertical": "top" + }, + "name": "Element 12", + "placement": { + "height": 36, + "left": 684, + "top": 47, + "width": 63.99609375 + }, + "type": "metric-value" + } + ], + "name": "Element 1672955773575", + "type": "frame" + }, + "showAdvancedTypes": false + }, + "pluginVersion": "10.1.0-pre", + "targets": [ + { + "csvContent": "gateway, product-details, product-reviews, reviews-ratings, details-checkout\n100, 56, 44, 22, 28", + "datasource": { + "type": "testdata", + "uid": "PD8C576611E62080A" + }, + "refId": "A", + "scenarioId": "csv_content" + } + ], + "title": "Service Graph", + "type": "canvas" + }, + { + "datasource": { + "type": "testdata", + "uid": "PD8C576611E62080A" + }, + "fieldConfig": { + "defaults": { + "color": { + "mode": "thresholds" + }, + "links": [ + { + "targetBlank": true, + "title": "Show details", + "url": "https://ops.grafana-ops.net/d/fU-WBSqWz/synthetic-monitoring-summary?orgId=1" + } + ], + "mappings": [], + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "green", + "value": null + }, + { + "color": "blue", + "value": 30 + }, + { + "color": "#EAB839", + "value": 50 + }, + { + "color": "red", + "value": 80 + } + ] + }, + "unit": "percent" + }, + "overrides": [] + }, + "gridPos": { + "h": 15, + "w": 15, + "x": 5, + "y": 11 + }, + "id": 2, + "options": { + "inlineEditing": false, + "root": { + "background": { + "color": { + "fixed": "transparent" + } + }, + "border": { + "color": { + "fixed": "dark-green" + } + }, + "constraint": { + "horizontal": "left", + "vertical": "top" + }, + "elements": [ + { + "background": { + "color": { + "fixed": "transparent" + } + }, + "border": { + "color": { + "fixed": "dark-green" + } + }, + "config": { + "blinkRate": { + "fixed": 2 + }, + "bulbColor": { + "field": "server_database" + }, + "statusColor": { + "field": "server_region" + }, + "type": "Single" + }, + "connections": [ + { + "color": { + "field": "server_database2", + "fixed": "white" + }, + "path": "straight", + "size": { + "fixed": 2, + "max": 10, + "min": 1 + }, + "source": { + "x": -1, + "y": -1 + }, + "target": { + "x": 0.030303030303030304, + "y": 0 + }, + "targetName": "Element 11" + }, + { + "color": { + "field": "server_database", + "fixed": "white" + }, + "path": "straight", + "size": { + "fixed": 2, + "max": 10, + "min": 1 + }, + "source": { + "x": -1, + "y": -1 + }, + "target": { + "x": 0.09090909090909091, + "y": 0.16666666666666666 + }, + "targetName": "Element 12" + }, + { + "color": { + "field": "server_region", + "fixed": "white" + }, + "path": "straight", + "size": { + "fixed": 2, + "max": 10, + "min": 1 + }, + "source": { + "x": 1, + "y": -1 + }, + "target": { + "x": -0.2727272727272727, + "y": 0.4166666666666667 + }, + "targetName": "Element 13" + } + ], + "constraint": { + "horizontal": "left", + "vertical": "top" + }, + "name": "server 1", + "placement": { + "height": 114, + "left": 468, + "top": 11, + "width": 120.99609375 + }, + "type": "server" + }, + { + "background": { + "color": { + "fixed": "transparent" + } + }, + "border": { + "color": { + "fixed": "dark-green" + } + }, + "config": { + "blinkRate": { + "fixed": 0.25 + }, + "bulbColor": { + "field": "database_server" + }, + "statusColor": { + "field": "database_server" + }, + "type": "Database" + }, + "connections": [ + { + "color": { + "field": "database_server", + "fixed": "white" + }, + "path": "straight", + "size": { + "fixed": 2, + "max": 10, + "min": 1 + }, + "source": { + "x": 1, + "y": 1 + }, + "target": { + "x": -0.15151515151515152, + "y": -0.16666666666666666 + }, + "targetName": "Element 12" + } + ], + "constraint": { + "horizontal": "left", + "vertical": "top" + }, + "name": "database 1", + "placement": { + "height": 114, + "left": 207, + "top": 367, + "width": 121 + }, + "type": "server" + }, + { + "background": { + "color": { + "fixed": "transparent" + } + }, + "border": { + "color": { + "fixed": "dark-green" + } + }, + "config": { + "blinkRate": { + "fixed": 0.5 + }, + "bulbColor": { + "field": "region_server" + }, + "statusColor": { + "field": "region_server" + }, + "type": "Terminal" + }, + "connections": [ + { + "color": { + "field": "region_server", + "fixed": "white" + }, + "path": "straight", + "size": { + "fixed": 2, + "max": 10, + "min": 1 + }, + "source": { + "x": -1, + "y": 1 + }, + "target": { + "x": -0.21212121212121213, + "y": 0.08333333333333333 + }, + "targetName": "Element 13" + } + ], + "constraint": { + "horizontal": "left", + "vertical": "top" + }, + "name": "region 1", + "placement": { + "height": 116, + "left": 699, + "top": 365, + "width": 121 + }, + "type": "server" + }, + { + "background": { + "color": { + "fixed": "transparent" + }, + "image": { + "field": "", + "fixed": "", + "mode": "fixed" + } + }, + "border": { + "color": { + "fixed": "dark-green" + } + }, + "config": { + "align": "center", + "color": { + "field": "database_server", + "fixed": "#ffffff" + }, + "size": 20, + "text": { + "field": "database_server", + "fixed": "10%", + "mode": "field" + }, + "valign": "middle" + }, + "constraint": { + "horizontal": "left", + "vertical": "top" + }, + "name": "Element 4", + "placement": { + "height": 29, + "left": 318, + "top": 282, + "width": 46 + }, + "type": "text" + }, + { + "background": { + "color": { + "fixed": "transparent" + } + }, + "border": { + "color": { + "fixed": "dark-green" + } + }, + "config": { + "blinkRate": { + "fixed": 0.5, + "mode": "mod" + }, + "bulbColor": { + "field": "database2_server" + }, + "statusColor": { + "field": "database2_server" + }, + "type": "Database" + }, + "connections": [ + { + "color": { + "field": "database2_server", + "fixed": "white" + }, + "path": "straight", + "size": { + "fixed": 2, + "max": 10, + "min": 1 + }, + "source": { + "x": 1, + "y": 1 + }, + "target": { + "x": -0.3333333333333333, + "y": 0 + }, + "targetName": "Element 11" + } + ], + "constraint": { + "horizontal": "left", + "vertical": "top" + }, + "name": "database 2", + "placement": { + "height": 116, + "left": 55, + "top": 191, + "width": 117 + }, + "type": "server" + }, + { + "background": { + "color": { + "fixed": "transparent" + }, + "image": { + "field": "", + "fixed": "", + "mode": "fixed" + } + }, + "border": { + "color": { + "fixed": "dark-green" + } + }, + "config": { + "align": "center", + "color": { + "field": "server_database", + "fixed": "#ffffff" + }, + "size": 20, + "text": { + "field": "server_database", + "fixed": "10%", + "mode": "field" + }, + "valign": "middle" + }, + "constraint": { + "horizontal": "left", + "vertical": "top" + }, + "name": "Element 6", + "placement": { + "height": 29, + "left": 382, + "top": 162, + "width": 46 + }, + "type": "text" + }, + { + "background": { + "color": { + "fixed": "transparent" + }, + "image": { + "field": "", + "fixed": "", + "mode": "fixed" + } + }, + "border": { + "color": { + "fixed": "dark-green" + } + }, + "config": { + "align": "center", + "color": { + "field": "database2_server", + "fixed": "#ffffff" + }, + "size": 20, + "text": { + "field": "database2_server", + "fixed": "10%", + "mode": "field" + }, + "valign": "middle" + }, + "constraint": { + "horizontal": "left", + "vertical": "top" + }, + "name": "Element 7", + "placement": { + "height": 29, + "left": 206, + "top": 138, + "width": 46 + }, + "type": "text" + }, + { + "background": { + "color": { + "fixed": "transparent" + }, + "image": { + "field": "", + "fixed": "", + "mode": "fixed" + } + }, + "border": { + "color": { + "fixed": "dark-green" + } + }, + "config": { + "align": "center", + "color": { + "field": "server_database2", + "fixed": "#ffffff" + }, + "size": 20, + "text": { + "field": "server_database2", + "fixed": "10%", + "mode": "field" + }, + "valign": "middle" + }, + "constraint": { + "horizontal": "left", + "vertical": "top" + }, + "name": "Element 8", + "placement": { + "height": 29, + "left": 374, + "top": 103, + "width": 46 + }, + "type": "text" + }, + { + "background": { + "color": { + "fixed": "transparent" + }, + "image": { + "field": "", + "fixed": "", + "mode": "fixed" + } + }, + "border": { + "color": { + "fixed": "dark-green" + } + }, + "config": { + "align": "center", + "color": { + "field": "server_region", + "fixed": "#ffffff" + }, + "size": 20, + "text": { + "field": "server_region", + "fixed": "10%", + "mode": "field" + }, + "valign": "middle" + }, + "constraint": { + "horizontal": "left", + "vertical": "top" + }, + "name": "Element 9", + "placement": { + "height": 29, + "left": 625, + "top": 158, + "width": 46 + }, + "type": "text" + }, + { + "background": { + "color": { + "fixed": "transparent" + }, + "image": { + "field": "", + "fixed": "", + "mode": "fixed" + } + }, + "border": { + "color": { + "fixed": "dark-green" + } + }, + "config": { + "align": "center", + "color": { + "field": "region_server", + "fixed": "#ffffff" + }, + "size": 20, + "text": { + "field": "region_server", + "fixed": "10%", + "mode": "field" + }, + "valign": "middle" + }, + "constraint": { + "horizontal": "left", + "vertical": "top" + }, + "name": "Element 10", + "placement": { + "height": 29, + "left": 676, + "top": 282, + "width": 46 + }, + "type": "text" + }, + { + "background": { + "color": { + "fixed": "transparent" + } + }, + "border": { + "color": { + "fixed": "dark-green" + } + }, + "config": { + "align": "center", + "color": { + "fixed": "#000000" + }, + "valign": "middle" + }, + "constraint": { + "horizontal": "left", + "vertical": "top" + }, + "name": "Element 11", + "placement": { + "height": 24, + "left": 268, + "top": 158, + "width": 33 + }, + "type": "rectangle" + }, + { + "background": { + "color": { + "fixed": "transparent" + } + }, + "border": { + "color": { + "fixed": "dark-green" + } + }, + "config": { + "align": "center", + "color": { + "fixed": "#000000" + }, + "valign": "middle" + }, + "constraint": { + "horizontal": "left", + "vertical": "top" + }, + "name": "Element 12", + "placement": { + "height": 24, + "left": 372, + "top": 254, + "width": 33 + }, + "type": "rectangle" + }, + { + "background": { + "color": { + "fixed": "transparent" + } + }, + "border": { + "color": { + "fixed": "dark-green" + } + }, + "config": { + "align": "center", + "color": { + "fixed": "#000000" + }, + "valign": "middle" + }, + "constraint": { + "horizontal": "left", + "vertical": "top" + }, + "name": "Element 13", + "placement": { + "height": 24, + "left": 646, + "top": 252, + "width": 33 + }, + "type": "rectangle" + }, + { + "background": { + "color": { + "fixed": "transparent" + }, + "image": { + "field": "", + "fixed": "", + "mode": "fixed" + } + }, + "border": { + "color": { + "fixed": "dark-green" + } + }, + "config": { + "align": "center", + "color": { + "field": "server_region", + "fixed": "#ffffff" + }, + "size": 20, + "text": { + "field": "server_database2", + "fixed": "Server 1", + "mode": "fixed" + }, + "valign": "middle" + }, + "constraint": { + "horizontal": "left", + "vertical": "top" + }, + "name": "Element 14", + "placement": { + "height": 29, + "left": 483, + "top": 138, + "width": 89 + }, + "type": "text" + } + ], + "name": "Element 1672954602175", + "placement": { + "height": 100, + "left": 0, + "top": 0, + "width": 100 + }, + "type": "frame" + }, + "showAdvancedTypes": false + }, + "pluginVersion": "10.1.0-pre", + "targets": [ + { + "csvContent": "database_server, server_database, server_region, region_server, database2_server, server_database2\n10, 53, 35, 12, 22, 81", + "datasource": { + "type": "testdata", + "uid": "PD8C576611E62080A" + }, + "refId": "A", + "scenarioId": "csv_content" + } + ], + "title": "Network Weathermap", + "type": "canvas" + } + ], + "refresh": "", + "revision": 1, + "schemaVersion": 38, + "style": "dark", + "tags": [ + "gdev", + "panel-tests", + "canvas" + ], + "templating": { + "list": [] + }, + "time": { + "from": "now-6h", + "to": "now" + }, + "timepicker": {}, + "timezone": "", + "title": "Panel Tests - Canvas Connection Examples", + "uid": "Pu8lwQAVz", + "version": 3, + "weekStart": "" +} \ No newline at end of file diff --git a/devenv/jsonnet/dev-dashboards.libsonnet b/devenv/jsonnet/dev-dashboards.libsonnet index 2f77d6aad43..3dbd57652c7 100644 --- a/devenv/jsonnet/dev-dashboards.libsonnet +++ b/devenv/jsonnet/dev-dashboards.libsonnet @@ -135,6 +135,13 @@ local dashboard = grafana.dashboard; id: 0, } }, + dashboard.new('canvas-connection-examples', import '../dev-dashboards/panel-canvas/canvas-connection-examples.json') + + resource.addMetadata('folder', 'dev-dashboards') + + { + spec+: { + id: 0, + } + }, dashboard.new('canvas-examples', import '../dev-dashboards/panel-canvas/canvas-examples.json') + resource.addMetadata('folder', 'dev-dashboards') + {