Configuration
MiniAPM is configured entirely through environment variables. No configuration files needed.
Collector (miniapm)
Section titled “Collector (miniapm)”Core Settings
Section titled “Core Settings”| Variable | Default | Description |
|---|---|---|
SQLITE_PATH | ./data/miniapm.db | Path to the SQLite database file |
RUST_LOG | mini_apm=info | Log level (debug, info, warn, error) |
MINI_APM_URL | http://localhost:3000 | Public URL of the collector |
Data Retention
Section titled “Data Retention”Control how long data is kept before automatic cleanup:
| Variable | Default | Description |
|---|---|---|
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 |
Performance 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
Dashboard (miniapm-admin)
Section titled “Dashboard (miniapm-admin)”| Variable | Default | Description |
|---|---|---|
SQLITE_PATH | ./data/miniapm.db | Path to the SQLite database (same file as collector) |
ADMIN_PORT | 3001 | Dashboard server port |
RUST_LOG | mini_apm_admin=info | Log level |
MINI_APM_URL | http://localhost:3001 | URL for generating links |
ENABLE_USER_ACCOUNTS | false | Enable user authentication |
SESSION_SECRET | (required) | Secret for session cookies (min 32 characters) |
Multi-User Mode
Section titled “Multi-User Mode”Enable user accounts for team access:
# Enable with a secure session secretENABLE_USER_ACCOUNTS=trueSESSION_SECRET=$(openssl rand -hex 32)When enabled:
SESSION_SECRETis required (MiniAPM will refuse to start without it)- On first startup, a default
adminuser is created with a random password printed to the logs - The admin user is prompted to change their password on first login
- Uses Argon2 for password hashing
- Sessions expire after 24 hours
Example Configurations
Section titled “Example Configurations”Development
Section titled “Development”SQLITE_PATH=./miniapm-dev.dbRUST_LOG=mini_apm=debugSLOW_REQUEST_THRESHOLD_MS=200Production (Single App)
Section titled “Production (Single App)”SQLITE_PATH=/data/miniapm.dbRUST_LOG=mini_apm=infoRETENTION_DAYS_ERRORS=60RETENTION_DAYS_SPANS=7Production (Multi-Tenant)
Section titled “Production (Multi-Tenant)”SQLITE_PATH=/data/miniapm.dbRUST_LOG=mini_apm=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 SQLITE_PATH=/data/miniapm.db \ -e RETENTION_DAYS_ERRORS=60 \ -e SLOW_REQUEST_THRESHOLD_MS=300 \ ghcr.io/miniapm/miniapmOr use an environment file:
# miniapm.envSQLITE_PATH=/data/miniapm.dbRETENTION_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