From 9e1283873a9796a44d7ec5611b242728b1eac9e1 Mon Sep 17 00:00:00 2001 From: wittenator <9154515+wittenator@users.noreply.github.com> Date: Tue, 18 Jun 2024 15:04:10 +0200 Subject: [PATCH] Added initial dashboard setup --- grafana/dashboards/generator_dashboard.json | 333 +++++++++++++++----- 1 file changed, 256 insertions(+), 77 deletions(-) diff --git a/grafana/dashboards/generator_dashboard.json b/grafana/dashboards/generator_dashboard.json index 96864fb..cfae618 100644 --- a/grafana/dashboards/generator_dashboard.json +++ b/grafana/dashboards/generator_dashboard.json @@ -1,108 +1,287 @@ { - "__inputs": [], - "__requires": [], "annotations": { - "list": [] + "list": [ + { + "builtIn": 1, + "datasource": { + "type": "grafana", + "uid": "-- Grafana --" + }, + "enable": true, + "hide": true, + "iconColor": "rgba(0, 211, 255, 1)", + "name": "Annotations & Alerts", + "type": "dashboard" + } + ] }, - "editable": false, - "gnetId": null, + "editable": true, + "fiscalYearStartMonth": 0, "graphTooltip": 0, - "hideControls": false, - "id": null, + "id": 1, "links": [], "panels": [ { - "aliasColors": {}, - "bars": false, - "dashLength": 10, - "dashes": false, - "datasource": "TestData", - "fill": 1, + "datasource": { + "type": "grafana-postgresql-datasource", + "uid": "P44368ADAD746BC27" + }, + "fieldConfig": { + "defaults": { + "color": { + "fixedColor": "blue", + "mode": "fixed" + }, + "custom": { + "axisBorderShow": false, + "axisCenteredZero": false, + "axisColorMode": "text", + "axisLabel": "", + "axisPlacement": "auto", + "barAlignment": 0, + "drawStyle": "bars", + "fillOpacity": 90, + "gradientMode": "scheme", + "hideFrom": { + "legend": false, + "tooltip": false, + "viz": false + }, + "insertNulls": false, + "lineInterpolation": "linear", + "lineWidth": 1, + "pointSize": 5, + "scaleDistribution": { + "type": "linear" + }, + "showPoints": "auto", + "spanNulls": false, + "stacking": { + "group": "A", + "mode": "none" + }, + "thresholdsStyle": { + "mode": "off" + } + }, + "mappings": [], + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "green", + "value": null + }, + { + "color": "red", + "value": 80 + } + ] + } + }, + "overrides": [] + }, "gridPos": { - "h": 8, + "h": 9, "w": 24, "x": 0, "y": 0 }, - "id": 2, - "legend": { - "alignAsTable": false, - "avg": false, - "current": false, - "max": false, - "min": false, - "rightSide": false, - "show": true, - "total": false, - "values": false - }, - "lines": true, - "linewidth": 1, - "links": [], - "nullPointMode": "null", - "percentage": false, - "pointradius": 5, - "points": false, - "renderer": "flot", - "repeat": null, - "seriesOverrides": [], - "spaceLength": 10, - "stack": false, - "steppedLine": false, - "targets": [], - "thresholds": [], - "timeFrom": null, - "timeShift": null, - "title": "CPU Usage", - "tooltip": { - "shared": true, - "sort": 0, - "value_type": "individual" - }, - "type": "graph", - "xaxis": { - "buckets": null, - "mode": "time", - "name": null, - "show": true, - "values": [] + "id": 1, + "options": { + "legend": { + "calcs": [], + "displayMode": "hidden", + "placement": "right", + "showLegend": false + }, + "tooltip": { + "maxHeight": 600, + "mode": "single", + "sort": "none" + } }, - "yaxes": [ + "pluginVersion": "11.0.0", + "targets": [ { - "format": "short", - "label": null, - "logBase": 1, - "max": null, - "min": null, - "show": true + "datasource": { + "type": "grafana-postgresql-datasource", + "uid": "P44368ADAD746BC27" + }, + "editorMode": "code", + "format": "table", + "rawQuery": true, + "rawSql": "SELECT $__timeGroupAlias(\"timestamp\",'1w'),\n COUNT(DISTINCT name) as \"Number of Licenses\"\nFROM license\nWHERE name NOT LIKE '%test%'\nGROUP BY time", + "refId": "Count Number of Licenses over Time", + "sql": { + "columns": [ + { + "parameters": [ + { + "name": "\"timestamp\"", + "type": "functionParameter" + } + ], + "type": "function" + }, + { + "parameters": [ + { + "name": "name", + "type": "functionParameter" + } + ], + "type": "function" + } + ], + "groupBy": [ + { + "property": { + "name": "\"timestamp\"", + "type": "string" + }, + "type": "groupBy" + } + ], + "limit": 50 + }, + "table": "license" + } + ], + "title": "Number of Licenses Created ", + "type": "timeseries" + }, + { + "datasource": { + "type": "grafana-postgresql-datasource", + "uid": "P44368ADAD746BC27" + }, + "fieldConfig": { + "defaults": { + "color": { + "mode": "palette-classic" + }, + "custom": { + "fillOpacity": 80, + "gradientMode": "none", + "hideFrom": { + "legend": false, + "tooltip": false, + "viz": false + }, + "lineWidth": 1, + "stacking": { + "group": "A", + "mode": "none" + } + }, + "mappings": [], + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "green", + "value": null + }, + { + "color": "red", + "value": 80 + } + ] + } }, + "overrides": [] + }, + "gridPos": { + "h": 8, + "w": 12, + "x": 0, + "y": 9 + }, + "id": 2, + "options": { + "legend": { + "calcs": [], + "displayMode": "list", + "placement": "bottom", + "showLegend": true + } + }, + "targets": [ { - "format": "short", - "label": null, - "logBase": 1, - "max": null, - "min": null, - "show": true + "datasource": { + "type": "grafana-postgresql-datasource", + "uid": "P44368ADAD746BC27" + }, + "editorMode": "code", + "format": "table", + "rawQuery": true, + "rawSql": "SELECT COUNT(name)\nFROM license\nGROUP BY name", + "refId": "A", + "sql": { + "columns": [ + { + "parameters": [], + "type": "function" + } + ], + "groupBy": [ + { + "property": { + "type": "string" + }, + "type": "groupBy" + } + ], + "limit": 50 + } } - ] + ], + "title": "Number of Edits of a License", + "type": "histogram" } ], "refresh": "", - "rows": [], - "schemaVersion": 16, - "tags": ["kubernetes"], + "schemaVersion": 39, + "tags": [ + "kubernetes" + ], "templating": { "list": [] }, "time": { - "from": "now-6h", + "from": "2024-02-29T23:00:00.000Z", "to": "now" }, + "timeRangeUpdatedDuringEditOrView": false, "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": "browser", "title": "Cluster", - "version": 0 + "uid": "fdp5e17m7wkqoc", + "version": 4, + "weekStart": "" } \ No newline at end of file