Skip to main content

Configuration

Checkout is configured only through environment variables. There is no config file and no flag. Each binary reads its own set; a variable that several binaries read has a row in each table with that binary's own default.

Rules common to all three binaries:

  • Misconfiguration is refused at boot, before a connection is opened or a port is bound, and the error names the variable. cmd/api additionally has no in-memory mode and no log-only sink: without Postgres and Kafka it does not start (cmd/api/config.go, ADR 0002).
  • Defaults below are the ones in the code. The Helm chart sets some of them differently (for example ENVIRONMENT=production and the in-cluster Collector address); the chart value that renders each variable is listed in the Runbook.
  • Durations are Go durations (500ms, 5s, 1m, 1h). The test-only variables of the integration suites are not listed.

cmd/api (REST, outbox relay, saga policies)​

VariableDefaultRequiredMeaning
HTTP_ADDR:8080noREST listen address. The chart requires its port to equal service.targetPort.
DATABASE_URLnoneyesPostgres DSN (the pooled one behind PgBouncer in the cluster). Unset is the boot error DATABASE_URL is required: this context runs on real Postgres, there is no in-memory mode.
MIGRATIONS_DATABASE_URLvalue of DATABASE_URLnoDirect (session-mode) DSN used only by the embedded migrations at boot.
KAFKA_BROKERSnoneyesComma-separated broker list for the outbox relay and the /readyz broker check. Blank entries are dropped; an empty list is the boot error KAFKA_BROKERS is required.
SHOPPING_CART_URLnoneyesBase URL of shopping-cart (GET /carts/{cartId}). Must be an absolute URL (scheme and host), else <VAR>: "<value>" is not an absolute URL.
DELIVERY_PROMISE_URLnoneyesBase URL of delivery-promise (GET /delivery-offers/{offerId}).
PRICING_URLnoneyesBase URL of pricing (POST /price-quotes).
CUSTOMER_PAYMENTS_URLnoneyesBase URL of customer-payments (authorize and void).
CUSTOMER_ORDERING_URLnoneyesBase URL of customer-ordering (POST /checkout).
SIBLING_TIMEOUT5snoPer-call timeout of the four fast siblings. Not a positive Go duration is a boot error.
CUSTOMER_ORDERING_TIMEOUT15snoTimeout of the place-order call, which promises and confirms every shipment group before it answers. Not a positive Go duration is a boot error.
INDOUBT_SWEEP_INTERVAL15snoTick of the policy ResolveInDoubtPlacements. Invalid or non-positive: warning invalid INDOUBT_SWEEP_INTERVAL; using the default.
STUCK_SWEEP_INTERVAL30snoTick of ResolveStuckAuthorizations. Same fallback rule.
VOID_SWEEP_INTERVAL1mnoTick of RetryOwedVoids. Same fallback rule.
EXPIRY_SWEEP_INTERVAL1mnoTick of ExpireOnQuoteExpiry. Same fallback rule.
PURGE_SWEEP_INTERVAL1hnoTick of PurgeStoredPlacements. Same fallback rule.
OUTBOX_RELAY_INTERVAL1snoSleep of the outbox relay after a pass that did not fill a batch. A Go duration or plain seconds (2, 0.5). Invalid or non-positive: warning and the default.
OUTBOX_MAX_ATTEMPTS20noFailures after which the relay stops claiming an outbox row. 0 is unlimited. Negative or unparsable: warning and 20, so a typo never removes the cap.
SHUTDOWN_DRAIN_DELAY5snoWait after /readyz flips to 503 before the listener closes. 0 disables it. Negative or unparsable: warning and 5s.
LOG_LEVELinfonodebug, info, warn (or warning), error, case-insensitive. Anything else is info.
OTEL_SERVICE_NAMEcheckoutnoservice.name of spans, metrics and the app label of the logs.
OTEL_EXPORTER_OTLP_ENDPOINTlocalhost:4317noOTLP/gRPC endpoint of the Collector, host:port or a URL. A bare host:port becomes plaintext http://. Export never blocks.
SERVICE_VERSIONdevnoservice.version of the telemetry resource.
ENVIRONMENTlocalnodeployment.environment.name of the telemetry resource.

cmd/mcp (read-only MCP server)​

VariableDefaultRequiredMeaning
MCP_ADDR:8090noListen address of the Streamable HTTP server (/mcp and /) and GET /healthz.
DATABASE_URLnoneyesPostgres DSN of the service database that cmd/api owns. Unset is the boot error DATABASE_URL is required: this context runs on real Postgres.
MIGRATIONS_DATABASE_URLvalue of DATABASE_URLnoDirect DSN for the boot migrations (the embedded migrations are idempotent, so the MCP pod may run them too).
LOG_LEVELinfonoAs for cmd/api.
OTEL_SERVICE_NAMEcheckout-mcpnoservice.name of spans and metrics.
OTEL_EXPORTER_OTLP_ENDPOINTlocalhost:4317noAs for cmd/api.
SERVICE_VERSIONdevnoservice.version.
ENVIRONMENTlocalnodeployment.environment.name.

This binary reads no Kafka, sibling or sweep variable: it never starts the relay or a policy and never dials Kafka or a sibling (ADR 0005).

cmd/a2a (read-only A2A agent)​

VariableDefaultRequiredMeaning
A2A_ADDR:8093noListen address of the JSON-RPC server (/ and /a2a), the Agent Card and GET /healthz.
A2A_AGENT_URLnoneyesAbsolute http(s) URL of this agent's JSON-RPC endpoint, advertised on the Agent Card (in the cluster http://<release>-a2a.<ns>.svc.cluster.local:8093/). Missing or not absolute is a boot error naming the variable, raised before telemetry and any connection.
DATABASE_URLnoneyesPostgres DSN of the service database. Reported together with A2A_AGENT_URL when both are missing.
MIGRATIONS_DATABASE_URLvalue of DATABASE_URLnoDirect DSN for the boot migrations.
LOG_LEVELinfonoAs for cmd/api.
OTEL_SERVICE_NAMEcheckout-a2anoservice.name of spans and metrics.
OTEL_EXPORTER_OTLP_ENDPOINTlocalhost:4317noAs for cmd/api.
SERVICE_VERSIONdevnoservice.version, also reported as the Agent Card version.
ENVIRONMENTlocalnodeployment.environment.name.

Things that are not configurable​

  • No consumer group. This context consumes no topic, so there is no *_CONSUMER_GROUP and the chart refuses one in extraEnv.
  • No mode switch. There is no *_MODE variable; the chart refuses one.
  • No authentication settings. REST, MCP and A2A are unauthenticated fleet-wide; there is nothing to configure.
  • Topic names (retailnetwork.checkout.events, retailnetwork.checkout.analytics) are constants in internal/adapters/outbound/kafka/encoder.go.
  • Timings of the saga are constants of the domain, not settings: stuck authorization after 2 minutes, in-doubt alert at 20 h, give-up at 22 h, stored-placement purge 24 h after a closed state, offer margin 2 minutes, in-doubt backoff from 30 s doubling up to 15 minutes (internal/domain/checkoutsession).
  • OTEL_RESOURCE_ATTRIBUTES is honoured by the OpenTelemetry SDK resource detector in addition to the variables above.