Open Spanner
Configuration

Environment Variables

Runtime configuration for the Open Spanner service.

VariableDefaultDescription
OPEN_SPANNER_HTTP_ADDR:18081API listen address.
OPEN_SPANNER_GRPC_ADDR:18090gRPC listen address for backend usage ingestion.
OPEN_SPANNER_DB_DRIVERsqliteStorage driver: sqlite or postgres.
OPEN_SPANNER_SQLITE_PATHopen-spanner.dbSQLite database path.
OPEN_SPANNER_POSTGRES_DSNPostgres connection string when OPEN_SPANNER_DB_DRIVER=postgres.
OPEN_SPANNER_DB_MAX_OPEN_CONNS0Maximum open SQL connections; 0 keeps Go's default.
OPEN_SPANNER_DB_MAX_IDLE_CONNS0Maximum idle SQL connections; 0 keeps Go's default.
OPEN_SPANNER_DB_CONN_MAX_LIFETIME0Maximum SQL connection lifetime; 0 disables recycling.
OPEN_SPANNER_DB_CONN_MAX_IDLE_TIME0Maximum SQL connection idle time; 0 disables idle-time recycling.
OPEN_SPANNER_EXPORT_STORAGE_PATHopen-spanner-exportsDirectory used by the API and export worker for generated export files.
OPEN_SPANNER_EXPORT_WORKER_INTERVAL5sHow often the export worker checks for queued jobs.
OPEN_SPANNER_EXPORT_WORKER_LOCK_TTL5mLease duration for a claimed export job.
OPEN_SPANNER_EXPORT_WORKER_TIMEOUT10mMaximum processing time for one export job.
OPEN_SPANNER_EXPORT_WORKER_MAX_ATTEMPTS3Maximum claim attempts before expired running jobs stop being retried.
OPEN_SPANNER_ALERT_WORKER_INTERVAL5sHow often the alert worker checks for queued alert evaluations.
OPEN_SPANNER_ALERT_WORKER_LOCK_TTL5mLease duration for a claimed alert evaluation job.
OPEN_SPANNER_ALERT_WORKER_TIMEOUT1mMaximum processing time for one alert evaluation job.
OPEN_SPANNER_ALERT_WORKER_RETRY_AFTER30sHow long to wait before a failed alert evaluation can be claimed again.
OPEN_SPANNER_ALERT_WORKER_MAX_ATTEMPTS3Maximum claim attempts before expired running alert jobs stop being retried.
OPEN_SPANNER_ALERT_WORKER_BATCH_SIZE100Maximum alert jobs claimed in one worker polling cycle.
OPEN_SPANNER_RETENTION_PRUNE_ENABLEDfalseEnable automatic retention pruning.
OPEN_SPANNER_RETENTION_PRUNE_INTERVAL1hBackground prune interval.
OPEN_SPANNER_RETENTION_PRUNE_TIMEOUT30mMaximum duration for one background prune run.

Docker Compose Variables

These variables are read by docker-compose.app.yml before the Open Spanner container starts:

VariableDefaultDescription
OPEN_SPANNER_HTTP_PORT18081Host port published for the app container.
OPEN_SPANNER_GRPC_PORT18090Host port published for the app container's gRPC listener.
OPEN_SPANNER_POSTGRES_PASSWORDopen_spannerPassword for the bundled Postgres service and the app connection string.
OPEN_SPANNER_EXPORT_WORKER_INTERVAL5sPassed through to the export worker container.
OPEN_SPANNER_EXPORT_WORKER_LOCK_TTL5mPassed through to the export worker container.
OPEN_SPANNER_EXPORT_WORKER_TIMEOUT10mPassed through to the export worker container.
OPEN_SPANNER_EXPORT_WORKER_MAX_ATTEMPTS3Passed through to the export worker container.
OPEN_SPANNER_ALERT_WORKER_INTERVAL5sPassed through to the alert worker container.
OPEN_SPANNER_ALERT_WORKER_LOCK_TTL5mPassed through to the alert worker container.
OPEN_SPANNER_ALERT_WORKER_TIMEOUT1mPassed through to the alert worker container.
OPEN_SPANNER_ALERT_WORKER_RETRY_AFTER30sPassed through to the alert worker container.
OPEN_SPANNER_ALERT_WORKER_MAX_ATTEMPTS3Passed through to the alert worker container.
OPEN_SPANNER_ALERT_WORKER_BATCH_SIZE100Passed through to the alert worker container.
OPEN_SPANNER_RETENTION_PRUNE_ENABLEDfalsePassed through to the app container.

Postgres Example

OPEN_SPANNER_DB_DRIVER=postgres
OPEN_SPANNER_POSTGRES_DSN=postgres://user:password@db.example.com:5432/open_spanner?sslmode=require
OPEN_SPANNER_DB_MAX_OPEN_CONNS=25
OPEN_SPANNER_DB_MAX_IDLE_CONNS=25

On this page