mirror of
https://github.com/Memo-2023/mana-monorepo.git
synced 2026-05-23 22:56:42 +02:00
📈 feat(monitoring): upgrade to VictoriaMetrics + DuckDB analytics
- Replace Prometheus with VictoriaMetrics (2-year retention) - Add DuckDB analytics module for business KPIs (unlimited retention) - Add master overview dashboard combining all metrics - Add business metrics dashboard for user growth tracking - Add backup script for VictoriaMetrics snapshots and DuckDB - Add ADR documentation for monitoring stack decision Analytics API endpoints: - GET /api/v1/analytics/health - Service health - GET /api/v1/analytics/latest - Latest metrics snapshot - GET /api/v1/analytics/growth - User growth over time - GET /api/v1/analytics/monthly - Monthly aggregates - POST /api/v1/analytics/snapshot - Manual snapshot trigger
This commit is contained in:
parent
2e7378710f
commit
9dfad0128a
17 changed files with 2901 additions and 18 deletions
|
|
@ -90,6 +90,10 @@ services:
|
|||
SMTP_PASSWORD: ${SMTP_PASSWORD}
|
||||
SMTP_FROM: ManaCore <noreply@mana.how>
|
||||
CORS_ORIGINS: https://mana.how,https://chat.mana.how,https://todo.mana.how,https://calendar.mana.how,https://clock.mana.how,https://contacts.mana.how,https://storage.mana.how,https://presi.mana.how
|
||||
# DuckDB Analytics (Business Metrics)
|
||||
DUCKDB_PATH: /data/analytics/metrics.duckdb
|
||||
volumes:
|
||||
- analytics_data:/data/analytics
|
||||
ports:
|
||||
- "3001:3001"
|
||||
healthcheck:
|
||||
|
|
@ -534,23 +538,28 @@ services:
|
|||
# Monitoring Stack
|
||||
# ============================================
|
||||
|
||||
prometheus:
|
||||
image: prom/prometheus:v2.51.0
|
||||
container_name: manacore-prometheus
|
||||
# VictoriaMetrics - High-performance Prometheus replacement
|
||||
# See docs/decisions/001-monitoring-stack-upgrade.md for details
|
||||
victoriametrics:
|
||||
image: victoriametrics/victoria-metrics:v1.99.0
|
||||
container_name: manacore-victoriametrics
|
||||
restart: always
|
||||
command:
|
||||
- '--config.file=/etc/prometheus/prometheus.yml'
|
||||
- '--storage.tsdb.path=/prometheus'
|
||||
- '--storage.tsdb.retention.time=30d'
|
||||
- '--web.enable-lifecycle'
|
||||
- '-storageDataPath=/storage'
|
||||
- '-retentionPeriod=2y'
|
||||
- '-httpListenAddr=:8428'
|
||||
- '-promscrape.config=/etc/prometheus/prometheus.yml'
|
||||
- '-promscrape.config.strictParse=false'
|
||||
- '-selfScrapeInterval=15s'
|
||||
- '-search.latencyOffset=0s'
|
||||
volumes:
|
||||
- ./docker/prometheus/prometheus.yml:/etc/prometheus/prometheus.yml:ro
|
||||
- ./docker/prometheus/alerts.yml:/etc/prometheus/alerts.yml:ro
|
||||
- prometheus_data:/prometheus
|
||||
- victoriametrics_data:/storage
|
||||
ports:
|
||||
- "9090:9090"
|
||||
- "8428:8428"
|
||||
healthcheck:
|
||||
test: ["CMD", "wget", "--no-verbose", "--tries=1", "--spider", "http://127.0.0.1:9090/-/healthy"]
|
||||
test: ["CMD", "wget", "--no-verbose", "--tries=1", "--spider", "http://127.0.0.1:8428/health"]
|
||||
interval: 30s
|
||||
timeout: 10s
|
||||
retries: 3
|
||||
|
|
@ -572,7 +581,7 @@ services:
|
|||
container_name: manacore-grafana
|
||||
restart: always
|
||||
depends_on:
|
||||
prometheus:
|
||||
victoriametrics:
|
||||
condition: service_healthy
|
||||
environment:
|
||||
GF_SECURITY_ADMIN_USER: admin
|
||||
|
|
@ -943,10 +952,12 @@ volumes:
|
|||
name: manacore-redis
|
||||
minio_data:
|
||||
name: manacore-minio
|
||||
prometheus_data:
|
||||
name: manacore-prometheus
|
||||
victoriametrics_data:
|
||||
name: manacore-victoriametrics
|
||||
grafana_data:
|
||||
name: manacore-grafana
|
||||
analytics_data:
|
||||
name: manacore-analytics
|
||||
n8n_data:
|
||||
name: manacore-n8n
|
||||
synapse_data:
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue