Skip to content

feat: standard OpAMP protobuf + e2e integration status - #120

Merged
zzylol merged 2 commits into
mainfrom
pr/otel-integration
Apr 4, 2026
Merged

zzylol merged 2 commits into
mainfrom
pr/otel-integration

Conversation

@zzylol

@zzylol zzylol commented Apr 4, 2026

Copy link
Copy Markdown
Contributor

Summary

Rewrites the controller's OpAMP WebSocket server to speak the standard OpAMP
protobuf protocol. Adds OpAMP extension and S3 exporter to the sketchcol builder.

E2E Integration Test Results (real test, not simulated)

Step What Status Evidence
1. Controller starts Rust binary, HTTP API on :8080, OpAMP on :4320 curl /api/v1/agents returns {}
2. Collector connects countminsketchcol with opampextension → controller WS Controller returns {"test-agent-1":"agent"}
3. Plan submitted POST /api/v1/plan → planner → YAML → OpAMP push agents_notified: 1, sketch_type: KLL
4. Controller sends protobuf ServerToAgent { remote_config } binary frame Unit tests verify encode/decode round-trip
5. Collector receives config opampextension decodes ServerToAgent ❌ not supported Extension logs show no config received
6. Collector applies config Pipeline restarts with new sketch processor ❌ not supported opampextension lacks AcceptsRemoteConfig

Root cause

The opampextension in opentelemetry-collector-contrib does not implement
AcceptsRemoteConfig
. It only supports:

  • ReportsEffectiveConfig — reports current config to server
  • ReportsHealth — reports health status
  • ReportsAvailableComponents — reports available components

It does NOT support:

  • AcceptsRemoteConfig — receive and apply config from server
  • Config hot-reload based on server push

This is a known limitation of the upstream extension. The OpAMP spec defines
AcceptsRemoteConfig as a capability, but the Go implementation doesn't have it.

Potential solutions

Solution Effort How it works Pros Cons
A. OpAMP Supervisor Low Use opamp-go supervisor — a separate process that manages the collector, receives OpAMP remote config, writes it to a file, and restarts the collector Standard OpAMP approach; no fork needed; collector binary unchanged Extra process to manage; restart latency (~seconds)
B. Fork opampextension Medium Add AcceptsRemoteConfig to the Go extension — decode ServerToAgent.remote_config, write YAML to confmap, trigger collector reload In-process; no restart; fastest config application Requires maintaining a fork of opentelemetry-collector-contrib
C. HTTP polling Low Collector uses httpprovider with a watcher that polls GET /api/v1/config/:metric periodically; controller updates the config, collector re-fetches No OpAMP needed; works with any collector binary Polling delay (seconds); not push-based; collector must know which metric to poll
D. File-based + fsnotify Low Controller writes YAML to a shared volume; collector uses fileprovider with --config file:config.yaml; fsnotify triggers reload on file change Simple; works today with OTel's built-in file watching Requires shared filesystem; not suitable for distributed deployments
E. Contribute upstream High Submit PR to opentelemetry-collector-contrib adding AcceptsRemoteConfig to opampextension Benefits entire community; no fork maintenance Long review cycle; may not align with upstream priorities

Recommended path: Solution A (OpAMP Supervisor) for immediate use, then Solution E
(upstream contribution)
for long-term. The supervisor approach is the officially
recommended way to use OpAMP for remote config in the OTel ecosystem.

What this PR still delivers (works today)

  1. Standard OpAMP protobuf on the wire — future-proof for when AcceptsRemoteConfig is available
  2. OpAMP connection establishment — controller sees agents, can identify roles
  3. httpprovider bootstrap — collectors start with controller-generated config
  4. S3 dual-path config — sketch pipeline + raw backup (paper §3 Fig.1)
  5. Per-metric HTTP configGET /api/v1/config/:metric serves YAML on demand

Files changed (8 files, +1382 −18)

File What
proto/opamp.proto (+1079) Standard OpAMP protobuf spec
proto/anyvalue.proto (+67) OpAMP dependency
build.rs (+7) prost-build compiles proto
Cargo.toml (+5) +prost, +bytes, +prost-build
src/opamp/mod.rs (+106 −18) Protobuf ServerToAgent send, AgentToServer receive
sketchcol/builder-config.yaml (+8 −1) +opampextension, +awss3exporter
sketchcol/config-dual-path.yaml (+76) Sketch + S3 dual pipeline
sketchcol/config-with-opamp.yaml (+52) OpAMP-connected collector config

Tests

  • 329 pass total
  • push_to_role_delivers_yaml_to_agent_role — protobuf binary encode → WebSocket → decode → verify YAML body + hash
  • push_to_agent_role_does_not_reach_backend_role — role-based routing verified with protobuf

🤖 Generated with Claude Code

@zzylol
zzylol force-pushed the pr/window-optimizer-gaps branch 7 times, most recently from 670cac9 to e029122 Compare April 4, 2026 19:35
Base automatically changed from pr/window-optimizer-gaps to main April 4, 2026 19:39
Completes the OTel config delivery chain:

1. sketchcol builder: add opampextension + awss3exporter
   - OpAMP: controller pushes config updates to running collectors
   - S3: raw data backup path (paper §3 Fig.1)

2. config-with-opamp.yaml: collector connects to controller via
   OpAMP WebSocket, receives config pushes at runtime (no restart)

