diff --git a/dashboards/logs.json b/dashboards/logs.json new file mode 100644 index 0000000000000000000000000000000000000000..979ed332cedf5500515a04ecf327c0d10bc8cdf1 --- /dev/null +++ b/dashboards/logs.json @@ -0,0 +1,323 @@ +{ + "__inputs": [ + { + "name": "DS_LOKI", + "label": "Loki", + "description": "", + "type": "datasource", + "pluginId": "loki", + "pluginName": "Loki" + } + ], + "__elements": {}, + "__requires": [ + { + "type": "panel", + "id": "barchart", + "name": "Bar chart", + "version": "" + }, + { + "type": "grafana", + "id": "grafana", + "name": "Grafana", + "version": "9.3.0-beta1" + }, + { + "type": "panel", + "id": "logs", + "name": "Logs", + "version": "" + }, + { + "type": "datasource", + "id": "loki", + "name": "Loki", + "version": "1.0.0" + } + ], + "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, + "id": null, + "links": [], + "liveNow": false, + "panels": [ + { + "datasource": { + "type": "loki", + "uid": "${DS_LOKI}" + }, + "fieldConfig": { + "defaults": { + "color": { + "mode": "palette-classic" + }, + "custom": { + "axisCenteredZero": false, + "axisColorMode": "text", + "axisLabel": "", + "axisPlacement": "auto", + "fillOpacity": 80, + "gradientMode": "none", + "hideFrom": { + "legend": false, + "tooltip": false, + "viz": false + }, + "lineWidth": 1, + "scaleDistribution": { + "type": "linear" + }, + "thresholdsStyle": { + "mode": "off" + } + }, + "mappings": [], + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "green", + "value": null + }, + { + "color": "red", + "value": 80 + } + ] + } + }, + "overrides": [ + { + "matcher": { + "id": "byName", + "options": "DEBUG" + }, + "properties": [ + { + "id": "color", + "value": { + "fixedColor": "blue", + "mode": "fixed" + } + } + ] + }, + { + "matcher": { + "id": "byName", + "options": "ERROR" + }, + "properties": [ + { + "id": "color", + "value": { + "fixedColor": "red", + "mode": "fixed" + } + } + ] + }, + { + "matcher": { + "id": "byName", + "options": "INFO" + }, + "properties": [ + { + "id": "color", + "value": { + "fixedColor": "green", + "mode": "fixed" + } + } + ] + }, + { + "matcher": { + "id": "byName", + "options": "WARNING" + }, + "properties": [ + { + "id": "color", + "value": { + "fixedColor": "yellow", + "mode": "fixed" + } + } + ] + } + ] + }, + "gridPos": { + "h": 9, + "w": 24, + "x": 0, + "y": 0 + }, + "id": 3, + "options": { + "barRadius": 0, + "barWidth": 0.5, + "groupWidth": 0.7, + "legend": { + "calcs": [], + "displayMode": "list", + "placement": "bottom", + "showLegend": false + }, + "orientation": "auto", + "showValue": "never", + "stacking": "normal", + "tooltip": { + "mode": "single", + "sort": "none" + }, + "xTickLabelRotation": 0, + "xTickLabelSpacing": 0 + }, + "pluginVersion": "9.3.0-beta1", + "targets": [ + { + "datasource": { + "type": "loki", + "uid": "${DS_LOKI}" + }, + "editorMode": "code", + "expr": "rate({program=\"/home/tango/.local/bin/l2ss-$device\"} [$__interval])", + "hide": false, + "legendFormat": "{{level}}", + "queryType": "range", + "refId": "A", + "resolution": 1 + } + ], + "title": "Log Volume", + "type": "barchart" + }, + { + "datasource": { + "type": "loki", + "uid": "${DS_LOKI}" + }, + "gridPos": { + "h": 9, + "w": 24, + "x": 0, + "y": 9 + }, + "id": 1, + "options": { + "dedupStrategy": "none", + "enableLogDetails": true, + "prettifyLogMessage": false, + "showCommonLabels": false, + "showLabels": false, + "showTime": true, + "sortOrder": "Descending", + "wrapLogMessage": false + }, + "targets": [ + { + "datasource": { + "type": "loki", + "uid": "${DS_LOKI}" + }, + "editorMode": "code", + "expr": "{program=\"/home/tango/.local/bin/l2ss-$device\"} |= `` | logfmt", + "key": "Q-9ba51526-d461-4190-a861-0ca3403910d3-0", + "queryType": "range", + "refId": "A" + } + ], + "title": "Device Log", + "transformations": [ + { + "id": "filterFieldsByName", + "options": {} + } + ], + "type": "logs" + } + ], + "refresh": "", + "schemaVersion": 37, + "style": "dark", + "tags": [], + "templating": { + "list": [ + { + "current": {}, + "definition": "scrape_series_added", + "hide": 0, + "includeAll": false, + "label": "Station", + "multi": false, + "name": "station", + "options": [], + "query": { + "query": "scrape_series_added", + "refId": "StandardVariableQuery" + }, + "refresh": 1, + "regex": "/.*host=\"(?<text>[^\"]*)\".*/", + "skipUrlSync": false, + "sort": 1, + "type": "query" + }, + { + "current": {}, + "definition": "device_scraping{host=\"$station\", device=~\"stat/.*/1\"}", + "hide": 0, + "includeAll": false, + "label": "Device", + "multi": false, + "name": "device", + "options": [], + "query": { + "query": "device_scraping{host=\"$station\", device=~\"stat/.*/1\"}", + "refId": "StandardVariableQuery" + }, + "refresh": 1, + "regex": "/.*device=\"stat/(?<text>[^\"]*)/1\".*/", + "skipUrlSync": false, + "sort": 1, + "type": "query" + } + ] + }, + "time": { + "from": "now-1h", + "to": "now" + }, + "timepicker": {}, + "timezone": "", + "title": "Logs", + "uid": "Hqo-qIO4z", + "version": 15, + "weekStart": "" + }