Skip to main content

Configuration

Node Performance ships three binaries: cmd/api (REST, six Kafka consumers, recompute scheduler, outbox relay), cmd/mcp (read-only MCP) and cmd/a2a (read-only A2A agent). All of them are configured only through environment variables: there is no config file and no flag. REST, MCP and A2A are unauthenticated fleet-wide, so there is no token or key to configure.

The service runs on real Postgres (and, for cmd/api, real Kafka) only (ADR 0006). A missing mandatory variable is a boot error that names it, raised before anything is opened or bound. Test-only variables are not listed; the integration tests start their own containers with testcontainers.

A variable read by several binaries has a row in each table, with that binary's own default (the default of OTEL_SERVICE_NAME differs per binary).

cmd/api​

Source: cmd/api/config.go (loadConfig), cmd/api/telemetry.go (loadTelemetryEnv), internal/adapters/outbound/postgres/config.go.

VariableDefaultRequired?Meaning
DATABASE_URLnoneyesPostgres DSN of the service's pool (10 connections, statement_timeout = 5s). Boot error missing required environment variable: DATABASE_URL.
MIGRATIONS_DATABASE_URLvalue of DATABASE_URLnoDirect (non-pooled) DSN used only for the embedded boot migrations, because golang-migrate's session advisory lock does not survive a transaction-pooling PgBouncer. Empty falls back to DATABASE_URL.
KAFKA_BROKERSnoneyesComma-separated host:port list (entries trimmed, blanks dropped). Used by the consumers, the outbox relay and the /readyz broker check. Missing or blank is the boot error missing required environment variable: KAFKA_BROKERS (comma-separated host:port list). From the host the fleet's single broker is localhost:9092.
VENDOR_CONNECTIVITY_CONSUMER_GROUPnoneyesGroup id of the consumer of retailnetwork.vendor-connectivity.events. Never derived from the pod name: it is a chart value.
SHIPPING_AND_TRACKING_CONSUMER_GROUPnoneyesGroup id of the consumer of retailnetwork.shipping-and-tracking.events.
DELIVERY_PROMISE_CONSUMER_GROUPnoneyesGroup id of the consumer of retailnetwork.delivery-promise.events.
OFFER_AVAILABILITY_CONSUMER_GROUPnoneyesGroup id of the consumer of retailnetwork.offer-availability.events.
NODE_TOPOLOGY_CONSUMER_GROUPnoneyesGroup id of the consumer of retailnetwork.node-topology.events.
SELLER_INBOUND_CONSUMER_GROUPnoneyesGroup id of the consumer of retailnetwork.seller-inbound.events (the shipped instant of each inbound shipment, ADR 0009).
HTTP_ADDR:8080noListen address of the REST server (also serves /healthz and /readyz).
RECOMPUTE_INTERVAL1mnoTick of the recompute scheduler. A Go duration (30s) or plain seconds (30). Unparsable or non-positive values log a WARN and use the default.
OUTBOX_RELAY_INTERVAL1snoPoll interval of the outbox relay. Same parsing and fallback as RECOMPUTE_INTERVAL.
OUTBOX_MAX_ATTEMPTS20noFailures after which the relay stops claiming an outbox row. 0 = unlimited. Negative or unparsable values log a WARN and use 20, so a typo never removes the cap (ADR 0005).
SHUTDOWN_DRAIN_DELAY5snoAfter SIGINT/SIGTERM /readyz flips to 503 and the process waits this long before closing the listener. 0 disables the wait. Negative or unparsable values log a WARN and use 5s.
LOG_LEVELinfonodebug, info, warn (or warning), error, case-insensitive. Anything else falls back to info. Logs are JSON on stdout.
OTEL_SERVICE_NAMEnode-performancenoservice.name of spans and metrics, and the Loki app label.
OTEL_EXPORTER_OTLP_ENDPOINTlocalhost:4317noCollector OTLP/gRPC endpoint, bare host:port or a URL. A bare value is normalised to http://host:port. Export never blocks: an unreachable Collector costs telemetry, not availability.
SERVICE_VERSIONdevnoservice.version of every span and metric.
ENVIRONMENTlocalnodeployment.environment.name of every span and metric (read by telemetry.Setup).

Misconfiguration is refused first: loadConfig runs before telemetry, the database or the listener, so a bad environment never half-starts the service.

