Self-hosting
Configuration
Variables several services share. Set the same values in each.
A service validates its environment at start and refuses to boot on an invalid value. Leave an optional variable out rather than empty: KEY= sets an empty string, which fails validation.
| Group | api | api-ingest | mcp | worker-errors | worker-jobs |
|---|---|---|---|---|---|
| PostgreSQL | ✓ | ✓ | ✓ | ✓ | ✓ |
| ClickHouse | ✓ | ✓ | ✓ | ✓ | ✓ |
| Redis | ✓ | ✓ | ✓ | ✓ | ✓ |
| Object storage | ✓ | ✓ | ✓ | ✓ | |
| Ingest queue | ✓ | ✓ | |||
| Proxies | ✓ | ✓ | ✓ | ||
| Integrations | ✓ | ✓ | |||
| ✓ | |||||
| Logging | ✓ | ✓ | ✓ | ✓ | ✓ |
PostgreSQL
| Variable | Required | Default | Description |
|---|---|---|---|
DATABASE_URL | yes | Connection string, such as postgresql://openperf:openperf@localhost:5432/openperf. | |
DATABASE_MAX_CONNECTIONS | no | 10 | Size of the connection pool (api, mcp, worker-errors and worker-jobs). |
api-ingest uses a fixed pool of 4 connections per intake worker. Both workers set a built-in 60-second statement timeout.
ClickHouse
| Variable | Required | Default | Description |
|---|---|---|---|
CLICKHOUSE_URL | yes | HTTP endpoint, such as http://localhost:8123. | |
CLICKHOUSE_USER | yes | User name. | |
CLICKHOUSE_PASSWORD | yes | Password. | |
CLICKHOUSE_DATABASE | yes | Database name. | |
CLICKHOUSE_MAX_EXECUTION_TIME_SECONDS | no | 60 | Query timeout. |
CLICKHOUSE_MAX_MEMORY_USAGE | no | 1073741824 | Memory per query, in bytes. |
CLICKHOUSE_EXTERNAL_GROUP_BY_BYTES | no | 536870912 | GROUP BY memory before spilling to disk, in bytes. |
CLICKHOUSE_EXTERNAL_SORT_BYTES | no | 536870912 | Sort memory before spilling to disk, in bytes. |
CLICKHOUSE_MAX_CONCURRENT_READS | no | no limit | Concurrent queries per process; the rest wait. |
Redis
| Variable | Required | Description |
|---|---|---|
REDIS_STATE_URL | yes | The error queue, rate limits and idempotency keys of errors. Run it with maxmemory and maxmemory-policy noeviction, or queued errors are lost; see sizing. Not read by worker-jobs. |
REDIS_CACHE_URL | yes | Query and project key cache. Eviction is fine. Not read by worker-errors. |
Object storage
An S3-compatible bucket for source maps, session replays, logos and avatars. Without STORAGE_S3_BUCKET uploads are refused, browser stacks stay minified, api-ingest refuses replays and project cleanup skips the bucket.
| Variable | Description |
|---|---|
STORAGE_S3_BUCKET | Bucket name. Turns object storage on. |
STORAGE_S3_ENDPOINT | Endpoint of a non-AWS store, such as RustFS or MinIO. |
STORAGE_S3_REGION | Region. |
STORAGE_S3_ACCESS_KEY_ID | Access key. |
STORAGE_S3_SECRET_ACCESS_KEY | Secret key. |
All are optional. The local RustFS from docker compose uses endpoint http://localhost:9000, bucket openperf, region us-east-1, key openperf and secret openperf-secret.
Ingest queue
How telemetry waits on its way to ClickHouse: logs and spans in the journal of api-ingest, errors in the Redis queue that worker-errors drains. All optional.
| Variable | Default | Description |
|---|---|---|
INGEST_JOURNAL_DIR | .journal | Directory of the journal. The image sets /var/lib/openperf/journal. api-ingest only. |
INGEST_JOURNAL_MAX_BYTES | 8589934592 | Bytes waiting for export above which intake answers 429. Also scales the export batch size up to 32 MiB. api-ingest. |
Segment size (64 MiB), export linger (500 ms), retry/outage backoffs, dead-letter thresholds (24 hours / 10,000 items), and the worker-errors queue limits (10,000 entries / 80% of state Redis maxmemory) use built-in defaults.
Proxies
| Variable | Default | Description |
|---|---|---|
TRUSTED_PROXIES | loopback | Comma-separated IPs, CIDRs, loopback, linklocal or uniquelocal trusted for x-forwarded-for and x-request-id. |
List every proxy and load balancer in front of the service, and web for api. Otherwise all clients share one address and one rate limit.
Sign-in codes, alerts and invitations go through Resend. Without a key, emails are skipped. Unless NODE_ENV of worker-jobs is production, skipped emails, sign-in codes included, are written to its log. In production, set up Resend or GitHub or Google sign-in.
Emails load the OpenPerf logo from APP_DASHBOARD_ORIGIN. When recipients can't reach the dashboard, their mail client shows the logo's alt text instead.
| Variable | Description |
|---|---|
RESEND_API_KEY | Resend API key. |
EMAIL_FROM | Sender, such as OpenPerf <alerts@example.com>. Required with RESEND_API_KEY. |
Logging
Services log JSON lines to stdout. See Logs.
| Variable | Default | Description |
|---|---|---|
LOG_LEVEL | info | Lowest level: trace, debug, info, warn, error or fatal. |