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
Draft
feat(stack): bundle Plane-B fan-in OTel Collector as a supervised child (RIG-2825)#672rigel-mintaka wants to merge 2 commits into
rigel-mintaka wants to merge 2 commits into
Conversation
…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>
|
Compass engineering docs preview: https://compass-obs-rig-2825-otel-co.compass-eng-docs.pages.dev Deployed from |
…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>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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.
pure spec builder, deterministic per-state-dir container name, D3 config.
exists + HTTP health probe adapter (reuses the postgres containerCLI seam).
(before server/runner, the emitters), collector added to reverse-order
teardown; --otel-external opts out of the bundled collector entirely.
liveTargets table so a detached
downtears the container down by name.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