Skip to content

feat(stack): bundle Plane-B fan-in OTel Collector as a supervised child (RIG-2825) - #672

Draft
rigel-mintaka wants to merge 2 commits into
mainfrom
compass-obs/rig-2825-otel-collector
Draft

feat(stack): bundle Plane-B fan-in OTel Collector as a supervised child (RIG-2825)#672
rigel-mintaka wants to merge 2 commits into
mainfrom
compass-obs/rig-2825-otel-collector

Conversation

@rigel-mintaka

Copy link
Copy Markdown
Contributor

Add the T4 fan-in OpenTelemetry Collector to the compass stack as a
supervised container component, mirroring the S4 postgres-as-container
pattern (core-builds-spec / adapter-runs-podman split). Realizes design
record #656 D3: a receives-by-default, drops-by-default local fan-in
endpoint (OTLP grpc+http receiver -> nop sink, health_check readiness,
no disk buffering) that on-host surfaces emit to; agent emission already
lands, server/runner emission is the T4b follow-up.

  • go/internal/stack/collector_{image,container}.go: pinned image digest,
    pure spec builder, deterministic per-state-dir container name, D3 config.
  • go/internal/stack/adapters/collector_container.go: podman run/stop/rm/
    exists + HTTP health probe adapter (reuses the postgres containerCLI seam).
  • stack.go: startCollector/waitCollector inserted early in the spawn chain
    (before server/runner, the emitters), collector added to reverse-order
    teardown; --otel-external opts out of the bundled collector entirely.
  • downdetached.go: ComponentCollector added to the cross-process teardown
    liveTargets table so a detached down tears the container down by name.
  • main.go: --collector-image + --otel-external flags, wired through
    resolveConfig/buildDeps.

Tests: unit (spec/name/config-posture/spawn-chain/teardown) + podman
integration (TestCollectorUpDown, TestExternalOTLPUpDown) green; build,
vet, gofmt, golangci-lint clean.

Co-authored-by: Matt Wilkinson matt@rigel.build

…ld (RIG-2825)

Add the T4 fan-in OpenTelemetry Collector to the compass stack as a
supervised container component, mirroring the S4 postgres-as-container
pattern (core-builds-spec / adapter-runs-podman split). Realizes design
record #656 D3: a receives-by-default, drops-by-default local fan-in
endpoint (OTLP grpc+http receiver -> nop sink, health_check readiness,
no disk buffering) that on-host surfaces emit to; agent emission already
lands, server/runner emission is the T4b follow-up.

- go/internal/stack/collector_{image,container}.go: pinned image digest,
  pure spec builder, deterministic per-state-dir container name, D3 config.
- go/internal/stack/adapters/collector_container.go: podman run/stop/rm/
  exists + HTTP health probe adapter (reuses the postgres containerCLI seam).
- stack.go: startCollector/waitCollector inserted early in the spawn chain
  (before server/runner, the emitters), collector added to reverse-order
  teardown; --otel-external opts out of the bundled collector entirely.
- downdetached.go: ComponentCollector added to the cross-process teardown
  liveTargets table so a detached `down` tears the container down by name.
- main.go: --collector-image + --otel-external flags, wired through
  resolveConfig/buildDeps.

Tests: unit (spec/name/config-posture/spawn-chain/teardown) + podman
integration (TestCollectorUpDown, TestExternalOTLPUpDown) green; build,
vet, gofmt, golangci-lint clean.

Co-authored-by: Matt Wilkinson <matt@rigel.build>
@linear-code

linear-code Bot commented Aug 27, 2026

Copy link
Copy Markdown

RIG-2825

@github-actions

github-actions Bot commented Aug 27, 2026

Copy link
Copy Markdown

Compass engineering docs preview: https://compass-obs-rig-2825-otel-co.compass-eng-docs.pages.dev

Deployed from compass-obs/rig-2825-otel-collector at b074ebf.

…etic teardown test (RIG-2825)

Address the #672 review (0 high, 2 medium, 4 low) and compass-native's
seam-review nit. All doc/test folds to the record's own intent; no
behavioral change to the collector runtime path.

- downdetached.go (M1): the drain-budget doc comment was numerically
  stale after the collector joined the teardown chain — corrected the
  ordering (runner → server → collector → postgres), the SIGTERM-path sum
  (65s), and the escalation worst case (15+(30+5)+(10+5)+(10+5)=80s), and
  generalized the postKillGrace comment to the three non-runner components.
- downdetached_test.go (M2): add hermetic cross-process collector-teardown
  coverage (TestDownDetachedCollectorContainerTornDownByName + …EscalatesToRemove).
  The leak the integration test caught once (liveTargets not knowing
  ComponentCollector) was defended only behind the podman build tag; these
  run on the default lane and fail if the collector is dropped from the
  order slice. Also shrink collectorDrainBudget in shrinkBudgets so the
  escalation test does not pay the real 10s stop budget.
- collector_container_test.go (L3): assert the launched-but-never-ready
  collector is drained on the failure path in TestCollectorNeverReady.
- adapters/collector_container.go (L2): drop collectorStopSeconds (a
  byte-identical copy of the postgres adapter's stopSeconds in the same
  package) and call stopSeconds directly.
- collector_container.go (L1): scope the "concurrent stacks never collide"
  comments to the container namespace — the fixed loopback host-port binds
  assume one stack per host (like postgres's default 5432).
- stack.go (seam nit): hold the collector health endpoint on the Stack in
  startCollector so waitCollector reads it instead of rebuilding the spec.

Co-authored-by: Matt Wilkinson <matt@rigel.build>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant