Skip to main content

Configuration

Pricing ships three binaries (cmd/api, cmd/a2a and cmd/mcp). All are configured only through environment variables and all refuse to boot, naming the variable, when a mandatory one is missing. There is no in-memory mode, no *_MODE switch, no auth variable and no file-based configuration. The Helm chart (charts/pricing) renders each variable from a values.yaml key; see the runbook for the chart side.

Source: cmd/api/config.go, cmd/api/main.go, cmd/api/policies.go, cmd/api/telemetry.go, cmd/a2a/config.go, cmd/a2a/main.go, cmd/a2a/telemetry.go, cmd/mcp/config.go, cmd/mcp/main.go, cmd/mcp/telemetry.go, internal/adapters/outbound/telemetry/telemetry.go.

cmd/api (REST, outbox relay, consumer, policy loop)​

VariableDefaultRequired?Meaning
HTTP_ADDR:8080noListen address of the REST server. Its port must equal the chart's service.targetPort.
DATABASE_URLnoneyesPostgres DSN. Boot error DATABASE_URL is required when empty.
MIGRATIONS_DATABASE_URLvalue of DATABASE_URLnoDirect (non-pooled, session-mode) DSN used only for the embedded boot migrations.
KAFKA_BROKERSnoneyesComma-separated broker list (blanks trimmed). Used by the outbox relay, the consumer and the /readyz Kafka check.
OFFER_AVAILABILITY_CONSUMER_GROUPnoneyesStable consumer group id of the offer-availability consumer. Never derive it from the pod name.
PRICING_CURRENCYBRLnoThe one ISO 4217 currency every price is in. Must be three upper-case letters or boot fails.
POLICY_INTERVAL5snoInterval of the clock-driven policy pass (publish-boundaries, expire-quotes). Go duration or plain seconds; malformed or non-positive logs a warning and uses the default.
OUTBOX_RELAY_INTERVAL1snoOutbox relay poll interval. Go duration or plain seconds; malformed or non-positive falls back to the default with a warning.
OUTBOX_MAX_ATTEMPTS20noFailures before the relay excludes an outbox row from claims. 0 = unlimited; negative or unparsable falls back to 20 with a warning.
SHUTDOWN_DRAIN_DELAY5snoWait after /readyz flips to 503 before the listener closes. 0 disables; invalid or negative uses the default.
LOG_LEVELinfonodebug, info, warn (or warning) or error, case-insensitive; anything else is info.
OTEL_SERVICE_NAMEpricingnoservice.name of spans, metrics and the Loki app label.
OTEL_EXPORTER_OTLP_ENDPOINTlocalhost:4317noCollector OTLP/gRPC endpoint (host:port or URL). Export never blocks startup or requests.
SERVICE_VERSIONdevnoservice.version resource attribute.
ENVIRONMENTlocalnodeployment.environment.name resource attribute.

cmd/a2a (read-only A2A agent)​

The agent has no Kafka, outbox or consumer, so it reads none of those variables.

VariableDefaultRequired?Meaning
A2A_ADDR:8093noListen address of the JSON-RPC server.
A2A_AGENT_URLnoneyesAbsolute http(s) URL of this agent's JSON-RPC endpoint, advertised on the Agent Card (ADR 0007). A relative or schemeless value is refused at boot. The chart defaults it to http://<release>-a2a.<ns>.svc.cluster.local:8093/.
DATABASE_URLnoneyesPostgres DSN of the same database the api uses.
MIGRATIONS_DATABASE_URLvalue of DATABASE_URLnoDirect DSN for the boot migrations (the agent runs the same embedded, idempotent migrations).
LOG_LEVELinfonoSame values as the api.
OTEL_SERVICE_NAMEpricing-a2anoservice.name of spans and metrics.
OTEL_EXPORTER_OTLP_ENDPOINTlocalhost:4317noCollector OTLP/gRPC endpoint.
SERVICE_VERSIONdevnoservice.version and the version on the Agent Card.
ENVIRONMENTlocalnodeployment.environment.name resource attribute.

cmd/mcp (read-only MCP server)​

The server has no Kafka, outbox or consumer, so it reads none of those variables, and no auth variable (MCP is unauthenticated fleet-wide).

VariableDefaultRequired?Meaning
MCP_ADDR:8090noListen address of the Streamable HTTP server (/mcp, / and /healthz). Its port must equal the chart's mcp.service.targetPort.
DATABASE_URLnoneyesPostgres DSN of the same database the api uses. Boot error DATABASE_URL is required when empty.
MIGRATIONS_DATABASE_URLvalue of DATABASE_URLnoDirect DSN for the boot migrations (the server runs the same embedded, idempotent migrations).
LOG_LEVELinfonoSame values as the api.
OTEL_SERVICE_NAMEpricing-mcpnoservice.name of spans and metrics.
OTEL_EXPORTER_OTLP_ENDPOINTlocalhost:4317noCollector OTLP/gRPC endpoint.
SERVICE_VERSIONdevnoservice.version resource attribute, also logged on the mcp server starting line.
ENVIRONMENTlocalnodeployment.environment.name resource attribute, also logged on the mcp server starting line.

Validation order and boot errors​

cmd/api validates in loadRuntime before anything is opened or bound: DATABASE_URL, then KAFKA_BROKERS, then PRICING_CURRENCY (if set), then each consumer group variable. The first failure is returned (exit code 1, message logged as service exited with error). cmd/a2a joins every problem (DATABASE_URL, A2A_AGENT_URL) into one invalid configuration: error, and cmd/mcp returns invalid configuration: DATABASE_URL is required... before telemetry, any connection or the listener.

Unparsable tuning values (POLICY_INTERVAL, OUTBOX_RELAY_INTERVAL, OUTBOX_MAX_ATTEMPTS, SHUTDOWN_DRAIN_DELAY) never abort boot: they log a warning naming the variable and use the default, so a typo cannot silently remove the relay's attempt cap.

Chart values to variables​

Env varChart key
HTTP_ADDRconfig.httpAddr
LOG_LEVELconfig.logLevel
PRICING_CURRENCYconfig.currency (empty = not rendered)
POLICY_INTERVALconfig.policyInterval (empty = not rendered)
OFFER_AVAILABILITY_CONSUMER_GROUPconfig.offerAvailabilityConsumerGroup (required)
OUTBOX_RELAY_INTERVALconfig.outboxRelayInterval
OUTBOX_MAX_ATTEMPTSconfig.outboxMaxAttempts (chart default 20)
SHUTDOWN_DRAIN_DELAYconfig.shutdownDrainDelay
DATABASE_URLdatabase.url or database.existingSecret (always a Secret)
MIGRATIONS_DATABASE_URLdatabase.migrationsExistingSecretKey / database.migrationsUrl
KAFKA_BROKERSkafka.brokers (required)
OTEL_EXPORTER_OTLP_ENDPOINTotel.endpoint (rendered only when otel.enabled)
OTEL_SERVICE_NAMEotel.serviceName (a2a gets <serviceName>-a2a, mcp gets <serviceName>-mcp)
ENVIRONMENTenvironment (chart default production)
SERVICE_VERSIONimage tag, or appVersion when empty
A2A_ADDRa2a.httpAddr
A2A_AGENT_URLa2a.agentUrl
MCP_ADDRmcp.httpAddr (its port must equal mcp.service.targetPort)

The chart refuses any *_MODE variable and any *_CONSUMER_GROUP in extraEnv, and refuses a terminationGracePeriodSeconds that does not exceed the drain delay plus 40 seconds.