feat: Organisation du monitoring par module
- Création de la structure grafana/ par module et projet - Dashboards spécifiques pour Bitcoin, SDK Storage, SDK Signer, LeCoffre - Configuration des providers Grafana par module - Documentation complète du monitoring par module - Ajout de la surveillance 4NK IA Back API dans Prometheus - Organisation des dashboards en dossiers spécialisés - Mise à jour de la documentation monitoring principale Structure ajoutée: - modules/*/grafana/dashboards/ (dashboards par module) - modules/*/grafana/conf/ (configuration spécifique) - projects/*/grafana/dashboards/ (dashboards par projet) - docs/MONITORING_MODULES.md (guide détaillé) Dashboards créés: - Bitcoin Node Monitoring - SDK Storage Monitoring - SDK Signer Monitoring - LeCoffre Frontend Monitoring
This commit is contained in:
parent
f7e110446b
commit
84f1e838b7
14
CHANGELOG.md
14
CHANGELOG.md
@ -1,6 +1,20 @@
|
|||||||
## Changed (2025-09-11)
|
## Changed (2025-09-11)
|
||||||
# Changelog - 4NK Node
|
# Changelog - 4NK Node
|
||||||
|
|
||||||
|
## [1.1.4-wip.3] - 2025-09-11
|
||||||
|
|
||||||
|
### Added
|
||||||
|
- **Structure monitoring par module** : Organisation des dashboards par module
|
||||||
|
- **Dashboards spécifiques** : Dashboards dédiés pour Bitcoin, SDK Storage, SDK Signer, LeCoffre
|
||||||
|
- **Documentation modules** : Guide détaillé dans `docs/MONITORING_MODULES.md`
|
||||||
|
- **Configuration Prometheus** : Ajout de la surveillance 4NK IA Back API
|
||||||
|
- **Organisation Grafana** : Dossiers spécialisés par module dans Grafana Central
|
||||||
|
|
||||||
|
### Changed
|
||||||
|
- **Configuration dashboards** : Réorganisation des providers Grafana par module
|
||||||
|
- **Volumes Grafana** : Ajout du montage des dashboards par module
|
||||||
|
- **Documentation** : Mise à jour de la documentation monitoring principale
|
||||||
|
|
||||||
## [1.1.4-wip.2] - 2025-09-11
|
## [1.1.4-wip.2] - 2025-09-11
|
||||||
|
|
||||||
### Added
|
### Added
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
# dnsmasq config for 4NK - listens on 127.0.0.1:5353
|
# dnsmasq config for 4NK - listens on all interfaces:5353
|
||||||
no-dhcp-interface=
|
no-dhcp-interface=
|
||||||
port=5353
|
port=5353
|
||||||
interface=lo
|
interface=*
|
||||||
bind-interfaces
|
bind-interfaces
|
||||||
log-queries
|
log-queries
|
||||||
|
|
||||||
@ -17,3 +17,7 @@ address=/sdk-signer.local/172.20.0.17
|
|||||||
address=/ihm-client.local/172.20.0.18
|
address=/ihm-client.local/172.20.0.18
|
||||||
address=/coffre-front.local/172.20.0.32
|
address=/coffre-front.local/172.20.0.32
|
||||||
address=/coffre-back-mini.local/172.20.0.33
|
address=/coffre-back-mini.local/172.20.0.33
|
||||||
|
address=/grafana-central.local/172.20.0.50
|
||||||
|
address=/loki.local/172.20.0.51
|
||||||
|
address=/prometheus.local/172.20.0.52
|
||||||
|
address=/promtail.local/172.20.0.53
|
||||||
|
@ -348,6 +348,7 @@ services:
|
|||||||
- grafana_central_data:/var/lib/grafana
|
- grafana_central_data:/var/lib/grafana
|
||||||
- ./modules/grafana-central/conf/grafana.ini:/etc/grafana/grafana.ini:ro
|
- ./modules/grafana-central/conf/grafana.ini:/etc/grafana/grafana.ini:ro
|
||||||
- ./modules/grafana-central/conf/datasources.yml:/etc/grafana/provisioning/datasources/datasources.yml:ro
|
- ./modules/grafana-central/conf/datasources.yml:/etc/grafana/provisioning/datasources/datasources.yml:ro
|
||||||
|
- ./modules/grafana-central/dashboards:/etc/grafana/provisioning/dashboards:ro
|
||||||
- ./modules/grafana-central/logs:/var/log/grafana
|
- ./modules/grafana-central/logs:/var/log/grafana
|
||||||
networks:
|
networks:
|
||||||
4nk_network:
|
4nk_network:
|
||||||
|
@ -66,19 +66,32 @@ Prometheus surveille les métriques de :
|
|||||||
|
|
||||||
## Dashboards
|
## Dashboards
|
||||||
|
|
||||||
### Dashboards 4NK
|
### Organisation par module
|
||||||
- **4NK Overview** : Vue d'ensemble des services
|
|
||||||
- **Bitcoin Monitoring** : Surveillance du nœud Bitcoin
|
|
||||||
- **SDK Services** : Métriques des services SDK
|
|
||||||
|
|
||||||
### Dashboards Infrastructure
|
Le système de monitoring est organisé par module avec des dashboards spécifiques :
|
||||||
|
|
||||||
|
#### Dashboards 4NK Global
|
||||||
|
- **4NK Overview** : Vue d'ensemble des services
|
||||||
|
- **4NK System Health** : Santé générale du système
|
||||||
|
|
||||||
|
#### Dashboards par Module
|
||||||
|
- **Bitcoin Module** : Monitoring spécifique au nœud Bitcoin
|
||||||
|
- **SDK Storage Module** : Surveillance du service de stockage SDK
|
||||||
|
- **SDK Signer Module** : Surveillance du service de signature SDK
|
||||||
|
- **SDK Relay Modules** : Monitoring des relais SDK
|
||||||
|
- **IHM Client Module** : Surveillance de l'interface client
|
||||||
|
- **LeCoffre Frontend** : Monitoring de l'interface LeCoffre
|
||||||
|
|
||||||
|
#### Dashboards Infrastructure
|
||||||
- **System Overview** : Vue d'ensemble du système
|
- **System Overview** : Vue d'ensemble du système
|
||||||
- **Docker Containers** : Surveillance des conteneurs
|
- **Docker Containers** : Surveillance des conteneurs
|
||||||
|
|
||||||
### Dashboards System
|
#### Dashboards System
|
||||||
- **Node Metrics** : Métriques du serveur
|
- **Node Metrics** : Métriques du serveur
|
||||||
- **Network Monitoring** : Surveillance réseau
|
- **Network Monitoring** : Surveillance réseau
|
||||||
|
|
||||||
|
> **Note** : Chaque module dispose de sa propre structure de dashboards dans `modules/[module]/grafana/dashboards/`. Voir `docs/MONITORING_MODULES.md` pour plus de détails.
|
||||||
|
|
||||||
## Utilisation
|
## Utilisation
|
||||||
|
|
||||||
### Accès aux services
|
### Accès aux services
|
||||||
|
252
docs/MONITORING_MODULES.md
Normal file
252
docs/MONITORING_MODULES.md
Normal file
@ -0,0 +1,252 @@
|
|||||||
|
# Monitoring par Module - 4NK Node
|
||||||
|
|
||||||
|
## Vue d'ensemble
|
||||||
|
|
||||||
|
Chaque module et projet dispose maintenant de sa propre structure de monitoring avec des dashboards spécifiques organisés dans Grafana Central.
|
||||||
|
|
||||||
|
## Structure des dossiers
|
||||||
|
|
||||||
|
### Modules avec monitoring dédié
|
||||||
|
|
||||||
|
```
|
||||||
|
modules/
|
||||||
|
├── bitcoin/
|
||||||
|
│ └── grafana/
|
||||||
|
│ ├── dashboards/
|
||||||
|
│ │ └── bitcoin-monitoring.json
|
||||||
|
│ └── conf/
|
||||||
|
│ └── (configuration spécifique si nécessaire)
|
||||||
|
├── sdk_storage/
|
||||||
|
│ └── grafana/
|
||||||
|
│ ├── dashboards/
|
||||||
|
│ │ └── sdk-storage-monitoring.json
|
||||||
|
│ └── conf/
|
||||||
|
├── sdk_signer/
|
||||||
|
│ └── grafana/
|
||||||
|
│ ├── dashboards/
|
||||||
|
│ │ └── sdk-signer-monitoring.json
|
||||||
|
│ └── conf/
|
||||||
|
├── sdk_relay1/
|
||||||
|
│ └── grafana/
|
||||||
|
│ ├── dashboards/
|
||||||
|
│ └── conf/
|
||||||
|
├── sdk_relay2/
|
||||||
|
│ └── grafana/
|
||||||
|
│ ├── dashboards/
|
||||||
|
│ └── conf/
|
||||||
|
├── sdk_relay3/
|
||||||
|
│ └── grafana/
|
||||||
|
│ ├── dashboards/
|
||||||
|
│ └── conf/
|
||||||
|
├── ihm_client/
|
||||||
|
│ └── grafana/
|
||||||
|
│ ├── dashboards/
|
||||||
|
│ └── conf/
|
||||||
|
├── tor/
|
||||||
|
│ └── grafana/
|
||||||
|
│ ├── dashboards/
|
||||||
|
│ └── conf/
|
||||||
|
└── blindbit-oracle/
|
||||||
|
└── grafana/
|
||||||
|
├── dashboards/
|
||||||
|
└── conf/
|
||||||
|
```
|
||||||
|
|
||||||
|
### Projets avec monitoring dédié
|
||||||
|
|
||||||
|
```
|
||||||
|
projects/
|
||||||
|
└── lecoffre/
|
||||||
|
├── lecoffre-front/
|
||||||
|
│ └── grafana/
|
||||||
|
│ ├── dashboards/
|
||||||
|
│ │ └── lecoffre-front-monitoring.json
|
||||||
|
│ └── conf/
|
||||||
|
└── lecoffre-back/
|
||||||
|
└── grafana/
|
||||||
|
├── dashboards/
|
||||||
|
└── conf/
|
||||||
|
```
|
||||||
|
|
||||||
|
## Organisation dans Grafana Central
|
||||||
|
|
||||||
|
### Dossiers de dashboards
|
||||||
|
|
||||||
|
- **4NK Global** : Dashboards généraux du système
|
||||||
|
- **Bitcoin Module** : Monitoring spécifique au nœud Bitcoin
|
||||||
|
- **SDK Storage Module** : Monitoring du service de stockage SDK
|
||||||
|
- **SDK Signer Module** : Monitoring du service de signature SDK
|
||||||
|
- **LeCoffre Frontend** : Monitoring de l'interface LeCoffre
|
||||||
|
- **Infrastructure** : Dashboards d'infrastructure
|
||||||
|
- **System** : Dashboards système
|
||||||
|
|
||||||
|
### Dashboards disponibles
|
||||||
|
|
||||||
|
#### Bitcoin Module
|
||||||
|
- **Bitcoin Node Monitoring** : Statut et logs du nœud Bitcoin
|
||||||
|
- Statut du service (up/down)
|
||||||
|
- Logs en temps réel
|
||||||
|
- Métriques de performance
|
||||||
|
|
||||||
|
#### SDK Storage Module
|
||||||
|
- **SDK Storage Monitoring** : Surveillance du service de stockage
|
||||||
|
- Statut du service
|
||||||
|
- Logs d'opérations
|
||||||
|
- Métriques de stockage
|
||||||
|
|
||||||
|
#### SDK Signer Module
|
||||||
|
- **SDK Signer Monitoring** : Surveillance du service de signature
|
||||||
|
- Statut du service
|
||||||
|
- Logs de signatures
|
||||||
|
- Métriques de performance
|
||||||
|
|
||||||
|
#### LeCoffre Frontend
|
||||||
|
- **LeCoffre Frontend Monitoring** : Surveillance de l'interface
|
||||||
|
- Statut du service
|
||||||
|
- Logs d'interface
|
||||||
|
- Métriques utilisateur
|
||||||
|
|
||||||
|
## Configuration
|
||||||
|
|
||||||
|
### Ajout d'un nouveau dashboard pour un module
|
||||||
|
|
||||||
|
1. **Créer le dashboard** :
|
||||||
|
```bash
|
||||||
|
# Créer le dossier si nécessaire
|
||||||
|
mkdir -p modules/[module-name]/grafana/dashboards/
|
||||||
|
|
||||||
|
# Créer le fichier JSON du dashboard
|
||||||
|
touch modules/[module-name]/grafana/dashboards/[module-name]-monitoring.json
|
||||||
|
```
|
||||||
|
|
||||||
|
2. **Ajouter la configuration dans Grafana Central** :
|
||||||
|
- Modifier `modules/grafana-central/conf/dashboards.yml`
|
||||||
|
- Ajouter un nouveau provider pour le module
|
||||||
|
|
||||||
|
3. **Copier le dashboard vers Grafana Central** :
|
||||||
|
```bash
|
||||||
|
# Créer le dossier de destination
|
||||||
|
mkdir -p modules/grafana-central/dashboards/[module-name]/
|
||||||
|
|
||||||
|
# Copier le dashboard
|
||||||
|
cp modules/[module-name]/grafana/dashboards/[module-name]-monitoring.json \
|
||||||
|
modules/grafana-central/dashboards/[module-name]/
|
||||||
|
```
|
||||||
|
|
||||||
|
4. **Redémarrer Grafana Central** :
|
||||||
|
```bash
|
||||||
|
docker-compose restart grafana-central.local
|
||||||
|
```
|
||||||
|
|
||||||
|
### Structure d'un dashboard JSON
|
||||||
|
|
||||||
|
```json
|
||||||
|
{
|
||||||
|
"dashboard": {
|
||||||
|
"id": null,
|
||||||
|
"title": "Module Name Monitoring",
|
||||||
|
"tags": ["4nk", "module-type", "specific-tag"],
|
||||||
|
"style": "dark",
|
||||||
|
"timezone": "browser",
|
||||||
|
"panels": [
|
||||||
|
{
|
||||||
|
"id": 1,
|
||||||
|
"title": "Service Status",
|
||||||
|
"type": "stat",
|
||||||
|
"targets": [
|
||||||
|
{
|
||||||
|
"expr": "up{job=\"4nk-module-name\"}",
|
||||||
|
"legendFormat": "Module Name"
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"fieldConfig": {
|
||||||
|
"defaults": {
|
||||||
|
"color": {
|
||||||
|
"mode": "thresholds"
|
||||||
|
},
|
||||||
|
"thresholds": {
|
||||||
|
"steps": [
|
||||||
|
{
|
||||||
|
"color": "red",
|
||||||
|
"value": 0
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"color": "green",
|
||||||
|
"value": 1
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"time": {
|
||||||
|
"from": "now-1h",
|
||||||
|
"to": "now"
|
||||||
|
},
|
||||||
|
"refresh": "30s"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
||||||
|
## Maintenance
|
||||||
|
|
||||||
|
### Mise à jour des dashboards
|
||||||
|
|
||||||
|
1. **Modifier le dashboard local** dans `modules/[module]/grafana/dashboards/`
|
||||||
|
2. **Copier vers Grafana Central** :
|
||||||
|
```bash
|
||||||
|
cp modules/[module]/grafana/dashboards/[dashboard].json \
|
||||||
|
modules/grafana-central/dashboards/[module]/
|
||||||
|
```
|
||||||
|
3. **Redémarrer Grafana Central** :
|
||||||
|
```bash
|
||||||
|
docker-compose restart grafana-central.local
|
||||||
|
```
|
||||||
|
|
||||||
|
### Sauvegarde des dashboards
|
||||||
|
|
||||||
|
```bash
|
||||||
|
# Sauvegarde de tous les dashboards
|
||||||
|
tar -czf dashboards-backup-$(date +%Y%m%d).tar.gz \
|
||||||
|
modules/*/grafana/dashboards/ \
|
||||||
|
projects/*/grafana/dashboards/ \
|
||||||
|
modules/grafana-central/dashboards/
|
||||||
|
```
|
||||||
|
|
||||||
|
### Restauration des dashboards
|
||||||
|
|
||||||
|
```bash
|
||||||
|
# Restauration
|
||||||
|
tar -xzf dashboards-backup-YYYYMMDD.tar.gz
|
||||||
|
docker-compose restart grafana-central.local
|
||||||
|
```
|
||||||
|
|
||||||
|
## Bonnes pratiques
|
||||||
|
|
||||||
|
### Naming convention
|
||||||
|
- **Dashboards** : `[module-name]-monitoring.json`
|
||||||
|
- **Tags** : Toujours inclure `4nk` comme premier tag
|
||||||
|
- **Titres** : Format "Module Name Monitoring"
|
||||||
|
|
||||||
|
### Organisation des panels
|
||||||
|
- **Panel 1** : Statut du service (stat)
|
||||||
|
- **Panel 2** : Logs du service (logs)
|
||||||
|
- **Panel 3+** : Métriques spécifiques selon le module
|
||||||
|
|
||||||
|
### Configuration des seuils
|
||||||
|
- **Vert** : Service opérationnel (value: 1)
|
||||||
|
- **Rouge** : Service arrêté (value: 0)
|
||||||
|
|
||||||
|
### Refresh rate
|
||||||
|
- **Dashboards critiques** : 10s
|
||||||
|
- **Dashboards standards** : 30s
|
||||||
|
- **Dashboards de debug** : 60s
|
||||||
|
|
||||||
|
## Évolutions futures
|
||||||
|
|
||||||
|
- **Dashboards automatiques** : Génération automatique depuis les métriques
|
||||||
|
- **Alertes par module** : Configuration d'alertes spécifiques
|
||||||
|
- **Templates** : Templates de dashboards réutilisables
|
||||||
|
- **Intégration CI/CD** : Déploiement automatique des dashboards
|
||||||
|
- **Multi-tenant** : Séparation des dashboards par environnement
|
@ -1 +1 @@
|
|||||||
MANIFEST-000907
|
MANIFEST-001015
|
||||||
|
@ -1,3 +1,3 @@
|
|||||||
2025/09/11-10:08:06.375380 7f8065a7cb38 Recovering log #906
|
2025/09/11-10:35:43.629258 7f394612cb38 Recovering log #1014
|
||||||
2025/09/11-10:08:06.391400 7f8065a7cb38 Delete type=0 #906
|
2025/09/11-10:35:43.644875 7f394612cb38 Delete type=3 #1013
|
||||||
2025/09/11-10:08:06.391444 7f8065a7cb38 Delete type=3 #905
|
2025/09/11-10:35:43.644933 7f394612cb38 Delete type=0 #1014
|
||||||
|
@ -1,3 +1,3 @@
|
|||||||
2025/09/11-10:07:35.336676 7f4fb108cb38 Recovering log #904
|
2025/09/11-10:35:34.529941 7f1bad92cb38 Recovering log #1012
|
||||||
2025/09/11-10:07:35.363529 7f4fb108cb38 Delete type=3 #903
|
2025/09/11-10:35:34.547700 7f1bad92cb38 Delete type=0 #1012
|
||||||
2025/09/11-10:07:35.363589 7f4fb108cb38 Delete type=0 #904
|
2025/09/11-10:35:34.547771 7f1bad92cb38 Delete type=3 #1011
|
||||||
|
Binary file not shown.
Loading…
x
Reference in New Issue
Block a user