feat(deploy): add remote_config_path to stock asap-otel-agent OpAMP blocks - #391
Merged
Merged
Conversation
…locks PR #383 (and #389 follow-up) added the `RemoteConfigPath` field to the patched opampextension: when set, the extension applies pushed AgentRemoteConfig by writing the YAML to disk and exiting, so a restart-policy-enabled supervisor (Docker `restart: unless-stopped`, systemd, k8s) brings the agent back up with the new config. The mvp-smoke-test agent uses this field via its overlay-mounted `agent.yaml`, but the 13 stock agent yamls in `deploy/mvp-singlenode/configs/asap-otel-agent-*.yaml` still ship without it, so OpAMP-apply silently no-ops in stock single-node deploys (the controller's push is received, the extension reports back, but nothing is persisted across the implied restart — the next boot reloads the same static bootstrap yaml). This change adds `remote_config_path: /etc/otel/config.yaml` (the same path the collector boots from via `--config=/etc/otel/config.yaml`, and the same convention the smoke-test uses) to the `extensions.opamp:` block of every stock yaml that already declares one. Files touched (13): - asap-otel-agent-allsketches.yaml - asap-otel-agent-b0-prometheus.yaml - asap-otel-agent-b0-victoriametrics.yaml - asap-otel-agent-b1-serf-prometheus.yaml - asap-otel-agent-b3-delta-direct.yaml - asap-otel-agent-b5-gorilla-prometheus.yaml - asap-otel-agent-b5-gorilla-victoriametrics.yaml - asap-otel-agent-b6-asap-single-sketch.yaml - asap-otel-agent-b6-gorilla-s3.yaml - asap-otel-agent-cms-direct.yaml - asap-otel-agent-cs-direct.yaml - asap-otel-agent-hll-direct.yaml - asap-otel-agent-kll-direct.yaml The 6 stock yamls WITHOUT an `extensions.opamp:` block (`b0a-raw-stream`, `b0b-raw-batched`, `b2-full`, `b3-delta`, `b4-tunable`, `kafka-fragment`) are intentionally left alone — adding `remote_config_path` would require also wiring up `extensions:` + `service.extensions:`, which is out of scope for this sweep. OPERATIONAL CAVEAT (flagged inline + in each yaml's comment): the stock `agents-N{1,10,100}.yml` compose overlays mount `/etc/otel/config.yaml` read-only (`:ro` suffix on the bind mount) and do NOT set a restart policy on the agent service. As-shipped, the extension's disk-write will fail with EROFS and the agent process will exit without coming back. To actually exercise OpAMP-apply persistence in a stock deploy, the operator must additionally: 1. Drop `:ro` from the agent's config volume mount (so the opampextension can write back to the same path the collector boots from), and 2. Add `restart: unless-stopped` (or equivalent) to the agent service so the container respawns after the extension exits. The smoke-test's `mvp-smoke-test/compose/smoke-overlay.yml` does both via `volumes: !override` + `restart: unless-stopped` — that is the reference pattern. The compose-side wiring update is deferred to a follow-up so this PR stays narrowly scoped to the agent yaml schema. YAML validity verified with `python3 -c "import yaml; ..."` over all 19 stock agent yamls; the 13 modified files parse with `extensions.opamp.remote_config_path == "/etc/otel/config.yaml"`. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
5 tasks
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.
Summary
PR #383 (and #389 follow-up) added the
RemoteConfigPathfield to the patched opampextension: when set, the extension applies pushedAgentRemoteConfigby writing the YAML to disk and exiting, so a restart-policy-enabled supervisor brings the agent back with the new config. Themvp-smoke-testagent uses this field via its overlay-mountedagent.yaml, but the 13 stock agent yamls indeploy/mvp-singlenode/configs/asap-otel-agent-*.yamlstill ship without it — so OpAMP-apply silently no-ops in stock single-node deploys.This PR adds
remote_config_path: /etc/otel/config.yaml(the same path the collector boots from via--config=/etc/otel/config.yaml, and the same convention the smoke-test uses) to theextensions.opamp:block of every stock yaml that already declares one.Files touched (13)
All 13 stock
asap-otel-agent-*.yamlfiles with an existingextensions.opamp:block:asap-otel-agent-allsketches.yamlasap-otel-agent-b0-prometheus.yamlasap-otel-agent-b0-victoriametrics.yamlasap-otel-agent-b1-serf-prometheus.yamlasap-otel-agent-b3-delta-direct.yamlasap-otel-agent-b5-gorilla-prometheus.yamlasap-otel-agent-b5-gorilla-victoriametrics.yamlasap-otel-agent-b6-asap-single-sketch.yamlasap-otel-agent-b6-gorilla-s3.yamlasap-otel-agent-cms-direct.yamlasap-otel-agent-cs-direct.yamlasap-otel-agent-hll-direct.yamlasap-otel-agent-kll-direct.yamlThe 6 stock yamls WITHOUT an
extensions.opamp:block (b0a-raw-stream,b0b-raw-batched,b2-full,b3-delta,b4-tunable,kafka-fragment) are intentionally left alone — addingremote_config_pathwould require also wiring upextensions:+service.extensions:, which is out of scope for this sweep.Operational caveat (flagged inline in each yaml's comment)
The stock
agents-N{1,10,100}.ymlcompose overlays mount/etc/otel/config.yamlread-only (:rosuffix on the bind mount) and do NOT set a restart policy on the agent service. As-shipped, the extension's disk-write will fail withEROFSand the agent process will exit without coming back.To actually exercise OpAMP-apply persistence in a stock deploy, the operator must additionally:
:rofrom the agent's config volume mount (so the opampextension can write back to the same path the collector boots from), andrestart: unless-stopped(or equivalent) to the agent service so the container respawns after the extension exits.The smoke-test's
mvp-smoke-test/compose/smoke-overlay.ymldoes both viavolumes: !override+restart: unless-stopped— that is the reference pattern. The compose-side wiring update is deferred to a follow-up PR so this change stays narrowly scoped to the agent yaml schema.Test plan
python3 -c "import yaml; ..."(verified — every file parses withextensions.opamp.remote_config_path == "/etc/otel/config.yaml")asap-otel-agent-*.yamlfiles parse (sanity)agents-N{1,10,100}.ymloverlays to drop:ro+ addrestart: unless-stoppedso OpAMP-apply persists end-to-end in stock deploys🤖 Generated with Claude Code