Skip to main content

Configuration

Delivery Promise ships three binaries. Each reads its own environment; there is no config file and no flag parsing. A variable that several binaries read has a row in each table below, with that binary's own default. Test-only variables are left out.

Missing or malformed mandatory variables are refused before anything is opened or bound: the boot error names the variable (cmd/api/config.go, cmd/a2a/main.go, cmd/mcp/main.go). The Helm chart (charts/delivery-promise) renders exactly these variables, see Runbook.

Durations accept a Go duration (500ms, 2s) or a plain number of seconds. An unset, malformed or non-positive value logs a warning and uses the default (parseDuration in cmd/api/config.go), except where a row says otherwise.

cmd/api (REST API, consumer, sweeper, outbox relay)​

Source: cmd/api/config.go, cmd/api/telemetry.go, cmd/api/workers.go, cmd/api/main.go.

VariableDefaultRequired?Meaning
HTTP_ADDR:8080noListen address of the REST server. Keep the chart's service.targetPort in step.
DATABASE_URLnoneyesPostgres DSN of the runtime pool. Unset: DATABASE_URL is required: this service runs on real Postgres, there is no in-memory mode.
MIGRATIONS_DATABASE_URLvalue of DATABASE_URLnoDirect (non-pooled) DSN used only for the boot migrations. golang-migrate takes a session advisory lock that a transaction pooler such as PgBouncer cannot honour.
KAFKA_BROKERSnoneyesComma-separated host:port list used by the relay, the consumer and /readyz. Blank entries are dropped; an empty list is a boot error.
DELIVERY_PROMISE_CONSUMER_GROUPnoneyesStable consumer group of the inbound consumer of the eight producer topics. Never derive it from the pod name.
EVENT_PUBLISHERempty (means kafka)noOnly kafka (or empty) is accepted; any other value is a boot error (EVENT_PUBLISHER=<x> is not supported). The log sink does not exist.
OUTBOX_RELAY_INTERVAL1snoPoll interval of the outbox relay.
DELIVERY_REQUEST_FACTS_ENABLEDfalsenoSwitches on the best-effort request-level coverage fact (ADR 0032): one DeliveryRequestAnswered analytics event per quote or estimate answered with 200, handed over after the response through a bounded in-memory queue and one background worker. Unset, empty or not a boolean (a typo logs a warning) is off. Chart value config.requestFactsEnabled, default false.
DELIVERY_REQUEST_FACTS_QUEUE_SIZE1000noCapacity of that queue, 1 to 100000; a value out of range warns and takes the default. A full queue drops the newest fact and counts it (deliverypromise_request_facts_dropped_total{reason="queue_full"}). Chart value config.requestFactsQueueSize.
DELIVERY_REQUEST_FACTS_FLUSH_INTERVAL1snoHow often the worker drains the queue, one outbox row per fact in its own short transaction (Go duration or seconds). Chart value config.requestFactsFlushInterval.
OUTBOX_MAX_ATTEMPTS20noFailures before the relay excludes an outbox row. 0 means unlimited; a negative or unparsable value warns and falls back to 20, so a typo never removes the cap.
SWEEP_INTERVAL15snoHow often the clock-driven sweeper runs its five passes (batch of 100 each).
SHUTDOWN_DRAIN_DELAY5snoWait between flipping /readyz to 503 and closing the listener. 0 disables the wait; a negative or unparsable value warns and uses 5s.
LOG_LEVELinfonodebug, info, warn (or warning), error, case-insensitive; anything else is info.
OTEL_SERVICE_NAMEdelivery-promisenoservice.name of spans, metrics and the Loki app label.
OTEL_EXPORTER_OTLP_ENDPOINTlocalhost:4317noCollector OTLP/gRPC endpoint, host:port or full URL (a bare host:port becomes http://host:port). Export never blocks: an unreachable Collector drops telemetry, it does not stop the service.
SERVICE_VERSIONdevnoservice.version resource attribute.
ENVIRONMENTlocalnodeployment.environment.name resource attribute (read by telemetry.Setup).

The shutdown bounds that are not configurable: HTTP drain 10 s, consumer and sweeper await 10 s, relay await 10 s, telemetry flush 5 s. The chart refuses a terminationGracePeriodSeconds that does not exceed SHUTDOWN_DRAIN_DELAY + 40 s.

cmd/mcp (read-only MCP server)​

Source: cmd/mcp/main.go, cmd/mcp/telemetry.go. This binary never dials Kafka and never runs the relay, consumer or sweeper, so it reads no KAFKA_BROKERS, no consumer group and no EVENT_PUBLISHER.

VariableDefaultRequired?Meaning
MCP_ADDR:8090noListen address of the Streamable HTTP server (/mcp).
DATABASE_URLnoneyesPostgres DSN of the service database that cmd/api owns. Unset is a boot error.
MIGRATIONS_DATABASE_URLvalue of DATABASE_URLnoDirect DSN for the idempotent boot migrations (this binary can boot against a fresh database before cmd/api has).
LOG_LEVELinfonodebug, info, warn, error.
OTEL_SERVICE_NAMEdelivery-promise-mcpnoservice.name of spans and metrics.
OTEL_EXPORTER_OTLP_ENDPOINTlocalhost:4317noCollector OTLP/gRPC endpoint; export never blocks.
SERVICE_VERSIONdevnoservice.version; also in the boot log line.
ENVIRONMENTlocalnodeployment.environment.name; also in the boot log line.

cmd/a2a (read-only A2A agent)​

Source: cmd/a2a/main.go, cmd/a2a/telemetry.go. Like cmd/mcp, it never touches Kafka.

VariableDefaultRequired?Meaning
A2A_ADDR:8093noListen address of the JSON-RPC server.
A2A_AGENT_URLnoneyesAbsolute http(s) URL advertised on the Agent Card, for example http://delivery-promise-a2a.<namespace>.svc.cluster.local:8093/. A missing value, a non-http(s) scheme or an empty host is a boot error; there is no default the binary could guess.
DATABASE_URLnoneyesPostgres DSN of the service database. Unset is a boot error.
MIGRATIONS_DATABASE_URLvalue of DATABASE_URLnoDirect DSN for the boot migrations.
LOG_LEVELinfonodebug, info, warn, error.
OTEL_SERVICE_NAMEdelivery-promise-a2anoservice.name of spans and metrics.
OTEL_EXPORTER_OTLP_ENDPOINTlocalhost:4317noCollector OTLP/gRPC endpoint; export never blocks.
SERVICE_VERSIONdevnoservice.version, also the version on the Agent Card.
ENVIRONMENTlocalnodeployment.environment.name; also in the boot log line.

cmd/dp-projector (analytics projector, ADR 0018)​

Writes ONLY the separate analytical database; never opens the OLTP database. Reads this context's own retailnetwork.delivery-promise.events and retailnetwork.delivery-promise.analytics, dead-letters poison to retailnetwork.delivery-promise.analytics.dlq. Serves /healthz and /readyz on the admin port.

VariableDefaultRequiredMeaningChart value
ANALYTICS_DATABASE_URLnoneyesDirect DSN of the analytical database (read-write; runs the embedded analytical migrations).analytics.database.projectorUrl or analytics.database.existingSecret
KAFKA_BROKERSnoneyesComma-separated brokers.kafka.brokers
ANALYTICS_CONSUMER_GROUPdelivery-promise-analyticsnoThe projector's fixed consumer group.analytics.projector.consumerGroup
ADMIN_ADDR:8091no/healthz and /readyz listen address.analytics.projector.adminAddr
LOG_LEVELinfonodebug, info, warn/warning, error.analytics.logLevel
OTEL_SERVICE_NAMEdelivery-promise-projectornoservice.name.otel.serviceName + -projector
OTEL_EXPORTER_OTLP_ENDPOINTlocalhost:4317noCollector OTLP/gRPC endpoint.otel.endpoint
SERVICE_VERSIONdevnoservice.version.image tag
ENVIRONMENTlocalnodeployment.environment.name.environment

cmd/dp-reports (read-only analytics reports, ADR 0018)​

GET /reports/promise-reliability, /reports/promise-precision, /reports/quote-conversion, /reports/freshness, /healthz, /readyz over a read-only pool (15s statement timeout). No Kafka, no OLTP database. /reports/quote-conversion also carries the promiseCoverage block (ADR 0030); it needs no setting. Its request-based fields (requestsAnswered, requestsWithPromise, requestsWithinDays, requestShare, ADR 0032) are 0/null until cmd/api runs with DELIVERY_REQUEST_FACTS_ENABLED=true; deploy cmd/dp-projector before cmd/dp-reports and before switching the flag on.

VariableDefaultRequiredMeaningChart value
ANALYTICS_READER_DATABASE_URLvalue of ANALYTICS_DATABASE_URLyes (one of the two)DSN of a read-only role on the analytical database.analytics.database.reportsUrl (falls back to projectorUrl)
ANALYTICS_DATABASE_URLnonenoSingle-role local fallback; the chart never renders it for the reports pod.not rendered
HTTP_ADDR:8092noListen address.analytics.reports.httpAddr
LOG_LEVELinfonoAs above.analytics.logLevel
OTEL_SERVICE_NAMEdelivery-promise-reportsnoservice.name.otel.serviceName + -reports
OTEL_EXPORTER_OTLP_ENDPOINTlocalhost:4317noCollector OTLP/gRPC endpoint.otel.endpoint
SERVICE_VERSIONdevnoservice.version.image tag
ENVIRONMENTlocalnodeployment.environment.name.environment

Notes​

  • The OpenTelemetry SDK additionally honours the standard OTEL_RESOURCE_ATTRIBUTES through resource.Default(); the service does not read it itself.
  • telemetry.Setup rewrites OTEL_EXPORTER_OTLP_ENDPOINT in place when it holds a bare host:port, so the exporters do not log a parse error at every start (internal/adapters/outbound/telemetry/telemetry.go).
  • There is no authentication variable on any binary: REST, MCP and A2A are unauthenticated and rely on the in-cluster boundary.
  • For local values that work out of the box see Quickstart.