Configuration
Environment Variables
Runtime configuration for the Open Spanner service.
| Variable | Default | Description |
|---|---|---|
OPEN_SPANNER_HTTP_ADDR | :18081 | API listen address. |
OPEN_SPANNER_GRPC_ADDR | :18090 | gRPC listen address for backend usage ingestion. |
OPEN_SPANNER_DB_DRIVER | sqlite | Storage driver: sqlite or postgres. |
OPEN_SPANNER_SQLITE_PATH | open-spanner.db | SQLite database path. |
OPEN_SPANNER_POSTGRES_DSN | Postgres connection string when OPEN_SPANNER_DB_DRIVER=postgres. | |
OPEN_SPANNER_DB_MAX_OPEN_CONNS | 0 | Maximum open SQL connections; 0 keeps Go's default. |
OPEN_SPANNER_DB_MAX_IDLE_CONNS | 0 | Maximum idle SQL connections; 0 keeps Go's default. |
OPEN_SPANNER_DB_CONN_MAX_LIFETIME | 0 | Maximum SQL connection lifetime; 0 disables recycling. |
OPEN_SPANNER_DB_CONN_MAX_IDLE_TIME | 0 | Maximum SQL connection idle time; 0 disables idle-time recycling. |
OPEN_SPANNER_EXPORT_STORAGE_PATH | open-spanner-exports | Directory used by the API and export worker for generated export files. |
OPEN_SPANNER_EXPORT_WORKER_INTERVAL | 5s | How often the export worker checks for queued jobs. |
OPEN_SPANNER_EXPORT_WORKER_LOCK_TTL | 5m | Lease duration for a claimed export job. |
OPEN_SPANNER_EXPORT_WORKER_TIMEOUT | 10m | Maximum processing time for one export job. |
OPEN_SPANNER_EXPORT_WORKER_MAX_ATTEMPTS | 3 | Maximum claim attempts before expired running jobs stop being retried. |
OPEN_SPANNER_ALERT_WORKER_INTERVAL | 5s | How often the alert worker checks for queued alert evaluations. |
OPEN_SPANNER_ALERT_WORKER_LOCK_TTL | 5m | Lease duration for a claimed alert evaluation job. |
OPEN_SPANNER_ALERT_WORKER_TIMEOUT | 1m | Maximum processing time for one alert evaluation job. |
OPEN_SPANNER_ALERT_WORKER_RETRY_AFTER | 30s | How long to wait before a failed alert evaluation can be claimed again. |
OPEN_SPANNER_ALERT_WORKER_MAX_ATTEMPTS | 3 | Maximum claim attempts before expired running alert jobs stop being retried. |
OPEN_SPANNER_ALERT_WORKER_BATCH_SIZE | 100 | Maximum alert jobs claimed in one worker polling cycle. |
OPEN_SPANNER_RETENTION_PRUNE_ENABLED | false | Enable automatic retention pruning. |
OPEN_SPANNER_RETENTION_PRUNE_INTERVAL | 1h | Background prune interval. |
OPEN_SPANNER_RETENTION_PRUNE_TIMEOUT | 30m | Maximum duration for one background prune run. |
Docker Compose Variables
These variables are read by docker-compose.app.yml before the Open Spanner container starts:
| Variable | Default | Description |
|---|---|---|
OPEN_SPANNER_HTTP_PORT | 18081 | Host port published for the app container. |
OPEN_SPANNER_GRPC_PORT | 18090 | Host port published for the app container's gRPC listener. |
OPEN_SPANNER_POSTGRES_PASSWORD | open_spanner | Password for the bundled Postgres service and the app connection string. |
OPEN_SPANNER_EXPORT_WORKER_INTERVAL | 5s | Passed through to the export worker container. |
OPEN_SPANNER_EXPORT_WORKER_LOCK_TTL | 5m | Passed through to the export worker container. |
OPEN_SPANNER_EXPORT_WORKER_TIMEOUT | 10m | Passed through to the export worker container. |
OPEN_SPANNER_EXPORT_WORKER_MAX_ATTEMPTS | 3 | Passed through to the export worker container. |
OPEN_SPANNER_ALERT_WORKER_INTERVAL | 5s | Passed through to the alert worker container. |
OPEN_SPANNER_ALERT_WORKER_LOCK_TTL | 5m | Passed through to the alert worker container. |
OPEN_SPANNER_ALERT_WORKER_TIMEOUT | 1m | Passed through to the alert worker container. |
OPEN_SPANNER_ALERT_WORKER_RETRY_AFTER | 30s | Passed through to the alert worker container. |
OPEN_SPANNER_ALERT_WORKER_MAX_ATTEMPTS | 3 | Passed through to the alert worker container. |
OPEN_SPANNER_ALERT_WORKER_BATCH_SIZE | 100 | Passed through to the alert worker container. |
OPEN_SPANNER_RETENTION_PRUNE_ENABLED | false | Passed 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