Skip to content

Configuration

MiniAPM is configured entirely through environment variables. No configuration files needed.

VariableDefaultDescription
SQLITE_PATH./data/miniapm.dbPath to the SQLite database file
RUST_LOGmini_apm=infoLog level (debug, info, warn, error)
MINI_APM_URLhttp://localhost:3000Public URL of the collector

Control how long data is kept before automatic cleanup:

VariableDefaultDescription
RETENTION_DAYS_ERRORS30Days to keep error data
RETENTION_DAYS_SPANS7Days to keep trace spans
RETENTION_DAYS_HOURLY_ROLLUPS90Days to keep hourly aggregates
VariableDefaultDescription
SLOW_REQUEST_THRESHOLD_MS500Requests slower than this (in ms) are flagged as slow

By default, MiniAPM runs in single-project mode with one API key. Enable multi-project mode to manage multiple applications:

VariableDefaultDescription
ENABLE_PROJECTSfalseEnable multi-project mode

When enabled:

  • Each project gets its own API key
  • Data is isolated between projects
  • Dashboard can filter by project
VariableDefaultDescription
SQLITE_PATH./data/miniapm.dbPath to the SQLite database (same file as collector)
ADMIN_PORT3001Dashboard server port
RUST_LOGmini_apm_admin=infoLog level
MINI_APM_URLhttp://localhost:3001URL for generating links
ENABLE_USER_ACCOUNTSfalseEnable user authentication
SESSION_SECRET(required)Secret for session cookies (min 32 characters)

Enable user accounts for team access:

Terminal window
# Enable with a secure session secret
ENABLE_USER_ACCOUNTS=true
SESSION_SECRET=$(openssl rand -hex 32)

When enabled:

  • SESSION_SECRET is required (MiniAPM will refuse to start without it)
  • On first startup, a default admin user 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
Terminal window
SQLITE_PATH=./miniapm-dev.db
RUST_LOG=mini_apm=debug
SLOW_REQUEST_THRESHOLD_MS=200
Terminal window
SQLITE_PATH=/data/miniapm.db
RUST_LOG=mini_apm=info
RETENTION_DAYS_ERRORS=60
RETENTION_DAYS_SPANS=7
Terminal window
SQLITE_PATH=/data/miniapm.db
RUST_LOG=mini_apm=info
ENABLE_PROJECTS=true
ENABLE_USER_ACCOUNTS=true
SESSION_SECRET=generate-a-secure-random-string

Pass environment variables to Docker:

Terminal window
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/miniapm

Or use an environment file:

Terminal window
# miniapm.env
SQLITE_PATH=/data/miniapm.db
RETENTION_DAYS_ERRORS=60
SLOW_REQUEST_THRESHOLD_MS=300
# Run with env file
docker run -d \
-p 3000:3000 \
-v miniapm_data:/data \
--env-file miniapm.env \
ghcr.io/miniapm/miniapm