Skip to main content

Configuration

Six binaries ship in one image (/app/api, /app/mcp, /app/relay, /app/projector, /app/reports, /app/sweep). Each reads its own environment; there is no config file and no in-memory or log-sink mode. A missing required variable is a boot error that names the variable, and several missing variables are reported together.

Source: cmd/api/config.go, cmd/mcp/config.go, cmd/relay/config.go, cmd/projector/main.go (loadConfig), cmd/reports/main.go (loadConfig), cmd/sweep/sweep.go (loadConfig), internal/config/config.go.

Duration variables (OUTBOX_RELAY_INTERVAL, SHUTDOWN_DRAIN_DELAY) accept a Go duration (500ms, 2s) or plain seconds (2). A malformed or out-of-range value is not fatal: the binary logs a warning naming the variable and uses the default.

cmd/api (REST API, outbox relay and Kafka consumers in one process)​

VariableDefaultRequiredMeaning
DATABASE_URLnoneyesPostgres DSN of the OLTP database (runtime pool).
MIGRATIONS_DATABASE_URLvalue of DATABASE_URLnoDirect (non-pooled) DSN used only for the boot migrations, because golang-migrate takes a session-scoped advisory lock that PgBouncer transaction pooling cannot honour.
KAFKA_BROKERSnoneyesComma-separated bootstrap servers for the relay, the consumers and the /readyz broker check.
YARD_CONSUMER_GROUPnoneyesConsumer group of the yard-management consumer (warehouse.yard-management.events).
FACILITY_CONSUMER_GROUPnoneyesConsumer group of the facility-layout consumer (warehouse.facility.events).
ASN_CONSUMER_GROUPnoneyesConsumer group of the inbound-receiving ASN consumer (warehouse.inbound-receiving.events).
CPT_CONSUMER_GROUPnoneyesConsumer group of the process-path-management cutoff consumer (warehouse.process-path-management.events).
HTTP_ADDR:8080noListen address of the REST API.
OUTBOX_RELAY_INTERVAL1snoPoll interval of the in-process outbox relay.
OUTBOX_BATCH_SIZE100noOutbox rows claimed per relay pass.
OUTBOX_MAX_ATTEMPTS20noFailures before the relay excludes a row from claims. 0 means unlimited; a negative or unparsable value falls back to 20 with a warning.
SHUTDOWN_DRAIN_DELAY5snoHow long the process keeps serving after /readyz flips to 503. 0 is valid.
LOG_LEVELinfonodebug, info, warn (or warning), error; case-insensitive; anything else is info.

cmd/mcp (MCP server, Streamable HTTP)​

cmd/mcp starts no relay and no consumer, yet it requires KAFKA_BROKERS: its writes enqueue outbox rows that a relay (inline in cmd/api, or cmd/relay) drains, and /readyz reports the broker.

VariableDefaultRequiredMeaning
DATABASE_URLnoneyesPostgres DSN of the OLTP database.
MIGRATIONS_DATABASE_URLvalue of DATABASE_URLnoDirect DSN for the boot migrations (the MCP binary also runs them).
KAFKA_BROKERSnoneyesBootstrap servers, used by /readyz only.
MCP_ADDR:8090noListen address of the MCP server.
SHUTDOWN_DRAIN_DELAY5snoWait after /readyz flips to 503.
LOG_LEVELinfonoSame values as cmd/api.

cmd/relay (stand-alone outbox relay)​

Optional: cmd/api already relays inline. It does not run migrations (the schema belongs to the API's boot) and does not read LOG_LEVEL (JSON logs to stderr at the default level).

VariableDefaultRequiredMeaning
DATABASE_URLnoneyesPostgres DSN of the OLTP outbox.
KAFKA_BROKERSnoneyesBootstrap servers the relay writes to.
OUTBOX_RELAY_INTERVAL1snoPoll interval.
OUTBOX_BATCH_SIZE100noRows per pass.
OUTBOX_MAX_ATTEMPTS20noFailure cap per row; 0 = unlimited.
ADMIN_ADDR:8094noListen address of the GET /healthz probe server.

cmd/projector (analytics writer)​

Consumes the service's own warehouse.dock-scheduling.analytics topic and is the only writer of the analytical database. It never opens the OLTP database.

VariableDefaultRequiredMeaning
ANALYTICS_DATABASE_URLnoneyesDSN of the analytical Postgres, direct, with the projector's own read-write role (the binary runs the embedded analytical migrations over it).
KAFKA_BROKERSnoneyesBootstrap servers of the analytics consumer and /readyz.
ANALYTICS_CONSUMER_GROUPnoneyesFixed consumer group of the projector (the chart defaults it to dock-scheduling-analytics). A brand-new group starts at the earliest offset and rebuilds the model from history.
ADMIN_ADDR:8091noListen address of /healthz and /readyz.
SHUTDOWN_DRAIN_DELAY5snoWait after /readyz flips to 503.
LOG_LEVELinfonoSame values as cmd/api.

cmd/reports (analytics reader)​

Read-only HTTP reader over the analytical database. It never opens the OLTP database or Kafka.

VariableDefaultRequiredMeaning
ANALYTICS_DATABASE_URLnoneyesDSN of the analytical Postgres, ideally a read-only role (the chart feeds it from the secret key ANALYTICS_READER_DATABASE_URL).
HTTP_ADDR:8092noListen address of the reports API.
SHUTDOWN_DRAIN_DELAY5snoWait after /readyz flips to 503.
LOG_LEVELinfonoSame values as cmd/api.

cmd/sweep (no-show sweep CronJob entrypoint)​

A one-shot process: it POSTs SWEEP_URL with a fresh Idempotency-Key, retries transient failures and exits. Exit codes: 0 ok, 1 gave up or rejected, 2 invalid configuration. It asks the Istio sidecar to quit on every exit path.

VariableDefaultRequiredMeaning
SWEEP_URLnoneyesEndpoint to POST; the chart renders http://<release>:<service.port>/no-show-sweeps.
SWEEP_REQUEST_TIMEOUT15snoPer-attempt timeout, positive Go duration.
SWEEP_MAX_ATTEMPTS4noAttempts before giving up, integer >= 1.
SWEEP_RETRY_BACKOFF1snoFirst backoff; doubles per attempt.
SWEEP_MAX_BACKOFF8snoBackoff cap.
SIDECAR_QUIT_URLhttp://127.0.0.1:15020/quitquitquitnoIstio quit endpoint; set it empty to disable (outside a mesh).

Retryable outcomes: transport error, timeout, HTTP 429 and 5xx. Any other non-2xx status stops the sweep at once. Defaults give a worst case of 4 x 15 s + 3 x 8 s = 84 s, inside the chart's activeDeadlineSeconds: 120.

Variables the chart renders that no binary reads​

The Helm chart renders OTEL_EXPORTER_OTLP_ENDPOINT (otel.enabled, default true) and carries an environment value, but no Go code in this repository reads them: the telemetry adapter is Prometheus only (see Observability). They are harmless and listed here so nobody hunts for them in the code.

Where the values come from​

Helm values map one to one onto the variables above (config.*, database.*, kafka.brokers, mcp.*, relay.*, analytics.*, sweeps.*). See the runbook.