{ "uid": "enervision-donnees", "title": "EnerVision · Données et modèle", "description": "Fraîcheur des relevés, alertes métier et dérive du modèle, lus dans TimescaleDB par le rôle supervision.", "tags": [ "enervision" ], "timezone": "browser", "editable": false, "graphTooltip": 1, "refresh": "1m", "schemaVersion": 39, "version": 1, "time": { "from": "now-7d", "to": "now" }, "templating": { "list": [] }, "annotations": { "list": [] }, "links": [], "panels": [ { "id": 1, "type": "stat", "title": "Sites suivis", "gridPos": { "x": 0, "y": 0, "w": 6, "h": 4 }, "datasource": { "type": "grafana-postgresql-datasource", "uid": "timescaledb" }, "targets": [ { "refId": "A", "datasource": { "type": "grafana-postgresql-datasource", "uid": "timescaledb" }, "rawSql": "SELECT count(*) AS \"Sites\" FROM site", "format": "table", "rawQuery": true, "editorMode": "code" } ], "fieldConfig": { "defaults": { "thresholds": { "mode": "absolute", "steps": [ { "color": "blue", "value": null } ] }, "color": { "mode": "thresholds" } }, "overrides": [] }, "options": { "reduceOptions": { "calcs": [ "lastNotNull" ], "fields": "", "values": false }, "colorMode": "background", "graphMode": "area", "textMode": "auto" } }, { "id": 2, "type": "stat", "title": "Relevés sur 24 h", "gridPos": { "x": 6, "y": 0, "w": 6, "h": 4 }, "datasource": { "type": "grafana-postgresql-datasource", "uid": "timescaledb" }, "targets": [ { "refId": "A", "datasource": { "type": "grafana-postgresql-datasource", "uid": "timescaledb" }, "rawSql": "SELECT count(*) AS \"Relevés\" FROM reading WHERE timestamp > now() - interval '24 hours'", "format": "table", "rawQuery": true, "editorMode": "code" } ], "fieldConfig": { "defaults": { "unit": "short", "thresholds": { "mode": "absolute", "steps": [ { "color": "red", "value": null }, { "color": "green", "value": 1 } ] }, "color": { "mode": "thresholds" } }, "overrides": [] }, "options": { "reduceOptions": { "calcs": [ "lastNotNull" ], "fields": "", "values": false }, "colorMode": "background", "graphMode": "area", "textMode": "auto" }, "description": "Zéro : l'import de la Mock API ne tourne plus." }, { "id": 3, "type": "stat", "title": "Alertes sur 24 h", "gridPos": { "x": 12, "y": 0, "w": 6, "h": 4 }, "datasource": { "type": "grafana-postgresql-datasource", "uid": "timescaledb" }, "targets": [ { "refId": "A", "datasource": { "type": "grafana-postgresql-datasource", "uid": "timescaledb" }, "rawSql": "SELECT count(*) AS \"Alertes\" FROM alert WHERE timestamp > now() - interval '24 hours'", "format": "table", "rawQuery": true, "editorMode": "code" } ], "fieldConfig": { "defaults": { "unit": "short", "thresholds": { "mode": "absolute", "steps": [ { "color": "green", "value": null }, { "color": "orange", "value": 1 }, { "color": "red", "value": 10 } ] }, "color": { "mode": "thresholds" } }, "overrides": [] }, "options": { "reduceOptions": { "calcs": [ "lastNotNull" ], "fields": "", "values": false }, "colorMode": "background", "graphMode": "area", "textMode": "auto" } }, { "id": 4, "type": "stat", "title": "Sites en dérive", "gridPos": { "x": 18, "y": 0, "w": 6, "h": 4 }, "datasource": { "type": "grafana-postgresql-datasource", "uid": "timescaledb" }, "targets": [ { "refId": "A", "datasource": { "type": "grafana-postgresql-datasource", "uid": "timescaledb" }, "rawSql": "SELECT count(*) AS \"Sites\" FROM (SELECT DISTINCT ON (site_id) status FROM drift_report WHERE site_id IS NOT NULL ORDER BY site_id, computed_at DESC) AS derniers WHERE status = 'derive'", "format": "table", "rawQuery": true, "editorMode": "code" } ], "fieldConfig": { "defaults": { "unit": "short", "thresholds": { "mode": "absolute", "steps": [ { "color": "green", "value": null }, { "color": "red", "value": 1 } ] }, "color": { "mode": "thresholds" } }, "overrides": [] }, "options": { "reduceOptions": { "calcs": [ "lastNotNull" ], "fields": "", "values": false }, "colorMode": "background", "graphMode": "area", "textMode": "auto" }, "description": "Dernier rapport de dérive de chaque site (ADR 0013)." }, { "id": 5, "type": "table", "title": "Fraîcheur des relevés par site", "gridPos": { "x": 0, "y": 4, "w": 12, "h": 8 }, "datasource": { "type": "grafana-postgresql-datasource", "uid": "timescaledb" }, "targets": [ { "refId": "A", "datasource": { "type": "grafana-postgresql-datasource", "uid": "timescaledb" }, "rawSql": "SELECT s.site_name AS \"Site\", max(r.timestamp) AS \"Dernier relevé\", round(extract(epoch FROM now() - max(r.timestamp)) / 60) AS \"Âge (min)\"\nFROM site AS s\nLEFT JOIN reading AS r ON r.site_id = s.site_id AND r.timestamp > now() - interval '7 days'\nGROUP BY s.site_name\nORDER BY 3 DESC NULLS FIRST", "format": "table", "rawQuery": true, "editorMode": "code" } ], "fieldConfig": { "defaults": {}, "overrides": [] }, "options": { "showHeader": true }, "description": "Un site sans relevé depuis sept jours apparaît vide, en tête de liste." }, { "id": 6, "type": "table", "title": "Dérive du modèle, dernier rapport", "gridPos": { "x": 12, "y": 4, "w": 12, "h": 8 }, "datasource": { "type": "grafana-postgresql-datasource", "uid": "timescaledb" }, "targets": [ { "refId": "A", "datasource": { "type": "grafana-postgresql-datasource", "uid": "timescaledb" }, "rawSql": "SELECT DISTINCT ON (d.site_id) coalesce(s.site_name, 'Tout le parc') AS \"Site\", d.status AS \"Statut\", round(d.mae::numeric, 2) AS \"MAE\", round(d.reference_mae::numeric, 2) AS \"MAE de référence\", round(d.bias::numeric, 2) AS \"Biais\", d.computed_at AS \"Calculé le\"\nFROM drift_report AS d\nLEFT JOIN site AS s ON s.site_id = d.site_id\nORDER BY d.site_id, d.computed_at DESC", "format": "table", "rawQuery": true, "editorMode": "code" } ], "fieldConfig": { "defaults": {}, "overrides": [] }, "options": { "showHeader": true }, "description": "Une ligne par site, plus la ligne globale (ADR 0013)." }, { "id": 7, "type": "timeseries", "title": "Consommation par site", "gridPos": { "x": 0, "y": 12, "w": 12, "h": 8 }, "datasource": { "type": "grafana-postgresql-datasource", "uid": "timescaledb" }, "targets": [ { "refId": "A", "datasource": { "type": "grafana-postgresql-datasource", "uid": "timescaledb" }, "rawSql": "SELECT $__timeGroupAlias(r.timestamp, $__interval), s.site_name AS metric, avg(r.consumption_kw) AS value\nFROM reading AS r\nJOIN site AS s ON s.site_id = r.site_id\nWHERE $__timeFilter(r.timestamp)\nGROUP BY 1, 2\nORDER BY 1", "format": "time_series", "rawQuery": true, "editorMode": "code" } ], "fieldConfig": { "defaults": { "unit": "kwatt" }, "overrides": [] }, "options": { "legend": { "displayMode": "list", "placement": "bottom", "showLegend": true }, "tooltip": { "mode": "multi", "sort": "desc" } } }, { "id": 8, "type": "timeseries", "title": "Relevés ingérés par heure", "gridPos": { "x": 12, "y": 12, "w": 12, "h": 8 }, "datasource": { "type": "grafana-postgresql-datasource", "uid": "timescaledb" }, "targets": [ { "refId": "A", "datasource": { "type": "grafana-postgresql-datasource", "uid": "timescaledb" }, "rawSql": "SELECT time_bucket('1 hour', timestamp) AS time, count(*) AS \"Relevés\"\nFROM reading\nWHERE $__timeFilter(timestamp)\nGROUP BY 1\nORDER BY 1", "format": "time_series", "rawQuery": true, "editorMode": "code" } ], "fieldConfig": { "defaults": { "unit": "short" }, "overrides": [] }, "options": { "legend": { "displayMode": "list", "placement": "bottom", "showLegend": true }, "tooltip": { "mode": "multi", "sort": "desc" } } }, { "id": 9, "type": "timeseries", "title": "Alertes par sévérité", "gridPos": { "x": 0, "y": 20, "w": 12, "h": 8 }, "datasource": { "type": "grafana-postgresql-datasource", "uid": "timescaledb" }, "targets": [ { "refId": "A", "datasource": { "type": "grafana-postgresql-datasource", "uid": "timescaledb" }, "rawSql": "SELECT time_bucket('1 hour', timestamp) AS time, severity AS metric, count(*) AS value\nFROM alert\nWHERE $__timeFilter(timestamp)\nGROUP BY 1, 2\nORDER BY 1", "format": "time_series", "rawQuery": true, "editorMode": "code" } ], "fieldConfig": { "defaults": { "unit": "short" }, "overrides": [] }, "options": { "legend": { "displayMode": "list", "placement": "bottom", "showLegend": true }, "tooltip": { "mode": "multi", "sort": "desc" } } }, { "id": 10, "type": "timeseries", "title": "Erreur absolue moyenne du modèle", "gridPos": { "x": 12, "y": 20, "w": 12, "h": 8 }, "datasource": { "type": "grafana-postgresql-datasource", "uid": "timescaledb" }, "targets": [ { "refId": "A", "datasource": { "type": "grafana-postgresql-datasource", "uid": "timescaledb" }, "rawSql": "SELECT d.computed_at AS time, coalesce(s.site_name, 'Tout le parc') AS metric, d.mae AS value\nFROM drift_report AS d\nLEFT JOIN site AS s ON s.site_id = d.site_id\nWHERE $__timeFilter(d.computed_at)\nORDER BY 1", "format": "time_series", "rawQuery": true, "editorMode": "code" } ], "fieldConfig": { "defaults": { "unit": "kwatt" }, "overrides": [] }, "options": { "legend": { "displayMode": "list", "placement": "bottom", "showLegend": true }, "tooltip": { "mode": "multi", "sort": "desc" } } } ] }