Open Spanner
Configuration

Environment Variables

Runtime configuration for the Open Spanner service.

VariableDefaultDescription
OPEN_SPANNER_HTTP_ADDR:18080Internal API, health, readiness, and metrics listen address.
OPEN_SPANNER_GRPC_ADDR:18090gRPC listen address for backend usage ingestion.
OPEN_SPANNER_EXPORT_WORKER_HEALTH_ADDR:18082Export-worker liveness and readiness listen address.
OPEN_SPANNER_ALERT_WORKER_HEALTH_ADDR:18083Alert-worker liveness and readiness listen address.
OPEN_SPANNER_ENTITLEMENT_WORKER_HEALTH_ADDR:18084Entitlement-worker liveness and readiness listen address.
OPEN_SPANNER_USAGE_WORKER_HEALTH_ADDR:18085Usage-outbox-worker liveness and readiness listen address.
OPEN_SPANNER_INGESTION_MAX_BODY_BYTES1048576Maximum REST usage request body and gRPC receive message size in bytes.
OPEN_SPANNER_INGESTION_MAX_BULK_EVENTS1000Maximum events in one REST or unary gRPC bulk ingestion request.
OPEN_SPANNER_INGESTION_MAX_STREAM_EVENTS1000Maximum events accepted by one gRPC client stream.
OPEN_SPANNER_INGESTION_RATE_LIMIT_EVENTS10000Events each workspace may submit during one ingestion rate window.
OPEN_SPANNER_INGESTION_RATE_LIMIT_WINDOW1mFixed window used by the database-backed, cross-replica ingestion limiter.
OPEN_SPANNER_REGISTRATION_ENABLEDtrueAllows new password and OAuth dashboard accounts. Existing users can still sign in when disabled.
OPEN_SPANNER_GITHUB_OAUTH_ENABLEDtrueEnables GitHub OAuth login when credentials are configured.
OPEN_SPANNER_GITHUB_OAUTH_CLIENT_IDEnables GitHub OAuth login when set with OPEN_SPANNER_GITHUB_OAUTH_CLIENT_SECRET.
OPEN_SPANNER_GITHUB_OAUTH_CLIENT_SECRETGitHub OAuth client secret.
OPEN_SPANNER_GITHUB_OAUTH_REDIRECT_URLOptional GitHub OAuth callback URL; defaults to the request host plus /v1/auth/oauth/github/callback.
OPEN_SPANNER_GOOGLE_OAUTH_ENABLEDtrueEnables Google OAuth/OIDC login when credentials are configured.
OPEN_SPANNER_GOOGLE_OAUTH_CLIENT_IDEnables Google OAuth/OIDC login when set with OPEN_SPANNER_GOOGLE_OAUTH_CLIENT_SECRET.
OPEN_SPANNER_GOOGLE_OAUTH_CLIENT_SECRETGoogle OAuth client secret.
OPEN_SPANNER_GOOGLE_OAUTH_REDIRECT_URLOptional Google OAuth callback URL; defaults to the request host plus /v1/auth/oauth/google/callback.
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 owned by this process; 0 keeps Go's default. Budget this per API or worker deployment.
OPEN_SPANNER_DB_MAX_IDLE_CONNS0Maximum idle SQL connections owned by this process; 0 keeps Go's default and a configured value cannot exceed the open limit.
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_STORAGE_DRIVERfilesystemExport artifact backend: filesystem or s3. The API and export workers must use identical settings.
OPEN_SPANNER_EXPORT_S3_BUCKETemptyBucket used by S3 export storage. Required when the driver is s3.
OPEN_SPANNER_EXPORT_S3_REGIONus-east-1S3 signing region.
OPEN_SPANNER_EXPORT_S3_ENDPOINTemptyOptional absolute endpoint URL for S3-compatible services.
OPEN_SPANNER_EXPORT_S3_ACCESS_KEY_IDemptyOptional static access key. When omitted, the AWS default credential chain is used.
OPEN_SPANNER_EXPORT_S3_SECRET_ACCESS_KEYemptyStatic secret key; must be set with the access key.
OPEN_SPANNER_EXPORT_S3_SESSION_TOKENemptyOptional token for temporary static credentials.
OPEN_SPANNER_EXPORT_S3_PREFIXemptyObject key prefix for export artifacts.
OPEN_SPANNER_EXPORT_S3_FORCE_PATH_STYLEendpoint-dependentUses path-style bucket addressing. Defaults to true for custom endpoints and false for AWS.
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_MAX_ATTEMPTS3Maximum claim attempts before expired running jobs stop being retried.
OPEN_SPANNER_EXPORT_RETENTION168hHow long completed export artifacts remain downloadable. Job history is retained after expiration.
OPEN_SPANNER_EXPORT_CLEANUP_INTERVAL1hHow often the export worker cleans expired artifacts.
OPEN_SPANNER_EXPORT_CLEANUP_BATCH_SIZE1000Maximum artifacts considered in one cleanup run.
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_ENTITLEMENT_WORKER_INTERVAL5sHow often the entitlement worker checks for queued quota state jobs.
OPEN_SPANNER_ENTITLEMENT_WORKER_LOCK_TTL5mLease duration for a claimed entitlement job.
OPEN_SPANNER_ENTITLEMENT_WORKER_TIMEOUT1mMaximum processing time for one entitlement state job.
OPEN_SPANNER_ENTITLEMENT_WORKER_RETRY_AFTER30sHow long to wait before a failed entitlement job can be claimed again.
OPEN_SPANNER_ENTITLEMENT_WORKER_MAX_ATTEMPTS3Maximum claim attempts before expired running entitlement jobs stop being retried.
OPEN_SPANNER_ENTITLEMENT_WORKER_BATCH_SIZE100Maximum entitlement jobs claimed in one worker polling cycle.
OPEN_SPANNER_USAGE_WORKER_INTERVAL1sHow often the usage worker checks for committed outbox messages.
OPEN_SPANNER_USAGE_WORKER_LOCK_TTL1mLease duration for a claimed usage outbox message.
OPEN_SPANNER_USAGE_WORKER_TIMEOUT30sMaximum time for one alert-and-entitlement fanout attempt.
OPEN_SPANNER_USAGE_WORKER_RETRY_AFTER5sInitial retry delay after failed fanout; subsequent retries back off exponentially.
OPEN_SPANNER_USAGE_WORKER_MAX_ATTEMPTS10Attempts before a usage outbox message enters dead-letter state.
OPEN_SPANNER_USAGE_WORKER_BATCH_SIZE100Maximum usage messages drained in one 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.
OPEN_SPANNER_RECONCILIATION_ENABLEDfalseEnable scheduled read-only reconciliation monitoring.
OPEN_SPANNER_RECONCILIATION_POLL_INTERVAL5sSchedule and notification polling interval.
OPEN_SPANNER_RECONCILIATION_SCHEDULE15mInterval between scans for each workspace.
OPEN_SPANNER_RECONCILIATION_LOCK_TTL5mClaim lease for scans and notification deliveries.
OPEN_SPANNER_RECONCILIATION_TIMEOUT2mMaximum duration for one worker iteration.
OPEN_SPANNER_RECONCILIATION_RETRY_AFTER1mScan retry delay and initial webhook retry delay.
OPEN_SPANNER_RECONCILIATION_STALE_AFTER30mGrace period before an overdue schedule is marked stale.
OPEN_SPANNER_RECONCILIATION_LIMIT100Decisions and counters inspected per scheduled scan.
OPEN_SPANNER_RECONCILIATION_LOOKBACK_HOURS24Decision history inspected by scheduled scans.
OPEN_SPANNER_RECONCILIATION_MAX_ATTEMPTS5Webhook attempts before dead-letter state.
OPEN_SPANNER_RECONCILIATION_WEBHOOK_URLemptyOptional reconciliation notification endpoint.
OPEN_SPANNER_RECONCILIATION_WEBHOOK_SECRETemptyOptional HMAC-SHA256 webhook signing secret.
OPEN_SPANNER_CONSUMPTION_DECISION_RETENTION720hRetention window for accepted and rejected consume decisions.
OPEN_SPANNER_OPERATIONAL_HISTORY_RETENTION720hRetention window for terminal operational audit, job, delivery, and maintenance-run history.
OPEN_SPANNER_OPERATIONAL_HISTORY_INTERVAL1hInterval between operational-history cleanup passes.
OPEN_SPANNER_OPERATIONAL_HISTORY_TIMEOUT5mMaximum duration of one operational-history cleanup pass.
OPEN_SPANNER_OPERATIONAL_HISTORY_BATCH_SIZE1000Maximum rows deleted from each eligible table per pass; range 1–10,000.

The Next.js web process uses one runtime variable:

VariableDefaultDescription
OPEN_SPANNER_API_PROXY_URLhttp://127.0.0.1:18080Private API origin used for /v1 requests. Do not point this at the public web origin.
  • See Auth Model for registration and OAuth setup.
  • See Production Deployment for per-process connection budgets, worker topology, storage, and networking.
  • Use the repository .env.example as the complete Docker Compose template; Compose-only port, password, and per-process pool variables are documented inline there.

Postgres Example

OPEN_SPANNER_DB_DRIVER=postgres
OPEN_SPANNER_POSTGRES_DSN=postgres://user:[email protected]:5432/open_spanner?sslmode=require
OPEN_SPANNER_DB_MAX_OPEN_CONNS=25
OPEN_SPANNER_DB_MAX_IDLE_CONNS=25

On this page