ADR 0015: Projector telemetry and the chart's OTel environment
Status
Accepted (2026-10-13, ecosystem gap fix D21). Extends ADR 0011 (standard metrics adoption) to the fourth binary and to the Helm chart; nothing in ADR 0011 changes.
Context
ADR 0011 wired internal/adapters/outbound/telemetry.Setup into cmd/api,
cmd/mcp and cmd/planning-reports. Two gaps remained:
cmd/planning-projector(the analytics writer, ADR 0005) never calledSetup: it exported no Go runtime metrics, installed no propagator and reported noservice.name, so a dead or slow projector was invisible on the fleet dashboards that filterservice_name=~"warehouse-planning.*".- The chart rendered none of
OTEL_EXPORTER_OTLP_ENDPOINT,SERVICE_VERSIONorENVIRONMENTon any Deployment, andwarehouse-infradoes not set them for this service either. Every pod therefore exported tolocalhost:4317(nothing listens there), reportedservice.version=devanddeployment.environment.name=local. The sibling charts (inbound-receiving, order-management, ...) already render all three fromenvironment,image.tagand anotelblock.
The fleet decision (gap-fix wave 2026-10-12, D21) is observability parity:
every projector and reports binary calls telemetry.Setup, and every chart
that injects the OTel environment does it the same way on every Deployment.
Decision
cmd/planning-projectorcallstelemetry.Setupat boot, before it opens the analytical pool, with service namewarehouse-planning-projector,SERVICE_VERSION(defaultdev),OTEL_EXPORTER_OTLP_ENDPOINT(defaultlocalhost:4317) andENVIRONMENT(defaultlocal, read by the adapter). The providers are flushed, bounded to 5 s, after the consumer and the pool are closed. Export never blocks: an unreachable Collector only drops telemetry, exactly like the other three binaries. The projector still creates no spans of its own (ADR 0014 §4).- The chart renders the OTel environment on every backend Deployment
(
api,mcp,analytics-projector,analytics-reports) with the sibling charts' values and shape:ENVIRONMENTfrom the new top-level valueenvironment(defaultlocal);SERVICE_VERSIONfromimage.tag, falling back to the chart'sappVersion;OTEL_EXPORTER_OTLP_ENDPOINTfromotel.endpoint(defaultotel-collector.observability.svc.cluster.local:4317, the Collector Servicewarehouse-infradeploys), only whileotel.enabled(defaulttrue). Thefrontend(nginx) Deployment gets none: it runs no Go binary.
SHUTDOWN_DRAIN_DELAYis rendered on theapiDeployment only, from the new valueconfig.shutdownDrainDelay(empty = not rendered, the binary's 5 s default applies; same shape as the siblings). It is not set on the other Deployments because no other binary reads it (cmd/api/main.gois the only reader;cmd/mcp,cmd/planning-projectorandcmd/planning-reportshave no drain delay).
Consequences
- In the kind cluster the four processes now export to the in-cluster
Collector and carry the image tag as
service.version. A cluster where the Collector lives elsewhere setsotel.endpoint; one without a Collector can setotel.enabled=false. - The projector appears on the context dashboard's runtime panels as
warehouse-planning-projector. environmentis a new top-level value;warehouse-inframay override it per environment, nothing else changes there.- Tests:
TestSetupTelemetry_InstallsTheSDKProvidersandTestFlushTelemetry_LogsAShutdownFailure(cmd/planning-projector), andcharts/warehouse-planning/tests/render_test.sh(every backend Deployment rendersENVIRONMENT,SERVICE_VERSIONand, withotel.enabled,OTEL_EXPORTER_OTLP_ENDPOINT; the api rendersSHUTDOWN_DRAIN_DELAYwhen set), run in CI by thechart-testsjob.