Skip to Content
OpenPerf

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.

Groupapiapi-ingestmcpworker-errorsworker-jobs
PostgreSQL✓✓✓✓✓
ClickHouse✓✓✓✓✓
Redis✓✓✓✓✓
Object storage✓✓✓✓
Ingest queue✓✓
Proxies✓✓✓
Integrations✓✓
Email✓
Logging✓✓✓✓✓

PostgreSQL

VariableRequiredDefaultDescription
DATABASE_URLyesConnection string, such as postgresql://openperf:openperf@localhost:5432/openperf.
DATABASE_MAX_CONNECTIONSno10Size 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

VariableRequiredDefaultDescription
CLICKHOUSE_URLyesHTTP endpoint, such as http://localhost:8123.
CLICKHOUSE_USERyesUser name.
CLICKHOUSE_PASSWORDyesPassword.
CLICKHOUSE_DATABASEyesDatabase name.
CLICKHOUSE_MAX_EXECUTION_TIME_SECONDSno60Query timeout.
CLICKHOUSE_MAX_MEMORY_USAGEno1073741824Memory per query, in bytes.
CLICKHOUSE_EXTERNAL_GROUP_BY_BYTESno536870912GROUP BY memory before spilling to disk, in bytes.
CLICKHOUSE_EXTERNAL_SORT_BYTESno536870912Sort memory before spilling to disk, in bytes.
CLICKHOUSE_MAX_CONCURRENT_READSnono limitConcurrent queries per process; the rest wait.

Redis

VariableRequiredDescription
REDIS_STATE_URLyesThe 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_URLyesQuery 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.

VariableDescription
STORAGE_S3_BUCKETBucket name. Turns object storage on.
STORAGE_S3_ENDPOINTEndpoint of a non-AWS store, such as RustFS or MinIO.
STORAGE_S3_REGIONRegion.
STORAGE_S3_ACCESS_KEY_IDAccess key.
STORAGE_S3_SECRET_ACCESS_KEYSecret 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.

VariableDefaultDescription
INGEST_JOURNAL_DIR.journalDirectory of the journal. The image sets /var/lib/openperf/journal. api-ingest only.
INGEST_JOURNAL_MAX_BYTES8589934592Bytes 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

VariableDefaultDescription
TRUSTED_PROXIESloopbackComma-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.

Email

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.

VariableDescription
RESEND_API_KEYResend API key.
EMAIL_FROMSender, such as OpenPerf <alerts@example.com>. Required with RESEND_API_KEY.

Logging

Services log JSON lines to stdout. See Logs.

VariableDefaultDescription
LOG_LEVELinfoLowest level: trace, debug, info, warn, error or fatal.

On this page