{ "annotations": { "list": [ { "builtIn": 1, "datasource": { "type": "grafana", "uid": "-- Grafana --" }, "enable": true, "hide": true, "iconColor": "rgba(0, 211, 255, 1)", "name": "Annotations & Alerts", "type": "dashboard" } ] }, "editable": true, "fiscalYearStartMonth": 0, "graphTooltip": 0, "id": null, "links": [], "liveNow": false, "panels": [ { "datasource": { "type": "loki", "uid": "Loki" }, "gridPos": { "h": 10, "w": 24, "x": 0, "y": 0 }, "id": 1, "options": { "dedupStrategy": "none", "enableLogDetails": true, "prettifyLogMessage": false, "showCommonLabels": false, "showLabels": false, "showTime": true, "sortOrder": "Descending", "wrapLogMessage": false }, "targets": [ { "datasource": { "type": "loki", "uid": "Loki" }, "editorMode": "code", "expr": "{job=\"functional-scaffold-app\"}", "queryType": "range", "refId": "A" } ], "title": "日志流 (实时)", "type": "logs" }, { "datasource": { "type": "loki", "uid": "Loki" }, "fieldConfig": { "defaults": { "color": { "mode": "palette-classic" }, "custom": { "axisCenteredZero": false, "axisColorMode": "text", "axisLabel": "", "axisPlacement": "auto", "barAlignment": 0, "drawStyle": "line", "fillOpacity": 10, "gradientMode": "none", "hideFrom": { "tooltip": false, "viz": false, "legend": false }, "lineInterpolation": "linear", "lineWidth": 1, "pointSize": 5, "scaleDistribution": { "type": "linear" }, "showPoints": "never", "spanNulls": false, "stacking": { "group": "A", "mode": "none" }, "thresholdsStyle": { "mode": "off" } }, "mappings": [], "thresholds": { "mode": "absolute", "steps": [ { "color": "green", "value": null } ] }, "unit": "short" }, "overrides": [] }, "gridPos": { "h": 8, "w": 12, "x": 0, "y": 10 }, "id": 2, "options": { "legend": { "calcs": [], "displayMode": "list", "placement": "bottom", "showLegend": true }, "tooltip": { "mode": "single", "sort": "none" } }, "targets": [ { "datasource": { "type": "loki", "uid": "Loki" }, "editorMode": "code", "expr": "sum by (level) (count_over_time({job=\"functional-scaffold-app\"}[1m]))", "queryType": "range", "refId": "A" } ], "title": "日志量趋势(按级别)", "type": "timeseries" }, { "datasource": { "type": "loki", "uid": "Loki" }, "fieldConfig": { "defaults": { "color": { "mode": "thresholds" }, "mappings": [], "thresholds": { "mode": "absolute", "steps": [ { "color": "green", "value": null }, { "color": "yellow", "value": 10 }, { "color": "red", "value": 50 } ] } }, "overrides": [] }, "gridPos": { "h": 8, "w": 12, "x": 12, "y": 10 }, "id": 3, "options": { "orientation": "auto", "reduceOptions": { "values": false, "calcs": [ "lastNotNull" ], "fields": "" }, "showThresholdLabels": false, "showThresholdMarkers": true }, "pluginVersion": "9.5.3", "targets": [ { "datasource": { "type": "loki", "uid": "Loki" }, "editorMode": "code", "expr": "sum by (level) (count_over_time({job=\"functional-scaffold-app\"}[$__range]))", "queryType": "range", "refId": "A" } ], "title": "日志级别分布", "type": "gauge" }, { "datasource": { "type": "loki", "uid": "Loki" }, "gridPos": { "h": 10, "w": 24, "x": 0, "y": 18 }, "id": 4, "options": { "dedupStrategy": "none", "enableLogDetails": true, "prettifyLogMessage": false, "showCommonLabels": false, "showLabels": false, "showTime": true, "sortOrder": "Descending", "wrapLogMessage": false }, "targets": [ { "datasource": { "type": "loki", "uid": "Loki" }, "editorMode": "code", "expr": "{job=\"functional-scaffold-app\", level=\"ERROR\"}", "queryType": "range", "refId": "A" } ], "title": "错误日志", "type": "logs" } ], "refresh": "5s", "schemaVersion": 38, "style": "dark", "tags": ["logs", "loki"], "templating": { "list": [ { "current": { "selected": false, "text": "", "value": "" }, "hide": 0, "label": "Request ID", "name": "request_id", "options": [ { "selected": true, "text": "", "value": "" } ], "query": "", "skipUrlSync": false, "type": "textbox" } ] }, "time": { "from": "now-15m", "to": "now" }, "timepicker": {}, "timezone": "", "title": "日志监控", "uid": "logs-dashboard", "version": 0, "weekStart": "" }