From 41333967200a4555b1bdadc12588e2d86b2d29b0 Mon Sep 17 00:00:00 2001 From: Gabriel Radureau Date: Fri, 10 Jul 2026 08:47:58 +0200 Subject: [PATCH] =?UTF-8?q?feat(grafana):=20compl=C3=A8te=20le=20dashboard?= =?UTF-8?q?=20de=20monitoring=20du=20pipeline=20prospection?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Aligne le dashboard « Prospection — pipeline BI missions » sur le cahier des charges de supervision : - jauge 0–100 pour le meilleur score d'opportunité (au lieu d'une stat) - nouvelle stat « Offres du brief » (prospection_brief_offres) - bar charts « Durée par étape » et « Items par étape » sur le dernier run (prospection_step_duration_seconds / prospection_step_items) - cadence quotidienne : refresh 30m et plage par défaut now-7d Provisionné via le provider Grafana « prospection » (JSON inline dans grafana/values.yaml), datasource Prometheus (${DS_PROMETHEUS}). Co-Authored-By: Claude Opus 4.8 --- grafana/values.yaml | 56 +++++++++++++++++++++++++++++++++------------ 1 file changed, 41 insertions(+), 15 deletions(-) diff --git a/grafana/values.yaml b/grafana/values.yaml index 1c419ba..647c5dd 100644 --- a/grafana/values.yaml +++ b/grafana/values.yaml @@ -790,8 +790,8 @@ grafana: &grafana_config "tags": ["prospection", "arcodange"], "title": "Prospection — pipeline BI missions", "uid": "prospection-pipeline", - "time": { "from": "now-14d", "to": "now" }, - "refresh": "5m", + "time": { "from": "now-7d", "to": "now" }, + "refresh": "30m", "templating": { "list": [ { @@ -857,12 +857,12 @@ grafana: &grafana_config "options": { "colorMode": "value", "graphMode": "area", "reduceOptions": { "calcs": ["lastNotNull"] } } }, { - "type": "stat", "title": "Meilleur score", "id": 7, + "type": "gauge", "title": "Meilleur score", "id": 7, "gridPos": { "h": 4, "w": 3, "x": 21, "y": 1 }, "datasource": { "type": "prometheus", "uid": "${DS_PROMETHEUS}" }, "targets": [ { "refId": "A", "expr": "prospection_opportunity_top_score", "instant": true, "datasource": { "type": "prometheus", "uid": "${DS_PROMETHEUS}" } } ], "fieldConfig": { "defaults": { "min": 0, "max": 100, "thresholds": { "mode": "absolute", "steps": [ { "color": "red", "value": null }, { "color": "yellow", "value": 65 }, { "color": "green", "value": 85 } ] } }, "overrides": [] }, - "options": { "colorMode": "value", "graphMode": "none", "reduceOptions": { "calcs": ["lastNotNull"] } } + "options": { "reduceOptions": { "calcs": ["lastNotNull"] }, "showThresholdLabels": false, "showThresholdMarkers": true } }, { "type": "row", "title": "Collecte par étape", @@ -895,20 +895,38 @@ grafana: &grafana_config "options": { "showHeader": true, "sortBy": [ { "displayName": "Durée (s)", "desc": true } ] } }, { - "type": "timeseries", "title": "Items collectés par étape (historique)", "id": 10, + "type": "barchart", "title": "Durée par étape — dernier run", "id": 21, "gridPos": { "h": 9, "w": 12, "x": 12, "y": 6 }, "datasource": { "type": "prometheus", "uid": "${DS_PROMETHEUS}" }, + "targets": [ { "refId": "A", "expr": "prospection_step_duration_seconds", "instant": true, "format": "table", "datasource": { "type": "prometheus", "uid": "${DS_PROMETHEUS}" } } ], + "transformations": [ { "id": "organize", "options": { "excludeByName": { "Time": true, "__name__": true, "job": true, "instance": true }, "renameByName": { "step": "Étape", "Value": "Durée (s)" } } } ], + "fieldConfig": { "defaults": { "unit": "s", "color": { "mode": "continuous-GrYlRd" }, "custom": { "lineWidth": 1, "fillOpacity": 80 } }, "overrides": [] }, + "options": { "orientation": "horizontal", "xField": "Étape", "showValue": "auto", "legend": { "showLegend": false }, "tooltip": { "mode": "single", "sort": "none" } } + }, + { + "type": "barchart", "title": "Items par étape — dernier run", "id": 22, + "gridPos": { "h": 8, "w": 12, "x": 0, "y": 15 }, + "datasource": { "type": "prometheus", "uid": "${DS_PROMETHEUS}" }, + "targets": [ { "refId": "A", "expr": "prospection_step_items", "instant": true, "format": "table", "datasource": { "type": "prometheus", "uid": "${DS_PROMETHEUS}" } } ], + "transformations": [ { "id": "organize", "options": { "excludeByName": { "Time": true, "__name__": true, "job": true, "instance": true }, "renameByName": { "step": "Étape", "Value": "Items" } } } ], + "fieldConfig": { "defaults": { "unit": "short", "color": { "mode": "continuous-BlPu" }, "custom": { "lineWidth": 1, "fillOpacity": 80 } }, "overrides": [] }, + "options": { "orientation": "horizontal", "xField": "Étape", "showValue": "auto", "legend": { "showLegend": false }, "tooltip": { "mode": "single", "sort": "none" } } + }, + { + "type": "timeseries", "title": "Items collectés par étape (historique)", "id": 10, + "gridPos": { "h": 8, "w": 12, "x": 12, "y": 15 }, + "datasource": { "type": "prometheus", "uid": "${DS_PROMETHEUS}" }, "targets": [ { "refId": "A", "expr": "prospection_step_items > 0", "legendFormat": "{{step}}", "datasource": { "type": "prometheus", "uid": "${DS_PROMETHEUS}" } } ], "fieldConfig": { "defaults": { "custom": { "drawStyle": "bars", "fillOpacity": 40, "stacking": { "mode": "none" }, "lineWidth": 1 } }, "overrides": [] }, "options": { "legend": { "displayMode": "table", "placement": "right", "calcs": ["lastNotNull"] }, "tooltip": { "mode": "multi", "sort": "desc" } } }, { "type": "row", "title": "Modèle de données & scoring", - "gridPos": { "h": 1, "w": 24, "x": 0, "y": 15 }, "id": 11, "collapsed": false + "gridPos": { "h": 1, "w": 24, "x": 0, "y": 23 }, "id": 11, "collapsed": false }, { "type": "timeseries", "title": "Opportunités — missions A / cibles B", "id": 12, - "gridPos": { "h": 8, "w": 12, "x": 0, "y": 16 }, + "gridPos": { "h": 8, "w": 12, "x": 0, "y": 24 }, "datasource": { "type": "prometheus", "uid": "${DS_PROMETHEUS}" }, "targets": [ { "refId": "A", "expr": "prospection_opportunities_total{kind=\"A\"}", "legendFormat": "Missions A", "datasource": { "type": "prometheus", "uid": "${DS_PROMETHEUS}" } }, @@ -919,7 +937,7 @@ grafana: &grafana_config }, { "type": "timeseries", "title": "Offres & entités collectées (historique)", "id": 13, - "gridPos": { "h": 8, "w": 8, "x": 12, "y": 16 }, + "gridPos": { "h": 8, "w": 8, "x": 12, "y": 24 }, "datasource": { "type": "prometheus", "uid": "${DS_PROMETHEUS}" }, "targets": [ { "refId": "A", "expr": "prospection_offers_total", "legendFormat": "Offres (missions)", "datasource": { "type": "prometheus", "uid": "${DS_PROMETHEUS}" } }, @@ -931,7 +949,7 @@ grafana: &grafana_config }, { "type": "bargauge", "title": "Modèle — dernier run", "id": 14, - "gridPos": { "h": 8, "w": 4, "x": 20, "y": 16 }, + "gridPos": { "h": 8, "w": 4, "x": 20, "y": 24 }, "datasource": { "type": "prometheus", "uid": "${DS_PROMETHEUS}" }, "targets": [ { "refId": "A", "expr": "prospection_signals_total", "legendFormat": "Signaux", "instant": true, "datasource": { "type": "prometheus", "uid": "${DS_PROMETHEUS}" } }, @@ -944,11 +962,11 @@ grafana: &grafana_config }, { "type": "row", "title": "Livraison & alertes", - "gridPos": { "h": 1, "w": 24, "x": 0, "y": 24 }, "id": 15, "collapsed": false + "gridPos": { "h": 1, "w": 24, "x": 0, "y": 32 }, "id": 15, "collapsed": false }, { "type": "stat", "title": "Brief rendu", "id": 16, - "gridPos": { "h": 5, "w": 4, "x": 0, "y": 25 }, + "gridPos": { "h": 5, "w": 3, "x": 0, "y": 33 }, "datasource": { "type": "prometheus", "uid": "${DS_PROMETHEUS}" }, "targets": [ { "refId": "A", "expr": "prospection_brief_rendered", "instant": true, "datasource": { "type": "prometheus", "uid": "${DS_PROMETHEUS}" } } ], "fieldConfig": { "defaults": { "mappings": [ { "type": "value", "options": { "0": { "text": "non", "color": "red", "index": 0 }, "1": { "text": "oui", "color": "green", "index": 1 } } } ], "thresholds": { "mode": "absolute", "steps": [ { "color": "red", "value": null }, { "color": "green", "value": 1 } ] } }, "overrides": [] }, @@ -956,7 +974,7 @@ grafana: &grafana_config }, { "type": "stat", "title": "Poussé sur Telegram", "id": 17, - "gridPos": { "h": 5, "w": 4, "x": 4, "y": 25 }, + "gridPos": { "h": 5, "w": 4, "x": 3, "y": 33 }, "datasource": { "type": "prometheus", "uid": "${DS_PROMETHEUS}" }, "targets": [ { "refId": "A", "expr": "prospection_brief_telegram_pushed", "instant": true, "datasource": { "type": "prometheus", "uid": "${DS_PROMETHEUS}" } } ], "fieldConfig": { "defaults": { "mappings": [ { "type": "value", "options": { "0": { "text": "non", "color": "red", "index": 0 }, "1": { "text": "oui", "color": "green", "index": 1 } } } ], "thresholds": { "mode": "absolute", "steps": [ { "color": "red", "value": null }, { "color": "green", "value": 1 } ] } }, "overrides": [] }, @@ -964,15 +982,23 @@ grafana: &grafana_config }, { "type": "stat", "title": "Messages / mission", "id": 18, - "gridPos": { "h": 5, "w": 4, "x": 8, "y": 25 }, + "gridPos": { "h": 5, "w": 3, "x": 7, "y": 33 }, "datasource": { "type": "prometheus", "uid": "${DS_PROMETHEUS}" }, "targets": [ { "refId": "A", "expr": "prospection_telegram_messages_sent", "instant": true, "datasource": { "type": "prometheus", "uid": "${DS_PROMETHEUS}" } } ], "fieldConfig": { "defaults": { "thresholds": { "mode": "absolute", "steps": [ { "color": "blue", "value": null } ] } }, "overrides": [] }, "options": { "colorMode": "value", "graphMode": "area", "reduceOptions": { "calcs": ["lastNotNull"] } } }, + { + "type": "stat", "title": "Offres du brief", "id": 23, + "gridPos": { "h": 5, "w": 3, "x": 10, "y": 33 }, + "datasource": { "type": "prometheus", "uid": "${DS_PROMETHEUS}" }, + "targets": [ { "refId": "A", "expr": "prospection_brief_offres", "instant": true, "datasource": { "type": "prometheus", "uid": "${DS_PROMETHEUS}" } } ], + "fieldConfig": { "defaults": { "thresholds": { "mode": "absolute", "steps": [ { "color": "red", "value": null }, { "color": "green", "value": 1 } ] } }, "overrides": [] }, + "options": { "colorMode": "value", "graphMode": "none", "reduceOptions": { "calcs": ["lastNotNull"] } } + }, { "type": "stat", "title": "Vidéo brief", "id": 19, - "gridPos": { "h": 5, "w": 4, "x": 12, "y": 25 }, + "gridPos": { "h": 5, "w": 3, "x": 13, "y": 33 }, "datasource": { "type": "prometheus", "uid": "${DS_PROMETHEUS}" }, "targets": [ { "refId": "A", "expr": "prospection_brief_video_kb * 1024", "instant": true, "datasource": { "type": "prometheus", "uid": "${DS_PROMETHEUS}" } } ], "fieldConfig": { "defaults": { "unit": "bytes", "thresholds": { "mode": "absolute", "steps": [ { "color": "blue", "value": null } ] } }, "overrides": [] }, @@ -980,7 +1006,7 @@ grafana: &grafana_config }, { "type": "table", "title": "Alertes prospection actives", "id": 20, - "gridPos": { "h": 5, "w": 8, "x": 16, "y": 25 }, + "gridPos": { "h": 5, "w": 8, "x": 16, "y": 33 }, "datasource": { "type": "prometheus", "uid": "${DS_PROMETHEUS}" }, "targets": [ { "refId": "A", "expr": "ALERTS{alertname=~\"Prospection.*\", alertstate=\"firing\"}", "instant": true, "format": "table", "datasource": { "type": "prometheus", "uid": "${DS_PROMETHEUS}" } } ], "transformations": [