align for IA agents + grafana
This commit is contained in:
parent
b1a3ba5fa7
commit
a4db525885
@ -3,10 +3,14 @@
|
|||||||
Le site est sur @https://dev4.4nkweb.com/lecoffre (`lecoffre_front`).
|
Le site est sur @https://dev4.4nkweb.com/lecoffre (`lecoffre_front`).
|
||||||
Il sera redirigé au login des notaires vers un site qui redirige vers local.4nkdev.com qui sera redirigé vers @https://dev4.4nkweb.com/lecoffre avec l'ouverture de l'iframe @https://dev4.4nkweb.com/ (`ihm_client`).
|
Il sera redirigé au login des notaires vers un site qui redirige vers local.4nkdev.com qui sera redirigé vers @https://dev4.4nkweb.com/lecoffre avec l'ouverture de l'iframe @https://dev4.4nkweb.com/ (`ihm_client`).
|
||||||
|
|
||||||
Fonctionnellement, le test pour moi est sur navigateur de
|
Fonctionnellement, le test est sur navigateur de :
|
||||||
* tenter un login () notaire dont la redirection IdNot (redirections et API notaires) et valider dans l'iframe et d'arriver connecté apres la vérification du compte Stripe (lecoffre-back-mini).
|
* tenter un login () notaire dont la redirection IdNot (redirections et API notaires) et valider dans l'iframe et d'arriver connecté apres la vérification du compte Stripe (lecoffre-back-mini).
|
||||||
* créer un compte dossier en tant que notaire en ajoutant un client ce qui enverra un lien par mail par mailshimp puis en tant que client me connecté avec le lien recçu par mail, confirmer le code sms (api ovh) et accéder à mon dossier.
|
* créer un compte dossier en tant que notaire en ajoutant un client ce qui enverra un lien par mail par mailshimp puis en tant que client me connecté avec le lien recçu par mail, confirmer le code sms (api ovh) et accéder à mon dossier.
|
||||||
|
|
||||||
|
Tehcniquement, le test est sur navigateur de :
|
||||||
|
* Vérifier la page de statut des services : @https://dev4.4nkweb.com/status/
|
||||||
|
* Vérifier les dashboard grafana @https://dev4.4nkweb.com/grafana/
|
||||||
|
|
||||||
---
|
---
|
||||||
|
|
||||||
## Dépendances
|
## Dépendances
|
||||||
|
531
conf/grafana/dashboards/bitcoin-services.json
Normal file
531
conf/grafana/dashboards/bitcoin-services.json
Normal file
@ -0,0 +1,531 @@
|
|||||||
|
{
|
||||||
|
"annotations": {
|
||||||
|
"list": []
|
||||||
|
},
|
||||||
|
"editable": true,
|
||||||
|
"fiscalYearStartMonth": 0,
|
||||||
|
"graphTooltip": 0,
|
||||||
|
"id": null,
|
||||||
|
"links": [],
|
||||||
|
"liveNow": false,
|
||||||
|
"panels": [
|
||||||
|
{
|
||||||
|
"datasource": {
|
||||||
|
"type": "loki",
|
||||||
|
"uid": "loki"
|
||||||
|
},
|
||||||
|
"fieldConfig": {
|
||||||
|
"defaults": {
|
||||||
|
"color": {
|
||||||
|
"mode": "palette-classic"
|
||||||
|
},
|
||||||
|
"custom": {
|
||||||
|
"axisLabel": "",
|
||||||
|
"axisPlacement": "auto",
|
||||||
|
"barAlignment": 0,
|
||||||
|
"drawStyle": "line",
|
||||||
|
"fillOpacity": 10,
|
||||||
|
"gradientMode": "none",
|
||||||
|
"hideFrom": {
|
||||||
|
"legend": false,
|
||||||
|
"tooltip": false,
|
||||||
|
"vis": 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
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"color": "red",
|
||||||
|
"value": 80
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"overrides": []
|
||||||
|
},
|
||||||
|
"gridPos": {
|
||||||
|
"h": 8,
|
||||||
|
"w": 12,
|
||||||
|
"x": 0,
|
||||||
|
"y": 0
|
||||||
|
},
|
||||||
|
"id": 1,
|
||||||
|
"options": {
|
||||||
|
"legend": {
|
||||||
|
"calcs": [],
|
||||||
|
"displayMode": "list",
|
||||||
|
"placement": "bottom"
|
||||||
|
},
|
||||||
|
"tooltip": {
|
||||||
|
"mode": "single"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"targets": [
|
||||||
|
{
|
||||||
|
"datasource": {
|
||||||
|
"type": "loki",
|
||||||
|
"uid": "loki"
|
||||||
|
},
|
||||||
|
"editorMode": "code",
|
||||||
|
"expr": "sum(rate({container=\"bitcoin-signet\"} |= \"UpdateTip\" [5m])) by (container)",
|
||||||
|
"queryType": "",
|
||||||
|
"refId": "A"
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"title": "Mises à Jour de la Chaîne Bitcoin",
|
||||||
|
"type": "timeseries"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"datasource": {
|
||||||
|
"type": "loki",
|
||||||
|
"uid": "loki"
|
||||||
|
},
|
||||||
|
"fieldConfig": {
|
||||||
|
"defaults": {
|
||||||
|
"color": {
|
||||||
|
"mode": "palette-classic"
|
||||||
|
},
|
||||||
|
"custom": {
|
||||||
|
"axisLabel": "",
|
||||||
|
"axisPlacement": "auto",
|
||||||
|
"barAlignment": 0,
|
||||||
|
"drawStyle": "line",
|
||||||
|
"fillOpacity": 10,
|
||||||
|
"gradientMode": "none",
|
||||||
|
"hideFrom": {
|
||||||
|
"legend": false,
|
||||||
|
"tooltip": false,
|
||||||
|
"vis": 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
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"color": "red",
|
||||||
|
"value": 80
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"overrides": []
|
||||||
|
},
|
||||||
|
"gridPos": {
|
||||||
|
"h": 8,
|
||||||
|
"w": 12,
|
||||||
|
"x": 12,
|
||||||
|
"y": 0
|
||||||
|
},
|
||||||
|
"id": 2,
|
||||||
|
"options": {
|
||||||
|
"legend": {
|
||||||
|
"calcs": [],
|
||||||
|
"displayMode": "list",
|
||||||
|
"placement": "bottom"
|
||||||
|
},
|
||||||
|
"tooltip": {
|
||||||
|
"mode": "single"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"targets": [
|
||||||
|
{
|
||||||
|
"datasource": {
|
||||||
|
"type": "loki",
|
||||||
|
"uid": "loki"
|
||||||
|
},
|
||||||
|
"editorMode": "code",
|
||||||
|
"expr": "sum(rate({container=\"blindbit-oracle\"} |= \"tweak\" [5m])) by (container)",
|
||||||
|
"queryType": "",
|
||||||
|
"refId": "A"
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"title": "Détection de Tweak (BlindBit)",
|
||||||
|
"type": "timeseries"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"datasource": {
|
||||||
|
"type": "loki",
|
||||||
|
"uid": "loki"
|
||||||
|
},
|
||||||
|
"fieldConfig": {
|
||||||
|
"defaults": {
|
||||||
|
"color": {
|
||||||
|
"mode": "thresholds"
|
||||||
|
},
|
||||||
|
"mappings": [],
|
||||||
|
"thresholds": {
|
||||||
|
"mode": "absolute",
|
||||||
|
"steps": [
|
||||||
|
{
|
||||||
|
"color": "green",
|
||||||
|
"value": null
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"color": "red",
|
||||||
|
"value": 80
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"overrides": []
|
||||||
|
},
|
||||||
|
"gridPos": {
|
||||||
|
"h": 4,
|
||||||
|
"w": 6,
|
||||||
|
"x": 0,
|
||||||
|
"y": 8
|
||||||
|
},
|
||||||
|
"id": 3,
|
||||||
|
"options": {
|
||||||
|
"colorMode": "value",
|
||||||
|
"graphMode": "area",
|
||||||
|
"justifyMode": "auto",
|
||||||
|
"orientation": "auto",
|
||||||
|
"reduceOptions": {
|
||||||
|
"calcs": [
|
||||||
|
"lastNotNull"
|
||||||
|
],
|
||||||
|
"fields": "",
|
||||||
|
"values": false
|
||||||
|
},
|
||||||
|
"textMode": "auto"
|
||||||
|
},
|
||||||
|
"pluginVersion": "10.0.0",
|
||||||
|
"targets": [
|
||||||
|
{
|
||||||
|
"datasource": {
|
||||||
|
"type": "loki",
|
||||||
|
"uid": "loki"
|
||||||
|
},
|
||||||
|
"editorMode": "code",
|
||||||
|
"expr": "count_over_time({container=\"bitcoin-signet\"} |= \"ERROR\" [1h])",
|
||||||
|
"queryType": "",
|
||||||
|
"refId": "A"
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"title": "Erreurs Bitcoin (1h)",
|
||||||
|
"type": "stat"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"datasource": {
|
||||||
|
"type": "loki",
|
||||||
|
"uid": "loki"
|
||||||
|
},
|
||||||
|
"fieldConfig": {
|
||||||
|
"defaults": {
|
||||||
|
"color": {
|
||||||
|
"mode": "thresholds"
|
||||||
|
},
|
||||||
|
"mappings": [],
|
||||||
|
"thresholds": {
|
||||||
|
"mode": "absolute",
|
||||||
|
"steps": [
|
||||||
|
{
|
||||||
|
"color": "green",
|
||||||
|
"value": null
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"color": "red",
|
||||||
|
"value": 80
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"overrides": []
|
||||||
|
},
|
||||||
|
"gridPos": {
|
||||||
|
"h": 4,
|
||||||
|
"w": 6,
|
||||||
|
"x": 6,
|
||||||
|
"y": 8
|
||||||
|
},
|
||||||
|
"id": 4,
|
||||||
|
"options": {
|
||||||
|
"colorMode": "value",
|
||||||
|
"graphMode": "area",
|
||||||
|
"justifyMode": "auto",
|
||||||
|
"orientation": "auto",
|
||||||
|
"reduceOptions": {
|
||||||
|
"calcs": [
|
||||||
|
"lastNotNull"
|
||||||
|
],
|
||||||
|
"fields": "",
|
||||||
|
"values": false
|
||||||
|
},
|
||||||
|
"textMode": "auto"
|
||||||
|
},
|
||||||
|
"pluginVersion": "10.0.0",
|
||||||
|
"targets": [
|
||||||
|
{
|
||||||
|
"datasource": {
|
||||||
|
"type": "loki",
|
||||||
|
"uid": "loki"
|
||||||
|
},
|
||||||
|
"editorMode": "code",
|
||||||
|
"expr": "count_over_time({container=\"blindbit-oracle\"} |= \"ERROR\" [1h])",
|
||||||
|
"queryType": "",
|
||||||
|
"refId": "A"
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"title": "Erreurs BlindBit (1h)",
|
||||||
|
"type": "stat"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"datasource": {
|
||||||
|
"type": "loki",
|
||||||
|
"uid": "loki"
|
||||||
|
},
|
||||||
|
"fieldConfig": {
|
||||||
|
"defaults": {
|
||||||
|
"color": {
|
||||||
|
"mode": "thresholds"
|
||||||
|
},
|
||||||
|
"mappings": [],
|
||||||
|
"thresholds": {
|
||||||
|
"mode": "absolute",
|
||||||
|
"steps": [
|
||||||
|
{
|
||||||
|
"color": "green",
|
||||||
|
"value": null
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"color": "red",
|
||||||
|
"value": 80
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"overrides": []
|
||||||
|
},
|
||||||
|
"gridPos": {
|
||||||
|
"h": 4,
|
||||||
|
"w": 6,
|
||||||
|
"x": 12,
|
||||||
|
"y": 8
|
||||||
|
},
|
||||||
|
"id": 5,
|
||||||
|
"options": {
|
||||||
|
"colorMode": "value",
|
||||||
|
"graphMode": "area",
|
||||||
|
"justifyMode": "auto",
|
||||||
|
"orientation": "auto",
|
||||||
|
"reduceOptions": {
|
||||||
|
"calcs": [
|
||||||
|
"lastNotNull"
|
||||||
|
],
|
||||||
|
"fields": "",
|
||||||
|
"values": false
|
||||||
|
},
|
||||||
|
"textMode": "auto"
|
||||||
|
},
|
||||||
|
"pluginVersion": "10.0.0",
|
||||||
|
"targets": [
|
||||||
|
{
|
||||||
|
"datasource": {
|
||||||
|
"type": "loki",
|
||||||
|
"uid": "loki"
|
||||||
|
},
|
||||||
|
"editorMode": "code",
|
||||||
|
"expr": "count_over_time({container=\"bitcoin-signet\"} |= \"New block\" [1h])",
|
||||||
|
"queryType": "",
|
||||||
|
"refId": "A"
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"title": "Nouveaux Blocs (1h)",
|
||||||
|
"type": "stat"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"datasource": {
|
||||||
|
"type": "loki",
|
||||||
|
"uid": "loki"
|
||||||
|
},
|
||||||
|
"fieldConfig": {
|
||||||
|
"defaults": {
|
||||||
|
"color": {
|
||||||
|
"mode": "thresholds"
|
||||||
|
},
|
||||||
|
"mappings": [],
|
||||||
|
"thresholds": {
|
||||||
|
"mode": "absolute",
|
||||||
|
"steps": [
|
||||||
|
{
|
||||||
|
"color": "green",
|
||||||
|
"value": null
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"color": "red",
|
||||||
|
"value": 80
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"overrides": []
|
||||||
|
},
|
||||||
|
"gridPos": {
|
||||||
|
"h": 4,
|
||||||
|
"w": 6,
|
||||||
|
"x": 18,
|
||||||
|
"y": 8
|
||||||
|
},
|
||||||
|
"id": 6,
|
||||||
|
"options": {
|
||||||
|
"colorMode": "value",
|
||||||
|
"graphMode": "area",
|
||||||
|
"justifyMode": "auto",
|
||||||
|
"orientation": "auto",
|
||||||
|
"reduceOptions": {
|
||||||
|
"calcs": [
|
||||||
|
"lastNotNull"
|
||||||
|
],
|
||||||
|
"fields": "",
|
||||||
|
"values": false
|
||||||
|
},
|
||||||
|
"textMode": "auto"
|
||||||
|
},
|
||||||
|
"pluginVersion": "10.0.0",
|
||||||
|
"targets": [
|
||||||
|
{
|
||||||
|
"datasource": {
|
||||||
|
"type": "loki",
|
||||||
|
"uid": "loki"
|
||||||
|
},
|
||||||
|
"editorMode": "code",
|
||||||
|
"expr": "count_over_time({container=\"blindbit-oracle\"} |= \"Silent payment\" [1h])",
|
||||||
|
"queryType": "",
|
||||||
|
"refId": "A"
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"title": "Silent Payments (1h)",
|
||||||
|
"type": "stat"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"datasource": {
|
||||||
|
"type": "loki",
|
||||||
|
"uid": "loki"
|
||||||
|
},
|
||||||
|
"fieldConfig": {
|
||||||
|
"defaults": {
|
||||||
|
"custom": {
|
||||||
|
"align": "auto",
|
||||||
|
"cellOptions": {
|
||||||
|
"type": "auto"
|
||||||
|
},
|
||||||
|
"inspect": false
|
||||||
|
},
|
||||||
|
"mappings": [],
|
||||||
|
"thresholds": {
|
||||||
|
"mode": "absolute",
|
||||||
|
"steps": [
|
||||||
|
{
|
||||||
|
"color": "green",
|
||||||
|
"value": null
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"color": "red",
|
||||||
|
"value": 80
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"overrides": []
|
||||||
|
},
|
||||||
|
"gridPos": {
|
||||||
|
"h": 8,
|
||||||
|
"w": 24,
|
||||||
|
"x": 0,
|
||||||
|
"y": 12
|
||||||
|
},
|
||||||
|
"id": 7,
|
||||||
|
"options": {
|
||||||
|
"cellHeight": "sm",
|
||||||
|
"footer": {
|
||||||
|
"countRows": false,
|
||||||
|
"fields": "",
|
||||||
|
"reducer": [
|
||||||
|
"sum"
|
||||||
|
],
|
||||||
|
"show": false
|
||||||
|
},
|
||||||
|
"showHeader": true
|
||||||
|
},
|
||||||
|
"pluginVersion": "10.0.0",
|
||||||
|
"targets": [
|
||||||
|
{
|
||||||
|
"datasource": {
|
||||||
|
"type": "loki",
|
||||||
|
"uid": "loki"
|
||||||
|
},
|
||||||
|
"editorMode": "code",
|
||||||
|
"expr": "{container=~\"bitcoin-signet|blindbit-oracle\"} |= \"ERROR\" | line_format \"{{.timestamp}} - {{.container}} - {{.message}}\"",
|
||||||
|
"queryType": "",
|
||||||
|
"refId": "A"
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"title": "Erreurs Bitcoin Services",
|
||||||
|
"type": "table"
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"refresh": "5s",
|
||||||
|
"schemaVersion": 37,
|
||||||
|
"style": "dark",
|
||||||
|
"tags": [
|
||||||
|
"bitcoin",
|
||||||
|
"signet",
|
||||||
|
"blindbit",
|
||||||
|
"oracle"
|
||||||
|
],
|
||||||
|
"templating": {
|
||||||
|
"list": []
|
||||||
|
},
|
||||||
|
"time": {
|
||||||
|
"from": "now-1h",
|
||||||
|
"to": "now"
|
||||||
|
},
|
||||||
|
"timepicker": {},
|
||||||
|
"timezone": "",
|
||||||
|
"title": "Bitcoin Services - Monitoring",
|
||||||
|
"uid": "bitcoin-services",
|
||||||
|
"version": 1,
|
||||||
|
"weekStart": ""
|
||||||
|
}
|
170
scripts/test-dashboards.sh
Executable file
170
scripts/test-dashboards.sh
Executable file
@ -0,0 +1,170 @@
|
|||||||
|
#!/bin/bash
|
||||||
|
|
||||||
|
# Script de test des dashboards Grafana
|
||||||
|
# Vérifie que tous les dashboards sont accessibles et fonctionnels
|
||||||
|
|
||||||
|
set -e
|
||||||
|
|
||||||
|
echo "🔍 Test des Dashboards Grafana LeCoffre Node"
|
||||||
|
echo "============================================="
|
||||||
|
|
||||||
|
GRAFANA_URL="https://dev4.4nkweb.com/grafana"
|
||||||
|
ADMIN_USER="admin"
|
||||||
|
ADMIN_PASS="admin123"
|
||||||
|
|
||||||
|
# Fonction pour tester un dashboard
|
||||||
|
test_dashboard() {
|
||||||
|
local dashboard_title="$1"
|
||||||
|
local dashboard_uid="$2"
|
||||||
|
|
||||||
|
echo "📊 Test du dashboard: $dashboard_title"
|
||||||
|
|
||||||
|
# Vérifier que le dashboard existe
|
||||||
|
dashboard_info=$(curl -s -u "$ADMIN_USER:$ADMIN_PASS" \
|
||||||
|
"$GRAFANA_URL/api/dashboards/uid/$dashboard_uid" \
|
||||||
|
-H "Content-Type: application/json")
|
||||||
|
|
||||||
|
if echo "$dashboard_info" | jq -e '.dashboard.title' > /dev/null 2>&1; then
|
||||||
|
echo " ✅ Dashboard accessible: $dashboard_title"
|
||||||
|
|
||||||
|
# Vérifier les panneaux
|
||||||
|
panel_count=$(echo "$dashboard_info" | jq '.dashboard.panels | length')
|
||||||
|
echo " 📈 Nombre de panneaux: $panel_count"
|
||||||
|
|
||||||
|
# Vérifier les requêtes Loki
|
||||||
|
loki_queries=$(echo "$dashboard_info" | jq '.dashboard.panels[] | select(.targets[]?.datasource.type == "loki") | .targets[]?.expr' | wc -l)
|
||||||
|
echo " 🔍 Requêtes Loki: $loki_queries"
|
||||||
|
|
||||||
|
return 0
|
||||||
|
else
|
||||||
|
echo " ❌ Dashboard inaccessible: $dashboard_title"
|
||||||
|
return 1
|
||||||
|
fi
|
||||||
|
}
|
||||||
|
|
||||||
|
# Fonction pour tester l'API Loki
|
||||||
|
test_loki_api() {
|
||||||
|
echo "🔍 Test de l'API Loki"
|
||||||
|
|
||||||
|
# Test de connectivité Loki
|
||||||
|
loki_response=$(curl -s -u "$ADMIN_USER:$ADMIN_PASS" \
|
||||||
|
"$GRAFANA_URL/api/datasources/proxy/loki/api/v1/labels" \
|
||||||
|
-H "Content-Type: application/json" 2>/dev/null || echo "ERROR")
|
||||||
|
|
||||||
|
if [[ "$loki_response" != "ERROR" ]] && echo "$loki_response" | jq -e '.data' > /dev/null 2>&1; then
|
||||||
|
echo " ✅ API Loki accessible"
|
||||||
|
|
||||||
|
# Compter les labels disponibles
|
||||||
|
label_count=$(echo "$loki_response" | jq '.data | length')
|
||||||
|
echo " 🏷️ Labels disponibles: $label_count"
|
||||||
|
|
||||||
|
return 0
|
||||||
|
else
|
||||||
|
echo " ❌ API Loki inaccessible"
|
||||||
|
return 1
|
||||||
|
fi
|
||||||
|
}
|
||||||
|
|
||||||
|
# Fonction pour tester les logs des services
|
||||||
|
test_service_logs() {
|
||||||
|
echo "📋 Test des logs des services"
|
||||||
|
|
||||||
|
services=("bitcoin-signet" "blindbit-oracle" "sdk_relay" "sdk_signer" "sdk_storage" "lecoffre-back" "lecoffre-front" "ihm_client" "signet_miner")
|
||||||
|
|
||||||
|
for service in "${services[@]}"; do
|
||||||
|
echo " 🔍 Test des logs: $service"
|
||||||
|
|
||||||
|
# Test d'une requête simple sur les logs du service
|
||||||
|
loki_response=$(curl -s -u "$ADMIN_USER:$ADMIN_PASS" \
|
||||||
|
"$GRAFANA_URL/api/datasources/proxy/loki/api/v1/query?query={container=\"$service\"}&limit=1" \
|
||||||
|
-H "Content-Type: application/json" 2>/dev/null || echo "ERROR")
|
||||||
|
|
||||||
|
if [[ "$loki_response" != "ERROR" ]] && echo "$loki_response" | jq -e '.data.result' > /dev/null 2>&1; then
|
||||||
|
log_count=$(echo "$loki_response" | jq '.data.result | length')
|
||||||
|
if [ "$log_count" -gt 0 ]; then
|
||||||
|
echo " ✅ Logs disponibles: $log_count entrées"
|
||||||
|
else
|
||||||
|
echo " ⚠️ Aucun log récent trouvé"
|
||||||
|
fi
|
||||||
|
else
|
||||||
|
echo " ❌ Erreur d'accès aux logs"
|
||||||
|
fi
|
||||||
|
done
|
||||||
|
}
|
||||||
|
|
||||||
|
# Fonction pour générer un rapport de santé
|
||||||
|
generate_health_report() {
|
||||||
|
echo "📊 Rapport de Santé des Dashboards"
|
||||||
|
echo "=================================="
|
||||||
|
|
||||||
|
# Test de connectivité Grafana
|
||||||
|
grafana_status=$(curl -s -o /dev/null -w "%{http_code}" \
|
||||||
|
-u "$ADMIN_USER:$ADMIN_PASS" \
|
||||||
|
"$GRAFANA_URL/api/health")
|
||||||
|
|
||||||
|
if [ "$grafana_status" = "200" ]; then
|
||||||
|
echo "✅ Grafana: Opérationnel (HTTP $grafana_status)"
|
||||||
|
else
|
||||||
|
echo "❌ Grafana: Problème (HTTP $grafana_status)"
|
||||||
|
fi
|
||||||
|
|
||||||
|
# Test de connectivité Loki
|
||||||
|
loki_status=$(curl -s -o /dev/null -w "%{http_code}" \
|
||||||
|
-u "$ADMIN_USER:$ADMIN_PASS" \
|
||||||
|
"$GRAFANA_URL/api/datasources/proxy/loki/ready")
|
||||||
|
|
||||||
|
if [ "$loki_status" = "200" ]; then
|
||||||
|
echo "✅ Loki: Opérationnel (HTTP $loki_status)"
|
||||||
|
else
|
||||||
|
echo "❌ Loki: Problème (HTTP $loki_status)"
|
||||||
|
fi
|
||||||
|
|
||||||
|
echo ""
|
||||||
|
echo "🎯 Dashboards disponibles:"
|
||||||
|
curl -s -u "$ADMIN_USER:$ADMIN_PASS" \
|
||||||
|
"$GRAFANA_URL/api/search?type=dash-db" | \
|
||||||
|
jq -r '.[] | " 📊 " + .title + " (UID: " + .uid + ")"'
|
||||||
|
}
|
||||||
|
|
||||||
|
# Exécution des tests
|
||||||
|
echo "🚀 Démarrage des tests..."
|
||||||
|
echo ""
|
||||||
|
|
||||||
|
# Test de l'API Loki
|
||||||
|
test_loki_api
|
||||||
|
echo ""
|
||||||
|
|
||||||
|
# Test des dashboards spécifiques
|
||||||
|
echo "📊 Test des Dashboards Spécialisés"
|
||||||
|
echo "=================================="
|
||||||
|
|
||||||
|
test_dashboard "Bitcoin Miner - Détails" "bitcoin-miner-detailed"
|
||||||
|
test_dashboard "LeCoffre Backend - Monitoring" "lecoffre-backend"
|
||||||
|
test_dashboard "SDK Services - Monitoring" "sdk-services"
|
||||||
|
test_dashboard "Frontend Services - Monitoring" "frontend-services"
|
||||||
|
test_dashboard "Bitcoin Services - Monitoring" "bitcoin-services"
|
||||||
|
|
||||||
|
echo ""
|
||||||
|
|
||||||
|
# Test des logs des services
|
||||||
|
test_service_logs
|
||||||
|
echo ""
|
||||||
|
|
||||||
|
# Génération du rapport de santé
|
||||||
|
generate_health_report
|
||||||
|
|
||||||
|
echo ""
|
||||||
|
echo "🎉 Tests terminés!"
|
||||||
|
echo ""
|
||||||
|
echo "📋 Accès aux Dashboards:"
|
||||||
|
echo " URL: $GRAFANA_URL"
|
||||||
|
echo " Utilisateur: $ADMIN_USER"
|
||||||
|
echo " Mot de passe: $ADMIN_PASS"
|
||||||
|
echo ""
|
||||||
|
echo "🔗 Liens directs:"
|
||||||
|
echo " Vue d'ensemble: $GRAFANA_URL/d/lecoffre-overview"
|
||||||
|
echo " Bitcoin Miner: $GRAFANA_URL/d/bitcoin-miner-detailed"
|
||||||
|
echo " Backend LeCoffre: $GRAFANA_URL/d/lecoffre-backend"
|
||||||
|
echo " Services SDK: $GRAFANA_URL/d/sdk-services"
|
||||||
|
echo " Services Frontend: $GRAFANA_URL/d/frontend-services"
|
||||||
|
echo " Services Bitcoin: $GRAFANA_URL/d/bitcoin-services"
|
Loading…
x
Reference in New Issue
Block a user