From 9d72758e4e91c7d13be0f03094b84dadcfd5bcc5 Mon Sep 17 00:00:00 2001 From: Connor Glynn <66882795+connormaglynn@users.noreply.github.com> Date: Tue, 7 May 2024 10:01:05 +0100 Subject: [PATCH] =?UTF-8?q?=E2=9C=A8=20Add=20CSV=20Data=20to=20Grafana=20D?= =?UTF-8?q?ashboard=20(#6)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- grafana/dashboards/plotly-dashboard-copy.json | 190 +++++++++++++++++- .../provisioning/datasources/datasource.yml | 13 +- 2 files changed, 196 insertions(+), 7 deletions(-) diff --git a/grafana/dashboards/plotly-dashboard-copy.json b/grafana/dashboards/plotly-dashboard-copy.json index e761d15..4eca658 100644 --- a/grafana/dashboards/plotly-dashboard-copy.json +++ b/grafana/dashboards/plotly-dashboard-copy.json @@ -21,6 +21,19 @@ "id": 1, "links": [], "panels": [ + { + "collapsed": false, + "gridPos": { + "h": 1, + "w": 24, + "x": 0, + "y": 0 + }, + "id": 6, + "panels": [], + "title": "From Postgres", + "type": "row" + }, { "datasource": { "type": "grafana-postgresql-datasource", @@ -88,7 +101,7 @@ "h": 8, "w": 8, "x": 0, - "y": 0 + "y": 1 }, "id": 2, "options": { @@ -242,7 +255,7 @@ "h": 8, "w": 8, "x": 8, - "y": 0 + "y": 1 }, "id": 3, "options": { @@ -403,7 +416,7 @@ "h": 8, "w": 8, "x": 16, - "y": 0 + "y": 1 }, "id": 1, "options": { @@ -489,21 +502,186 @@ ], "title": "👀 Sentry Transactions Usage - Provisioned", "type": "timeseries" + }, + { + "collapsed": false, + "gridPos": { + "h": 1, + "w": 24, + "x": 0, + "y": 9 + }, + "id": 5, + "panels": [], + "title": "From CSV", + "type": "row" + }, + { + "datasource": { + "type": "marcusolsson-csv-datasource", + "uid": "1257c93b-f998-438c-a784-7e90fb94fb3" + }, + "fieldConfig": { + "defaults": { + "color": { + "mode": "palette-classic" + }, + "custom": { + "axisBorderShow": false, + "axisCenteredZero": false, + "axisColorMode": "text", + "axisLabel": "", + "axisPlacement": "auto", + "barAlignment": 0, + "drawStyle": "line", + "fillOpacity": 0, + "gradientMode": "none", + "hideFrom": { + "legend": false, + "tooltip": false, + "viz": false + }, + "insertNulls": false, + "lineInterpolation": "linear", + "lineWidth": 1, + "pointSize": 5, + "scaleDistribution": { + "type": "linear" + }, + "showPoints": "auto", + "spanNulls": false, + "stacking": { + "group": "A", + "mode": "none" + }, + "thresholdsStyle": { + "mode": "dashed+area" + } + }, + "mappings": [], + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "green", + "value": null + }, + { + "color": "orange", + "value": 1000 + }, + { + "color": "red", + "value": 1300 + } + ] + } + }, + "overrides": [] + }, + "gridPos": { + "h": 10, + "w": 24, + "x": 0, + "y": 10 + }, + "id": 4, + "options": { + "legend": { + "calcs": [], + "displayMode": "list", + "placement": "bottom", + "showLegend": true + }, + "tooltip": { + "mode": "single", + "sort": "none" + } + }, + "pluginVersion": "10.4.2", + "targets": [ + { + "datasource": { + "type": "marcusolsson-csv-datasource", + "uid": "1257c93b-f998-438c-a784-7e90fb94fb3" + }, + "decimalSeparator": ".", + "delimiter": ",", + "header": true, + "ignoreUnknown": true, + "refId": "A", + "schema": [ + { + "name": "Date", + "type": "time" + }, + { + "name": "Product", + "type": "string" + }, + { + "name": "Quantity", + "type": "number" + } + ], + "skipRows": 0 + } + ], + "title": "💥 GitHub Actions Usage Quota", + "transformations": [ + { + "id": "filterByValue", + "options": { + "filters": [ + { + "config": { + "id": "equal", + "options": { + "value": "Actions" + } + }, + "fieldName": "Product" + } + ], + "match": "all", + "type": "include" + } + }, + { + "id": "groupBy", + "options": { + "fields": { + "Date": { + "aggregations": [], + "operation": "groupby" + }, + "Quantity": { + "aggregations": [ + "sum" + ], + "operation": "aggregate" + } + } + } + } + ], + "type": "timeseries" } ], + "refresh": "", "schemaVersion": 39, "tags": [], "templating": { "list": [] }, "time": { - "from": "2024-04-19T15:49:22.831Z", - "to": "2024-04-29T01:48:19.115Z" + "from": "2023-10-31T05:24:34.422Z", + "to": "2024-05-02T01:53:51.843Z" }, "timepicker": {}, "timezone": "", "title": "🙈 Trying to Copy The Dash/Plotly Dashboard at http://localhost:4567 - Provisioned", "uid": "cdkesxg2h6cxsd", - "version": 2, + "version": 6, "weekStart": "" } \ No newline at end of file diff --git a/grafana/provisioning/datasources/datasource.yml b/grafana/provisioning/datasources/datasource.yml index a1e5dd7..8ca7094 100644 --- a/grafana/provisioning/datasources/datasource.yml +++ b/grafana/provisioning/datasources/datasource.yml @@ -16,7 +16,7 @@ datasources: connMaxLifetime: 14400 # Grafana v5.4+ postgresVersion: 903 # 903=9.3, 904=9.4, 905=9.5, 906=9.6, 1000=10 timescaledb: false - - name: support-stats + - name: Support Stats uid: 1257c93b-f998-438c-a784-7e90fb94fb36 url: /data/support-stats.csv type: marcusolsson-csv-datasource @@ -27,3 +27,14 @@ datasources: version: 1 jsonData: storage: local + - name: GitHub Quota Usage + uid: 1257c93b-f998-438c-a784-7e90fb94fb3 + url: /data/github_actions_private_and_internal.csv + type: marcusolsson-csv-datasource + access: "proxy" + basicAuth: false + isDefault: false + editable: true + version: 1 + jsonData: + storage: local