feat(logging): finalize log-ingest service for dokploy-network deployment

- Update log-ingest to use internal Loki endpoint
- Add standalone docker-compose for dokploy deployment
- Update ROADMAP and LOGGING-PLAN with completed status
- Configure proper network settings for dokploy-network
This commit is contained in:
Oussama Douhou
2026-01-10 14:19:42 +01:00
parent 80e54ce578
commit f5f10ed6c4
7 changed files with 64 additions and 27 deletions

View File

@@ -387,29 +387,35 @@ groups:
## 7. Implementation Checklist
### Phase 1: Container Logging
- [ ] Set up Loki + Promtail on logging server
- [ ] Configure Docker log driver for ai-stack containers
- [ ] Add log rotation to Dockerfile
- [ ] Verify logs flowing to Loki
- [x] Set up Loki + Promtail on logging server (using existing `logs.intra.flexinit.nl`)
- [x] Configure Docker log driver for ai-stack containers
- [x] Add log rotation to Dockerfile
- [x] Verify logs flowing to Loki
### Phase 2: Session Logging
- [ ] Create logging hook in oh-my-opencode
- [ ] Define event schema
- [ ] Implement log shipping (HTTP or file-based)
- [ ] Add session/message/tool logging
- [x] Create logging hook in oh-my-opencode (`/home/odouhou/locale-projects/oh-my-opencode-free-fork/src/hooks/usage-logging/`)
- [x] Define event schema
- [x] Implement log shipping (HTTP-based via log-ingest service)
- [x] Add session/message/tool logging
### Phase 3: Metrics
- [ ] Add prom-client to container
- [ ] Expose /metrics endpoint
- [ ] Configure Prometheus scraping
- [ ] Create initial Grafana dashboards
- [x] Add prom-client to container (`docker/shared-config/metrics-exporter.ts`)
- [x] Expose /metrics endpoint (port 9090)
- [x] Configure Prometheus scraping (datasource added to Grafana)
- [x] Create initial Grafana dashboards (`/d/ai-stack-overview`)
### Phase 4: Production Hardening
- [ ] Implement data anonymization
- [x] Implement data anonymization (content hashed, not stored)
- [ ] Set up retention policies
- [ ] Configure alerts
- [ ] Document runbooks
### Deployed Components (2026-01-10)
- **Log-ingest service**: `http://ai-stack-log-ingest:3000/ingest` (dokploy-network)
- **Grafana dashboard**: https://logs.intra.flexinit.nl/d/ai-stack-overview
- **Datasource UIDs**: Loki (`af9a823s6iku8b`), Prometheus (`cf9r1fmfw9xxcf`)
- **BWS credentials**: `GRAFANA_OPENCODE_ACCESS_TOKEN` (id: `c77e58e3-fb34-41dc-9824-b3ce00da18a0`)
---
## 8. Cost Estimates