3. config-dual-path.yaml: dual pipeline — sketch path (fast,
   approximate) + S3 path (raw backup for ad-hoc queries)

Config delivery options (ordered by capability):
  a) httpprovider: one-shot fetch at startup (already on main)
  b) OpAMP: push-based, runtime config updates (this PR)
  c) Per-metric: GET /api/v1/config/:metric (already on main)

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@zzylol
zzylol force-pushed the pr/otel-integration branch from c3655ed to c357a51 Compare April 4, 2026 19:54
@zzylol zzylol changed the title feat: OTel end-to-end integration — label_matchers fix, bootstrap configs, unified sketchcol feat: sketchcol OpAMP + S3 dual-path — complete OTel config delivery chain Apr 4, 2026
Rewrites the controller's OpAMP server to speak the standard OpAMP
protobuf protocol (open-telemetry/opamp-spec), replacing the custom
JSON wire format. The opampextension in OTel Collectors can now
connect directly.

Controller changes:
- proto/opamp.proto + proto/anyvalue.proto: OpAMP spec protobuf
- build.rs: prost-build compiles proto at build time
- Cargo.toml: +prost, +bytes, +prost-build
- opamp/mod.rs:
  - Send: RemoteConfig → ServerToAgent { remote_config: AgentRemoteConfig {
      config: AgentConfigMap { "": AgentConfigFile { body: yaml_bytes } } } }
    as protobuf binary WebSocket frame
  - Receive: decode AgentToServer protobuf (effective_config, health)
  - Backward compat: still accepts legacy JSON AgentStatus text frames
  - encode_remote_config() builds standard OpAMP ServerToAgent message
  - Tests updated to decode protobuf instead of JSON

This means the controller can now push sketch configs (sketch type,
parameters, window duration, label matchers, delta settings) to
running collectors at runtime — the exact YAML that
generate_agent_config() produces is wrapped in standard OpAMP framing.

sketchcol changes:
- builder-config.yaml: +opampextension, +awss3exporter
- config-with-opamp.yaml: collector with OpAMP extension connecting to controller
- config-dual-path.yaml: sketch pipeline + S3 raw backup (paper §3 Fig.1)

329 tests pass.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@zzylol zzylol changed the title feat: sketchcol OpAMP + S3 dual-path — complete OTel config delivery chain feat: standard OpAMP protobuf protocol — controller pushes sketch configs to running collectors Apr 4, 2026
@zzylol zzylol changed the title feat: standard OpAMP protobuf protocol — controller pushes sketch configs to running collectors feat: standard OpAMP protobuf — controller pushes sketch configs to collectors at runtime Apr 4, 2026
@zzylol zzylol changed the title feat: standard OpAMP protobuf — controller pushes sketch configs to collectors at runtime feat: standard OpAMP protobuf + e2e integration status Apr 4, 2026
@zzylol
zzylol merged commit 93fdf37 into main Apr 4, 2026
@zzylol
zzylol deleted the pr/otel-integration branch April 4, 2026 22:21
SieDeta pushed a commit that referenced this pull request Apr 17, 2026
* feat: sketchcol OpAMP extension + S3 dual-path + config examples

Completes the OTel config delivery chain:

1. sketchcol builder: add opampextension + awss3exporter
   - OpAMP: controller pushes config updates to running collectors
   - S3: raw data backup path (paper §3 Fig.1)

2. config-with-opamp.yaml: collector connects to controller via
   OpAMP WebSocket, receives config pushes at runtime (no restart)

3. config-dual-path.yaml: dual pipeline — sketch path (fast,
   approximate) + S3 path (raw backup for ad-hoc queries)

Config delivery options (ordered by capability):
  a) httpprovider: one-shot fetch at startup (already on main)
  b) OpAMP: push-based, runtime config updates (this PR)
  c) Per-metric: GET /api/v1/config/:metric (already on main)

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>

* feat: standard OpAMP protobuf protocol + sketchcol OpAMP + S3 dual-path

Rewrites the controller's OpAMP server to speak the standard OpAMP
protobuf protocol (open-telemetry/opamp-spec), replacing the custom
JSON wire format. The opampextension in OTel Collectors can now
connect directly.

Controller changes:
- proto/opamp.proto + proto/anyvalue.proto: OpAMP spec protobuf
- build.rs: prost-build compiles proto at build time
- Cargo.toml: +prost, +bytes, +prost-build
- opamp/mod.rs:
  - Send: RemoteConfig → ServerToAgent { remote_config: AgentRemoteConfig {
      config: AgentConfigMap { "": AgentConfigFile { body: yaml_bytes } } } }
    as protobuf binary WebSocket frame
  - Receive: decode AgentToServer protobuf (effective_config, health)
  - Backward compat: still accepts legacy JSON AgentStatus text frames
  - encode_remote_config() builds standard OpAMP ServerToAgent message
  - Tests updated to decode protobuf instead of JSON

This means the controller can now push sketch configs (sketch type,
parameters, window duration, label matchers, delta settings) to
running collectors at runtime — the exact YAML that
generate_agent_config() produces is wrapped in standard OpAMP framing.

sketchcol changes:
- builder-config.yaml: +opampextension, +awss3exporter
- config-with-opamp.yaml: collector with OpAMP extension connecting to controller
- config-dual-path.yaml: sketch pipeline + S3 raw backup (paper §3 Fig.1)

329 tests pass.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>

---------

Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
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