{ "title": "Xpeditis — Logs & Monitoring", "uid": "xpeditis-logs", "description": "Dashboard complet — logs backend/frontend, métriques HTTP, erreurs", "tags": ["xpeditis", "logs", "backend", "frontend"], "timezone": "browser", "refresh": "30s", "schemaVersion": 38, "time": { "from": "now-1h", "to": "now" }, "timepicker": {}, "fiscalYearStartMonth": 0, "graphTooltip": 1, "editable": true, "version": 1, "weekStart": "", "links": [], "annotations": { "list": [ { "builtIn": 1, "datasource": { "type": "grafana", "uid": "-- Grafana --" }, "enable": true, "hide": true, "iconColor": "rgba(0,211,255,1)", "name": "Annotations & Alerts", "type": "dashboard" } ] }, "templating": { "list": [ { "name": "service", "label": "Service", "type": "query", "datasource": { "type": "loki", "uid": "loki-xpeditis" }, "query": "label_values(service)", "refresh": 2, "sort": 1, "includeAll": true, "allValue": ".+", "multi": false, "hide": 0, "current": {}, "options": [] }, { "name": "level", "label": "Niveau", "type": "custom", "query": "All : .+, error : error, fatal : fatal, warn : warn, info : info, debug : debug", "includeAll": false, "multi": false, "hide": 0, "current": { "text": "All", "value": ".+" }, "options": [ { "text": "All", "value": ".+", "selected": true }, { "text": "error", "value": "error", "selected": false }, { "text": "fatal", "value": "fatal", "selected": false }, { "text": "warn", "value": "warn", "selected": false }, { "text": "info", "value": "info", "selected": false }, { "text": "debug", "value": "debug", "selected": false } ] }, { "name": "search", "label": "Recherche", "type": "textbox", "query": "", "hide": 0, "current": { "text": "", "value": "" }, "options": [{ "selected": true, "text": "", "value": "" }] } ] }, "panels": [ { "id": 100, "type": "row", "title": "Vue d'ensemble", "collapsed": false, "gridPos": { "h": 1, "w": 24, "x": 0, "y": 0 } }, { "id": 1, "title": "Total logs", "type": "stat", "gridPos": { "h": 4, "w": 4, "x": 0, "y": 1 }, "datasource": { "type": "loki", "uid": "loki-xpeditis" }, "options": { "reduceOptions": { "calcs": ["lastNotNull"], "fields": "", "values": false }, "orientation": "auto", "textMode": "auto", "colorMode": "background", "graphMode": "area", "justifyMode": "center" }, "fieldConfig": { "defaults": { "color": { "mode": "thresholds" }, "thresholds": { "mode": "absolute", "steps": [{ "color": "blue", "value": null }] }, "mappings": [] }, "overrides": [] }, "targets": [ { "refId": "A", "datasource": { "type": "loki", "uid": "loki-xpeditis" }, "expr": "sum(count_over_time({service=~\"$service\"} [$__range]))", "legendFormat": "Total", "instant": true } ] }, { "id": 2, "title": "Erreurs & Fatal", "type": "stat", "gridPos": { "h": 4, "w": 4, "x": 4, "y": 1 }, "datasource": { "type": "loki", "uid": "loki-xpeditis" }, "options": { "reduceOptions": { "calcs": ["lastNotNull"], "fields": "", "values": false }, "orientation": "auto", "textMode": "auto", "colorMode": "background", "graphMode": "area", "justifyMode": "center" }, "fieldConfig": { "defaults": { "color": { "mode": "thresholds" }, "thresholds": { "mode": "absolute", "steps": [{ "color": "green", "value": null }, { "color": "red", "value": 1 }] }, "mappings": [] }, "overrides": [] }, "targets": [ { "refId": "A", "datasource": { "type": "loki", "uid": "loki-xpeditis" }, "expr": "sum(count_over_time({service=~\"$service\", level=~\"error|fatal\"} [$__range]))", "legendFormat": "Erreurs", "instant": true } ] }, { "id": 3, "title": "Warnings", "type": "stat", "gridPos": { "h": 4, "w": 4, "x": 8, "y": 1 }, "datasource": { "type": "loki", "uid": "loki-xpeditis" }, "options": { "reduceOptions": { "calcs": ["lastNotNull"], "fields": "", "values": false }, "orientation": "auto", "textMode": "auto", "colorMode": "background", "graphMode": "area", "justifyMode": "center" }, "fieldConfig": { "defaults": { "color": { "mode": "thresholds" }, "thresholds": { "mode": "absolute", "steps": [{ "color": "green", "value": null }, { "color": "orange", "value": 1 }] }, "mappings": [] }, "overrides": [] }, "targets": [ { "refId": "A", "datasource": { "type": "loki", "uid": "loki-xpeditis" }, "expr": "sum(count_over_time({service=~\"$service\", level=\"warn\"} [$__range]))", "legendFormat": "Warnings", "instant": true } ] }, { "id": 4, "title": "Info", "type": "stat", "gridPos": { "h": 4, "w": 4, "x": 12, "y": 1 }, "datasource": { "type": "loki", "uid": "loki-xpeditis" }, "options": { "reduceOptions": { "calcs": ["lastNotNull"], "fields": "", "values": false }, "orientation": "auto", "textMode": "auto", "colorMode": "background", "graphMode": "area", "justifyMode": "center" }, "fieldConfig": { "defaults": { "color": { "fixedColor": "blue", "mode": "fixed" }, "thresholds": { "mode": "absolute", "steps": [{ "color": "blue", "value": null }] }, "mappings": [] }, "overrides": [] }, "targets": [ { "refId": "A", "datasource": { "type": "loki", "uid": "loki-xpeditis" }, "expr": "sum(count_over_time({service=~\"$service\", level=\"info\"} [$__range]))", "legendFormat": "Info", "instant": true } ] }, { "id": 5, "title": "Requêtes HTTP 5xx", "type": "stat", "gridPos": { "h": 4, "w": 4, "x": 16, "y": 1 }, "datasource": { "type": "loki", "uid": "loki-xpeditis" }, "options": { "reduceOptions": { "calcs": ["lastNotNull"], "fields": "", "values": false }, "orientation": "auto", "textMode": "auto", "colorMode": "background", "graphMode": "area", "justifyMode": "center" }, "fieldConfig": { "defaults": { "color": { "mode": "thresholds" }, "thresholds": { "mode": "absolute", "steps": [{ "color": "green", "value": null }, { "color": "red", "value": 1 }] }, "mappings": [] }, "overrides": [] }, "targets": [ { "refId": "A", "datasource": { "type": "loki", "uid": "loki-xpeditis" }, "expr": "sum(count_over_time({service=\"backend\"} | json | res_statusCode >= 500 [$__range]))", "legendFormat": "5xx", "instant": true } ] }, { "id": 6, "title": "Temps réponse moyen (ms)", "type": "stat", "gridPos": { "h": 4, "w": 4, "x": 20, "y": 1 }, "datasource": { "type": "loki", "uid": "loki-xpeditis" }, "options": { "reduceOptions": { "calcs": ["lastNotNull"], "fields": "", "values": false }, "orientation": "auto", "textMode": "auto", "colorMode": "background", "graphMode": "area", "justifyMode": "center" }, "fieldConfig": { "defaults": { "color": { "mode": "thresholds" }, "unit": "ms", "thresholds": { "mode": "absolute", "steps": [{ "color": "green", "value": null }, { "color": "orange", "value": 500 }, { "color": "red", "value": 2000 }] }, "mappings": [] }, "overrides": [] }, "targets": [ { "refId": "A", "datasource": { "type": "loki", "uid": "loki-xpeditis" }, "expr": "avg(avg_over_time({service=\"backend\"} | json | unwrap responseTime [$__range]))", "legendFormat": "Avg", "instant": true } ] }, { "id": 200, "type": "row", "title": "Volume des logs", "collapsed": false, "gridPos": { "h": 1, "w": 24, "x": 0, "y": 5 } }, { "id": 7, "title": "Volume par niveau", "type": "timeseries", "gridPos": { "h": 8, "w": 14, "x": 0, "y": 6 }, "datasource": { "type": "loki", "uid": "loki-xpeditis" }, "options": { "legend": { "calcs": ["sum"], "displayMode": "list", "placement": "bottom", "showLegend": true }, "tooltip": { "mode": "multi", "sort": "desc" } }, "fieldConfig": { "defaults": { "color": { "mode": "palette-classic" }, "custom": { "drawStyle": "bars", "fillOpacity": 80, "stacking": { "group": "A", "mode": "normal" }, "lineWidth": 1, "pointSize": 5, "showPoints": "never", "spanNulls": false }, "unit": "short", "mappings": [], "thresholds": { "mode": "absolute", "steps": [{ "color": "green", "value": null }] } }, "overrides": [ { "matcher": { "id": "byName", "options": "error" }, "properties": [{ "id": "color", "value": { "fixedColor": "red", "mode": "fixed" } }] }, { "matcher": { "id": "byName", "options": "fatal" }, "properties": [{ "id": "color", "value": { "fixedColor": "dark-red", "mode": "fixed" } }] }, { "matcher": { "id": "byName", "options": "warn" }, "properties": [{ "id": "color", "value": { "fixedColor": "orange", "mode": "fixed" } }] }, { "matcher": { "id": "byName", "options": "info" }, "properties": [{ "id": "color", "value": { "fixedColor": "blue", "mode": "fixed" } }] }, { "matcher": { "id": "byName", "options": "debug" }, "properties": [{ "id": "color", "value": { "fixedColor": "gray", "mode": "fixed" } }] } ] }, "targets": [ { "refId": "A", "datasource": { "type": "loki", "uid": "loki-xpeditis" }, "expr": "sum by (level) (count_over_time({service=~\"$service\", level=~\".+\"} [$__interval]))", "legendFormat": "{{level}}" } ] }, { "id": 8, "title": "Volume par service", "type": "timeseries", "gridPos": { "h": 8, "w": 10, "x": 14, "y": 6 }, "datasource": { "type": "loki", "uid": "loki-xpeditis" }, "options": { "legend": { "calcs": ["sum"], "displayMode": "list", "placement": "bottom", "showLegend": true }, "tooltip": { "mode": "multi", "sort": "desc" } }, "fieldConfig": { "defaults": { "color": { "mode": "palette-classic" }, "custom": { "drawStyle": "bars", "fillOpacity": 60, "stacking": { "group": "A", "mode": "normal" }, "lineWidth": 1, "showPoints": "never", "spanNulls": false }, "unit": "short", "mappings": [], "thresholds": { "mode": "absolute", "steps": [{ "color": "green", "value": null }] } }, "overrides": [] }, "targets": [ { "refId": "A", "datasource": { "type": "loki", "uid": "loki-xpeditis" }, "expr": "sum by (service) (count_over_time({service=~\"$service\"} [$__interval]))", "legendFormat": "{{service}}" } ] }, { "id": 300, "type": "row", "title": "HTTP — Backend", "collapsed": false, "gridPos": { "h": 1, "w": 24, "x": 0, "y": 14 } }, { "id": 9, "title": "Taux d'erreur HTTP", "type": "timeseries", "gridPos": { "h": 8, "w": 12, "x": 0, "y": 15 }, "datasource": { "type": "loki", "uid": "loki-xpeditis" }, "options": { "legend": { "calcs": ["max", "mean"], "displayMode": "list", "placement": "bottom", "showLegend": true }, "tooltip": { "mode": "multi", "sort": "desc" } }, "fieldConfig": { "defaults": { "color": { "mode": "palette-classic" }, "custom": { "drawStyle": "line", "fillOpacity": 20, "lineWidth": 2, "pointSize": 5, "showPoints": "never", "spanNulls": false }, "unit": "short", "mappings": [], "thresholds": { "mode": "absolute", "steps": [{ "color": "green", "value": null }] } }, "overrides": [ { "matcher": { "id": "byName", "options": "5xx" }, "properties": [{ "id": "color", "value": { "fixedColor": "red", "mode": "fixed" } }] }, { "matcher": { "id": "byName", "options": "4xx" }, "properties": [{ "id": "color", "value": { "fixedColor": "orange", "mode": "fixed" } }] }, { "matcher": { "id": "byName", "options": "2xx" }, "properties": [{ "id": "color", "value": { "fixedColor": "green", "mode": "fixed" } }] } ] }, "targets": [ { "refId": "A", "datasource": { "type": "loki", "uid": "loki-xpeditis" }, "expr": "sum(count_over_time({service=\"backend\"} | json | res_statusCode >= 500 [$__interval]))", "legendFormat": "5xx" }, { "refId": "B", "datasource": { "type": "loki", "uid": "loki-xpeditis" }, "expr": "sum(count_over_time({service=\"backend\"} | json | res_statusCode >= 400 < 500 [$__interval]))", "legendFormat": "4xx" }, { "refId": "C", "datasource": { "type": "loki", "uid": "loki-xpeditis" }, "expr": "sum(count_over_time({service=\"backend\"} | json | res_statusCode >= 200 < 300 [$__interval]))", "legendFormat": "2xx" } ] }, { "id": 10, "title": "Temps de réponse (ms)", "type": "timeseries", "gridPos": { "h": 8, "w": 12, "x": 12, "y": 15 }, "datasource": { "type": "loki", "uid": "loki-xpeditis" }, "options": { "legend": { "calcs": ["max", "mean"], "displayMode": "list", "placement": "bottom", "showLegend": true }, "tooltip": { "mode": "multi", "sort": "desc" } }, "fieldConfig": { "defaults": { "color": { "mode": "palette-classic" }, "custom": { "drawStyle": "line", "fillOpacity": 10, "lineWidth": 2, "pointSize": 5, "showPoints": "never", "spanNulls": false }, "unit": "ms", "mappings": [], "thresholds": { "mode": "absolute", "steps": [{ "color": "green", "value": null }, { "color": "orange", "value": 500 }, { "color": "red", "value": 2000 }] } }, "overrides": [] }, "targets": [ { "refId": "A", "datasource": { "type": "loki", "uid": "loki-xpeditis" }, "expr": "avg(avg_over_time({service=\"backend\"} | json | unwrap responseTime [$__interval]))", "legendFormat": "Moy" }, { "refId": "B", "datasource": { "type": "loki", "uid": "loki-xpeditis" }, "expr": "max(max_over_time({service=\"backend\"} | json | unwrap responseTime [$__interval]))", "legendFormat": "Max" } ] }, { "id": 400, "type": "row", "title": "Logs — Flux en direct", "collapsed": false, "gridPos": { "h": 1, "w": 24, "x": 0, "y": 23 } }, { "id": 11, "title": "Backend — Logs", "type": "logs", "gridPos": { "h": 14, "w": 12, "x": 0, "y": 24 }, "datasource": { "type": "loki", "uid": "loki-xpeditis" }, "options": { "dedupStrategy": "none", "enableLogDetails": true, "prettifyLogMessage": true, "showCommonLabels": false, "showLabels": false, "showTime": true, "sortOrder": "Descending", "wrapLogMessage": false }, "targets": [ { "refId": "A", "datasource": { "type": "loki", "uid": "loki-xpeditis" }, "expr": "{service=\"backend\", level=~\"$level\"} |= \"$search\"", "legendFormat": "" } ] }, { "id": 12, "title": "Frontend — Logs", "type": "logs", "gridPos": { "h": 14, "w": 12, "x": 12, "y": 24 }, "datasource": { "type": "loki", "uid": "loki-xpeditis" }, "options": { "dedupStrategy": "none", "enableLogDetails": true, "prettifyLogMessage": true, "showCommonLabels": false, "showLabels": false, "showTime": true, "sortOrder": "Descending", "wrapLogMessage": false }, "targets": [ { "refId": "A", "datasource": { "type": "loki", "uid": "loki-xpeditis" }, "expr": "{service=\"frontend\", level=~\"$level\"} |= \"$search\"", "legendFormat": "" } ] }, { "id": 500, "type": "row", "title": "Tous les logs filtrés", "collapsed": false, "gridPos": { "h": 1, "w": 24, "x": 0, "y": 38 } }, { "id": 13, "title": "Flux filtré — $service / $level", "description": "Utilisez les variables en haut pour filtrer par service, niveau ou mot-clé", "type": "logs", "gridPos": { "h": 14, "w": 24, "x": 0, "y": 39 }, "datasource": { "type": "loki", "uid": "loki-xpeditis" }, "options": { "dedupStrategy": "none", "enableLogDetails": true, "prettifyLogMessage": true, "showCommonLabels": false, "showLabels": true, "showTime": true, "sortOrder": "Descending", "wrapLogMessage": true }, "targets": [ { "refId": "A", "datasource": { "type": "loki", "uid": "loki-xpeditis" }, "expr": "{service=~\"$service\", level=~\"$level\"} |= \"$search\"", "legendFormat": "" } ] }, { "id": 600, "type": "row", "title": "Erreurs & Exceptions", "collapsed": false, "gridPos": { "h": 1, "w": 24, "x": 0, "y": 53 } }, { "id": 14, "title": "Erreurs — Backend", "type": "logs", "gridPos": { "h": 10, "w": 12, "x": 0, "y": 54 }, "datasource": { "type": "loki", "uid": "loki-xpeditis" }, "options": { "dedupStrategy": "signature", "enableLogDetails": true, "prettifyLogMessage": true, "showCommonLabels": false, "showLabels": false, "showTime": true, "sortOrder": "Descending", "wrapLogMessage": true }, "targets": [ { "refId": "A", "datasource": { "type": "loki", "uid": "loki-xpeditis" }, "expr": "{service=\"backend\", level=~\"error|fatal\"}", "legendFormat": "" } ] }, { "id": 15, "title": "Erreurs — Frontend", "type": "logs", "gridPos": { "h": 10, "w": 12, "x": 12, "y": 54 }, "datasource": { "type": "loki", "uid": "loki-xpeditis" }, "options": { "dedupStrategy": "signature", "enableLogDetails": true, "prettifyLogMessage": true, "showCommonLabels": false, "showLabels": false, "showTime": true, "sortOrder": "Descending", "wrapLogMessage": true }, "targets": [ { "refId": "A", "datasource": { "type": "loki", "uid": "loki-xpeditis" }, "expr": "{service=\"frontend\", level=~\"error|fatal\"}", "legendFormat": "" } ] } ] }