Files
Omika/docs/observability/configuration.md
T
2026-10-23 18:46:50 +02:00

81 lines
2.9 KiB
Markdown
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
# Configuration de l'observabilité externe
## Section `Observability:External` (§74)
```json
{
"Observability": {
"External": {
"Enabled": false,
"OtlpEndpoint": "",
"ExportTimeoutSeconds": 3,
"MaxQueueSize": 2048,
"MaxExportBatchSize": 512,
"ScheduledDelayMilliseconds": 2000,
"CircuitFailureThreshold": 5,
"CircuitCooldownSeconds": 30,
"IncludeP4": false
}
}
}
```
| Clé | Défaut | Rôle |
|---|---|---|
| `Enabled` | `false` | **Kill switch**. `false` = aucun export, aucun réseau, aucun thread externe. |
| `OtlpEndpoint` | `""` | Endpoint OTLP HTTP/protobuf du Collector (ex. `http://10.0.0.10:4318`). |
| `ExportTimeoutSeconds` | `3` | Timeout réseau court d'un export OTLP (2–5 s max, §13). |
| `MaxQueueSize` | `2048` | File SDK OTel bornée (§14). |
| `MaxExportBatchSize` | `512` | Taille max d'un lot OTel. |
| `ScheduledDelayMilliseconds` | `2000` | Délai de regroupement du batch. |
| `CircuitFailureThreshold` | `5` | Échecs consécutifs avant ouverture du circuit. |
| `CircuitCooldownSeconds` | `30` | Durée d'ouverture du circuit avant sonde. |
| `IncludeP4` | `false` | Exporter les événements P4 (analytics). Non exportés par défaut (§44). |
Autres clés (forwarder) : `ForwarderBatchSize` (100), `ForwarderIntervalSeconds` (15),
`CheckpointFileName` (`forwarder-checkpoint.json`).
## Default safe (§18)
**`Enabled=false` par défaut.** Activation explicite après installation et validation
du Collector (test §88). Ne jamais activer en production sans avoir validé la chaîne.
## Kill switch (§17)
Mettre `Enabled=false` désactive **entièrement** :
- `OpenTelemetryExporterAdapter` (aucun provider, aucun réseau, aucun thread) ;
- `RemoteDiagnosticForwarder` externe (la boucle reste au ralenti).
Sans désactiver (inchangé) :
- `LocalFileTelemetryExporter` (JSONL local) ;
- `DiagnosticOutbox` (`omika-diagnostics.db`) ;
- `POST /api/diagnostics` ;
- `RemoteDiagnosticIngestionStore` (JSONL serveur).
## Configuration invalide (§75)
`Enabled=true` + `OtlpEndpoint=""` (ou URL non http/https, ou bornes invalides) :
- l'adaptateur externe est **désactivé** (NoOp) ;
- un warning `EmergencyLogger` est écrit ;
- **Omika démarre et fonctionne normalement** (jamais de crash au démarrage).
## Environnements (§73)
| Environnement | `Enabled` | Endpoint |
|---|---|---|
| Development | `false` (ou `true` + endpoint local) | `http://localhost:4318` |
| Production | explicite | `http://<ip-vm-observability>:4318` |
Les endpoints ne sont **jamais codés en dur** dans le code : ils viennent de la
configuration (appsettings / variables d'environnement / secrets).
## Secrets (§30)
Aucun secret dans un fichier versionné. Les credentials éventuels (ClickHouse) sont
fournis via `.env` (non versionné) / variables d'environnement. **Ne jamais réutiliser**
un mot de passe utilisateur, un token mobile, une clé licence ou un secret SMTP pour
l'observabilité.