cmd/mcp​

Source: cmd/mcp/main.go (run), cmd/mcp/telemetry.go. A read-only MCP server over Streamable HTTP (ADR 0007). It reads the service database and never dials Kafka, so it has no KAFKA_BROKERS and no consumer group.

VariableDefaultRequired?Meaning
MCP_ADDR:8090noListen address.
DATABASE_URLnoneyesPostgres DSN of the database cmd/api owns. Missing 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 (this binary also runs the idempotent embedded migrations; the advisory lock makes concurrent starts safe).
LOG_LEVELinfonoAs for cmd/api.
OTEL_SERVICE_NAMEnode-performance-mcpnoservice.name of spans and metrics.
OTEL_EXPORTER_OTLP_ENDPOINTlocalhost:4317noCollector OTLP/gRPC endpoint.
SERVICE_VERSIONdevnoservice.version, also logged at boot.
ENVIRONMENTlocalnodeployment.environment.name, also logged at boot.

cmd/a2a​

Source: cmd/a2a/main.go (loadBootConfig, run), cmd/a2a/telemetry.go. A read-only Agent2Agent agent (ADR 0011). Like cmd/mcp it never dials Kafka.

VariableDefaultRequired?Meaning
A2A_ADDR:8093noListen address.
A2A_AGENT_URLnoneyesAbsolute http(s) URL of this agent's JSON-RPC endpoint, advertised on the Agent Card (for example http://<release>-a2a.<ns>.svc.cluster.local:8093/). Missing, relative or schemeless is a boot error naming it.
DATABASE_URLnoneyesPostgres DSN of the database cmd/api owns.
MIGRATIONS_DATABASE_URLvalue of DATABASE_URLnoDirect DSN for the boot migrations.
LOG_LEVELinfonoAs for cmd/api.
OTEL_SERVICE_NAMEnode-performance-a2anoservice.name of spans and metrics.
OTEL_EXPORTER_OTLP_ENDPOINTlocalhost:4317noCollector OTLP/gRPC endpoint.
SERVICE_VERSIONdevnoservice.version, also advertised on the Agent Card.
ENVIRONMENTlocalnodeployment.environment.name, also logged at boot.

loadBootConfig reports every mandatory problem at once (DATABASE_URL and A2A_AGENT_URL together) before telemetry, any connection and the listener.

Compiled-in settings (not configurable)​

Constants in the source; changing them needs a code change.

SettingValueSource
HTTP ReadHeaderTimeout5 s (all three binaries)cmd/api/config.go, cmd/mcp/main.go, cmd/a2a/main.go
HTTP graceful shutdown / per-worker drain timeout (cmd/api)10 s / 10 scmd/api/config.go (shutdownTimeout, workerDrainTimeout)
HTTP graceful shutdown (cmd/mcp, cmd/a2a)10 sshutdownTimeout in each main.go
Postgres pool size and statement timeout10 connections, statement_timeout = 5sinternal/adapters/outbound/postgres/pool.go
Boot retry (migrations, first ping)5 attempts, backoff 1 s, 2 s, 4 s, 8 sinternal/bootretry
Telemetry flush on shutdown5 stelemetryFlushTimeout in each telemetry.go
Metrics push interval15 sinternal/adapters/outbound/telemetry/telemetry.go (metricInterval)
/readyz verdict cache / check timeout3 s / 2 sinternal/adapters/inbound/http/readiness.go
Consumer handling attempts, backoff5 attempts, 200 ms doubling to 5 s, then <topic>.dlqinternal/adapters/inbound/kafka/deadletter.go, kafka.go
Minimum observations for a graded scorecard50 (below: PROVISIONAL, nothing published)internal/domain/scorecard (ADR 0002)

What is deliberately absent​

  • No auth variables. REST, MCP and A2A are unauthenticated; access control is the in-cluster ClusterIP boundary.
  • No in-memory or log-sink mode. cmd/** never imports the memory adapter; there is no *_MODE variable (the chart refuses one in extraEnv).
  • No Kafka variable on cmd/mcp and cmd/a2a. They can never publish.
  • Chart values. charts/node-performance maps these variables onto the pod (database.*, kafka.brokers, config.*, otel.*); see the Runbook. The chart deploys the api by default; mcp and a2a are opt-in.