metrics
This commit is contained in:
@@ -116,6 +116,52 @@ export BUILD_NUMBER="prod-v1.0" # Enables production mode
|
||||
5. **Alerting Ready** - Use Prometheus AlertManager
|
||||
6. **Ecosystem** - Tons of existing dashboards and tools
|
||||
|
||||
## Persistent Storage Setup
|
||||
|
||||
### Option 1: Docker Compose (Recommended)
|
||||
|
||||
For persistent metrics storage, run a Prometheus server alongside your app:
|
||||
|
||||
```bash
|
||||
# 1. Copy your API token to .env
|
||||
cp .env.example .env
|
||||
# Edit .env and set your API_TOKEN
|
||||
|
||||
# 2. Start the full monitoring stack
|
||||
docker-compose up -d
|
||||
|
||||
# 3. Access services
|
||||
# - Your app: http://localhost:54321
|
||||
# - Prometheus: http://localhost:9090
|
||||
# - Grafana: http://localhost:3000 (admin/admin)
|
||||
```
|
||||
|
||||
**What this gives you:**
|
||||
- ✅ **Persistent metrics** - Data survives restarts
|
||||
- ✅ **30-day retention** - Configurable in docker-compose.yml
|
||||
- ✅ **Grafana pre-configured** - Points to Prometheus automatically
|
||||
- ✅ **Production ready** - Proper volumes and networking
|
||||
|
||||
### Option 2: Standalone Prometheus
|
||||
|
||||
If you prefer to run Prometheus separately:
|
||||
|
||||
```bash
|
||||
# 1. Update prometheus.yml with your API token
|
||||
# 2. Start Prometheus
|
||||
prometheus --config.file=prometheus.yml --storage.tsdb.path=./prometheus_data
|
||||
|
||||
# 3. Configure Grafana to point to http://localhost:9090
|
||||
```
|
||||
|
||||
### Grafana Data Source Configuration
|
||||
|
||||
With persistent Prometheus:
|
||||
1. **Add Prometheus Data Source** in Grafana
|
||||
2. **Set URL** to: `http://prometheus:9090` (Docker) or `http://localhost:9090` (standalone)
|
||||
3. **No authentication needed** - Prometheus handles the API token
|
||||
4. **Query retention**: Up to 30 days of historical data
|
||||
|
||||
## Quick Start
|
||||
|
||||
1. **Start your server:** `./tmp/main`
|
||||
|
||||
Reference in New Issue
Block a user