From ca2cddf450b764014d74ff14d853a1938c850e53 Mon Sep 17 00:00:00 2001 From: Mo Sohani Date: Thu, 5 Dec 2024 20:42:49 -0500 Subject: [PATCH] added frontend dashboard --- .../plg/grafana/dashboards/frontend.json | 238 ++++++++++++++++++ 1 file changed, 238 insertions(+) create mode 100644 tdrs-backend/plg/grafana/dashboards/frontend.json diff --git a/tdrs-backend/plg/grafana/dashboards/frontend.json b/tdrs-backend/plg/grafana/dashboards/frontend.json new file mode 100644 index 000000000..3dfecea16 --- /dev/null +++ b/tdrs-backend/plg/grafana/dashboards/frontend.json @@ -0,0 +1,238 @@ +{ + "annotations": { + "list": [ + { + "builtIn": 1, + "datasource": { + "type": "grafana", + "uid": "-- Grafana --" + }, + "enable": true, + "hide": true, + "iconColor": "rgba(0, 211, 255, 1)", + "name": "Annotations & Alerts", + "type": "dashboard" + } + ] + }, + "description": "Dashboard allowing log visualization", + "editable": true, + "fiscalYearStartMonth": 0, + "graphTooltip": 0, + "id": 6, + "links": [], + "panels": [ + { + "datasource": { + "default": true, + "type": "prometheus", + "uid": "PBFA97CFB590B2093" + }, + "fieldConfig": { + "defaults": { + "color": { + "mode": "thresholds" + }, + "mappings": [], + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "green", + "value": null + }, + { + "color": "dark-red", + "value": 80 + }, + { + "color": "light-red", + "value": 85 + }, + { + "color": "#EAB839", + "value": 90 + }, + { + "color": "semi-dark-green", + "value": 95 + }, + { + "color": "dark-green", + "value": 100 + } + ] + }, + "unit": "percent" + }, + "overrides": [] + }, + "gridPos": { + "h": 14, + "w": 24, + "x": 0, + "y": 0 + }, + "id": 2, + "options": { + "colorMode": "background", + "graphMode": "none", + "justifyMode": "center", + "orientation": "auto", + "percentChangeColorMode": "standard", + "reduceOptions": { + "calcs": [ + "lastNotNull" + ], + "fields": "", + "values": false + }, + "showPercentChange": false, + "textMode": "auto", + "wideLayout": true + }, + "pluginVersion": "11.2.0", + "targets": [ + { + "datasource": { + "type": "prometheus", + "uid": "PBFA97CFB590B2093" + }, + "editorMode": "code", + "expr": "100 * avg_over_time(up{job=~\"$app\"}[$__range])", + "instant": false, + "legendFormat": "__auto", + "range": true, + "refId": "A" + } + ], + "title": "App Uptime", + "type": "stat" + }, + { + "datasource": { + "default": false, + "type": "loki", + "uid": "L8E80F9AEF21F6940" + }, + "gridPos": { + "h": 28, + "w": 24, + "x": 0, + "y": 14 + }, + "id": 1, + "options": { + "dedupStrategy": "none", + "enableLogDetails": true, + "prettifyLogMessage": true, + "showCommonLabels": false, + "showLabels": false, + "showTime": false, + "sortOrder": "Descending", + "wrapLogMessage": true + }, + "targets": [ + { + "datasource": { + "type": "loki", + "uid": "L8E80F9AEF21F6940" + }, + "editorMode": "code", + "expr": "{job=\"frontend-local\"}", + "queryType": "range", + "refId": "A" + } + ], + "title": "Job Logs", + "type": "logs" + } + ], + "refresh": "10s", + "schemaVersion": 39, + "tags": [ + "Django", + "Logs", + "Loki" + ], + "templating": { + "list": [ + { + "current": { + "selected": false, + "text": "All", + "value": "$__all" + }, + "datasource": { + "type": "loki", + "uid": "L8E80F9AEF21F6940" + }, + "definition": "", + "description": "Filter logs by job.", + "hide": 0, + "includeAll": true, + "label": "Job", + "multi": false, + "name": "job", + "options": [], + "query": { + "label": "job", + "refId": "LokiVariableQueryEditor-VariableQuery", + "stream": "", + "type": 1 + }, + "refresh": 1, + "regex": "", + "skipUrlSync": false, + "sort": 0, + "type": "query" + }, + { + "current": { + "selected": true, + "selected": false, + "text": "All", + "value": "$__all" + }, + { + "current": { + "selected": true, + "selected": false, + "text": "All", + "value": "$__all" + }, + "datasource": { + "type": "loki", + "uid": "L8E80F9AEF21F6940" + }, + "definition": "", + "hide": 0, + "includeAll": true, + "multi": false, + "name": "level", + "options": [], + "query": { + "label": "level", + "refId": "LokiVariableQueryEditor-VariableQuery", + "stream": "", + "type": 1 + }, + "refresh": 1, + "regex": "", + "skipUrlSync": false, + "sort": 0, + "type": "query" + } + ] + }, + "time": { + "from": "now-24h", + "to": "now" + }, + "timepicker": {}, + "timezone": "browser", + "title": "frontend logs", + "uid": "cdyz6flmh0ttsU", + "version": 2, + "weekStart": "" +} \ No newline at end of file