Skip to main content

Configuration

yard-management ships five binaries (cmd/api, cmd/mcp, cmd/relay, cmd/yard-projector, cmd/yard-reports), all in one image. Each is configured only through environment variables: there is no config file, no flag and no secret-manager integration. REST, MCP and the reports are unauthenticated fleet-wide, so there is no token or key to configure.

There is no in-memory mode and no log sink. Every binary refuses to boot without its mandatory variables and names each missing one in a single boot error, raised before any connection is opened or any port is bound (ADR 0005, ADR 0008). Test-only variables do not exist: the integration tests start their own containers with testcontainers.

Every binary also reads the four observability variables of the fleet standard (ADR 0017); none is required.

Where the chart sets a variable, the Helm value is named in the last column (charts/yard-management/values.yaml). Source files are under cmd/<binary>/.

cmd/api​

Source: cmd/api/config.go, cmd/api/wire.go, cmd/api/main.go.

VariableDefaultRequired?MeaningChart value
HTTP_ADDR:8080noListen address of the REST server (also serves /healthz and /readyz).config.httpAddr
DATABASE_URLnoneyesPostgres DSN of the OLTP database. The embedded migrations run at boot; repositories, the outbox, the idempotency store and the processed-events table all live here.database.url or database.existingSecret
MIGRATIONS_DATABASE_URLvalue of DATABASE_URLnoDirect (non-pooled, session-mode) DSN used only for the boot migrations, because golang-migrate's advisory lock does not survive PgBouncer transaction pooling. Empty falls back to DATABASE_URL.database.migrationsExistingSecretKey
KAFKA_BROKERSnoneyesComma-separated broker list (trimmed, blanks dropped). Used by the three consumers and by the /readyz metadata check.kafka.brokers
DOCK_SCHEDULING_CONSUMER_GROUPnoneyesConsumer group of the warehouse.dock-scheduling.events consumer. Never defaulted: a process started by hand must not join a live group by accident.config.dockSchedulingConsumerGroup
FACILITY_CONSUMER_GROUPnoneyesConsumer group of the warehouse.facility.events consumer.config.facilityConsumerGroup
INBOUND_RECEIVING_CONSUMER_GROUPnoneyesConsumer group of the warehouse.inbound-receiving.events consumer.config.inboundReceivingConsumerGroup
ANALYTICS_READER_DATABASE_URLnonenoDSN of the read-only analytics reports role. Set: GET /reports/* on the API answers from the analytics schema. Unset: the report routes answer the contract shape with no rows.analytics.readerUrl (secret key analytics.readerExistingSecretKey, optional: true)
SHUTDOWN_DRAIN_DELAY5snoAfter SIGINT/SIGTERM /readyz flips to 503 and the process waits this long before closing the listener. Go duration, 0 disables the wait. A negative or unparsable value is a boot error.config.shutdownDrainDelay
LOG_LEVELinfonodebug, info, warn (or warning), error, case-insensitive. Anything else silently falls back to info. Logs are JSON on stdout.config.logLevel
OTEL_SERVICE_NAMEyard-managementnoservice.name of this binary's spans and metrics.otel.serviceName
OTEL_EXPORTER_OTLP_ENDPOINTlocalhost:4317noOTLP/gRPC endpoint of the Collector, host:port or a URL. Export never blocks: an unreachable Collector costs telemetry, not availability (ADR 0017).otel.endpoint (rendered only while otel.enabled)
SERVICE_VERSIONdevnoservice.version of the resource.serviceVersion, else image.tag, else the chart appVersion
ENVIRONMENTlocalnodeployment.environment.name of the resource (read by telemetry.Setup).environment

Boot errors are reported together, for example with an empty environment the process exits 1 with invalid configuration: followed by one line per missing variable (DATABASE_URL is required: the API runs on Postgres only, KAFKA_BROKERS is required: …, and one <GROUP> is required: the consumer group of … line per consumer).

cmd/mcp​

Source: cmd/mcp/config.go, cmd/mcp/wire.go.

VariableDefaultRequired?MeaningChart value
MCP_ADDR:8090noListen address of the Streamable HTTP MCP server (served at / and /mcp, plus /healthz and /readyz).mcp.httpAddr
DATABASE_URLnoneyesPostgres DSN of the same OLTP database as the API.database.url or database.existingSecret
MIGRATIONS_DATABASE_URLvalue of DATABASE_URLnoDirect DSN for the boot migrations. cmd/mcp migrates on start like the API, so it can boot against a fresh database; golang-migrate's advisory lock makes concurrent starts safe.database.migrationsExistingSecretKey
KAFKA_BROKERSnoneyesBrokers. This binary starts no relay and no consumer, but its writes enqueue outbox rows that cmd/relay drains and /readyz reports the broker, so a deployment without Kafka refuses to boot.kafka.brokers
SHUTDOWN_DRAIN_DELAY5snoAs for the API.config.shutdownDrainDelay
LOG_LEVELinfonoAs for the API.config.logLevel
OTEL_SERVICE_NAMEyard-management-mcpnoservice.name of this binary's spans and metrics.otel.serviceName with the suffix -mcp
OTEL_EXPORTER_OTLP_ENDPOINTlocalhost:4317noOTLP/gRPC endpoint of the Collector, host:port or a URL. Export never blocks: an unreachable Collector costs telemetry, not availability (ADR 0017).otel.endpoint (rendered only while otel.enabled)
SERVICE_VERSIONdevnoservice.version of the resource.serviceVersion, else image.tag, else the chart appVersion
ENVIRONMENTlocalnodeployment.environment.name of the resource (read by telemetry.Setup).environment

cmd/mcp has no consumer-group variable and no analytics variable: its get_yard_dwell_report tool answers no rows because the reader is not wired (cmd/mcp/wire.go, mcpDeps).

cmd/relay​

Source: cmd/relay/main.go. The relay does not run migrations: its poll fails and is retried until the API (or MCP) has created the schema.

VariableDefaultRequired?MeaningChart value
DATABASE_URLnoneyesPostgres DSN of the OLTP database holding the outbox table. Missing: exit code 2, DATABASE_URL is required.database.url or database.existingSecret
KAFKA_BROKERSnoneyesBrokers the relay publishes to. Missing: exit code 2, KAFKA_BROKERS is required.kafka.brokers
OUTBOX_POLL_INTERVAL1snoPause between polls. Go duration, must be positive: anything else is a boot error naming the variable.relay.outboxPollInterval
OUTBOX_MAX_ATTEMPTS20noFailures after which one outbox row is no longer claimed (a poison row cannot block the relay). 0 = unlimited. Negative or unparsable: WARN log and the default 20.relay.outboxMaxAttempts
RELAY_HEALTH_ADDR:8081noListen address of the /healthz liveness endpoint (the relay has no /readyz).relay.healthAddr
OTEL_SERVICE_NAMEyard-management-relaynoservice.name of this binary's spans and metrics.otel.serviceName with the suffix -relay
OTEL_EXPORTER_OTLP_ENDPOINTlocalhost:4317noOTLP/gRPC endpoint of the Collector, host:port or a URL. Export never blocks: an unreachable Collector costs telemetry, not availability (ADR 0017).otel.endpoint (rendered only while otel.enabled)
SERVICE_VERSIONdevnoservice.version of the resource.serviceVersion, else image.tag, else the chart appVersion
ENVIRONMENTlocalnodeployment.environment.name of the resource (read by telemetry.Setup).environment

The relay has no LOG_LEVEL: it always logs JSON at the default (info) level.

cmd/yard-projector​

Source: cmd/yard-projector/main.go. The only writer of the analytics schema.

VariableDefaultRequired?MeaningChart value
ANALYTICS_DATABASE_URLnoneyesDSN of the projector's role on the analytical database. Must be a direct connection: the projector runs the embedded analytical migrations through it at boot.analytics.url or analytics.existingSecret
KAFKA_BROKERSnoneyesBrokers of the analytics topic. Kafka is dialled lazily, so a broker outage at boot does not crash the process.kafka.brokers
ANALYTICS_CONSUMER_GROUPnoneyesFixed consumer group of the warehouse.yard-management.analytics consumer. A brand-new group replays from the earliest retained offset (the backfill).analytics.consumerGroup (chart default yard-management-analytics)
ADMIN_ADDR:8091noListen address of /healthz and /readyz.analytics.projector.adminAddr
LOG_LEVELinfonoAs for the API.config.logLevel
OTEL_SERVICE_NAMEyard-management-projectornoservice.name of this binary's spans and metrics.otel.serviceName with the suffix -projector
OTEL_EXPORTER_OTLP_ENDPOINTlocalhost:4317noOTLP/gRPC endpoint of the Collector, host:port or a URL. Export never blocks: an unreachable Collector costs telemetry, not availability (ADR 0017).otel.endpoint (rendered only while otel.enabled)
SERVICE_VERSIONdevnoservice.version of the resource.serviceVersion, else image.tag, else the chart appVersion
ENVIRONMENTlocalnodeployment.environment.name of the resource (read by telemetry.Setup).environment

cmd/yard-reports​

Source: cmd/yard-reports/main.go. Read-only: it never writes and never opens the OLTP tables.

VariableDefaultRequired?MeaningChart value
ANALYTICS_READER_DATABASE_URLnoneyes, unless ANALYTICS_DATABASE_URL is setDSN of the reports role (read-only grants).analytics.readerUrl
ANALYTICS_DATABASE_URLnonefallbackUsed when ANALYTICS_READER_DATABASE_URL is empty. One of the two is required.analytics.url or analytics.existingSecret
HTTP_ADDR:8092noListen address of the /reports/* routes plus /healthz and /readyz.analytics.reports.httpAddr
SHUTDOWN_DRAIN_DELAY5snoAs for the API.config.shutdownDrainDelay
LOG_LEVELinfonoAs for the API.config.logLevel
OTEL_SERVICE_NAMEyard-management-reportsnoservice.name of this binary's spans and metrics.otel.serviceName with the suffix -reports
OTEL_EXPORTER_OTLP_ENDPOINTlocalhost:4317noOTLP/gRPC endpoint of the Collector, host:port or a URL. Export never blocks: an unreachable Collector costs telemetry, not availability (ADR 0017).otel.endpoint (rendered only while otel.enabled)
SERVICE_VERSIONdevnoservice.version of the resource.serviceVersion, else image.tag, else the chart appVersion
ENVIRONMENTlocalnodeployment.environment.name of the resource (read by telemetry.Setup).environment

Readiness and liveness​

Binary/healthz/readyz is 200 only while
cmd/apiliveness, always 200not draining and Postgres answers a ping and a Kafka broker answers a topic-less metadata request
cmd/mcplivenesssame as the API
cmd/yard-projector (admin port)livenessnot draining and Postgres (analytical) pings and Kafka answers metadata
cmd/yard-reportslivenessnot draining and the read of the analytics freshness table succeeds: not ready until the projector has created the schema
cmd/relayliveness only (no /readyz)n/a

The readiness verdict is cached for 3 s and each check is bounded by 2 s (DefaultReadinessTTL, DefaultReadinessTimeout in internal/adapters/inbound/http/readiness.go).

Shutdown order​

SIGINT/SIGTERM on the API: /readyz flips to 503, the drain delay passes, the HTTP server drains (10 s bound), the three consumers stop (an interrupted message stays uncommitted and is redelivered), and the Postgres pool closes last. The chart's terminationGracePeriodSeconds (40 s for the API, refused below 20) leaves room for this sequence.