Configuration
MiniAPM is configured entirely through environment variables. No configuration files needed.
Core Settings
Section titled “Core Settings”| Variable | Default | Description |
|---|---|---|
SQLITE_PATH | ./data/miniapm.db | Path to the SQLite database file |
RUST_LOG | miniapm=info | Log level (debug, info, warn, error) |
MINI_APM_URL | http://localhost:3000 | Public URL of the MiniAPM server |
Data Retention
Section titled “Data Retention”Control how long data is kept before automatic cleanup:
| Variable | Default | Description |
|---|---|---|
RETENTION_DAYS_REQUESTS | 7 | Days to keep request data |
RETENTION_DAYS_ERRORS | 30 | Days to keep error data |
RETENTION_DAYS_SPANS | 7 | Days to keep trace spans |
RETENTION_DAYS_HOURLY_ROLLUPS | 90 | Days to keep hourly aggregates |
Example Docker Compose configuration:
environment: - RETENTION_DAYS_REQUESTS=14 - RETENTION_DAYS_ERRORS=60 - RETENTION_DAYS_SPANS=14Performance Thresholds
Section titled “Performance Thresholds”| Variable | Default | Description |
|---|---|---|
SLOW_REQUEST_THRESHOLD_MS | 500 | Requests slower than this (in ms) are flagged as slow |
Multi-Project Mode
Section titled “Multi-Project Mode”By default, MiniAPM runs in single-project mode with one API key. Enable multi-project mode to manage multiple applications:
| Variable | Default | Description |
|---|---|---|
ENABLE_PROJECTS | false | Enable multi-project mode |
When enabled:
- Each project gets its own API key
- Data is isolated between projects
- Dashboard can filter by project
Multi-User Mode
Section titled “Multi-User Mode”Enable user accounts for team access:
| Variable | Default | Description |
|---|---|---|
ENABLE_USER_ACCOUNTS | false | Enable user authentication |
SESSION_SECRET | (auto-generated) | Secret for session cookies |
When enabled:
- Default admin credentials:
admin/admin(change immediately!) - Uses Argon2 for password hashing
- Cookie-based session management
# Enable with a secure session secretENABLE_USER_ACCOUNTS=trueSESSION_SECRET=your-secure-random-string-hereExample Configurations
Section titled “Example Configurations”Development
Section titled “Development”SQLITE_PATH=./miniapm-dev.dbRUST_LOG=miniapm=debugSLOW_REQUEST_THRESHOLD_MS=200Production (Single App)
Section titled “Production (Single App)”SQLITE_PATH=/data/miniapm.dbRUST_LOG=miniapm=infoRETENTION_DAYS_REQUESTS=14RETENTION_DAYS_ERRORS=60RETENTION_DAYS_SPANS=7Production (Multi-Tenant)
Section titled “Production (Multi-Tenant)”SQLITE_PATH=/data/miniapm.dbRUST_LOG=miniapm=infoENABLE_PROJECTS=trueENABLE_USER_ACCOUNTS=trueSESSION_SECRET=generate-a-secure-random-stringDocker Environment
Section titled “Docker Environment”Pass environment variables to Docker:
docker run -d \ -p 3000:3000 \ -v miniapm_data:/data \ -e RETENTION_DAYS_REQUESTS=14 \ -e RETENTION_DAYS_ERRORS=60 \ -e SLOW_REQUEST_THRESHOLD_MS=300 \ ghcr.io/miniapm/miniapmOr use an environment file:
# miniapm.envRETENTION_DAYS_REQUESTS=14RETENTION_DAYS_ERRORS=60SLOW_REQUEST_THRESHOLD_MS=300
# Run with env filedocker run -d \ -p 3000:3000 \ -v miniapm_data:/data \ --env-file miniapm.env \ ghcr.io/miniapm/miniapm