Skip to content

Delete dead code and call the Collector window a tumbling window - #612

Merged
zzylol merged 11 commits into
mainfrom
refactor/remove-dead-code
Nov 9, 2026
Merged

zzylol merged 11 commits into
mainfrom
refactor/remove-dead-code

Conversation

@zzylol

@zzylol zzylol commented Nov 9, 2026 •

Copy link
Copy Markdown
Contributor

Why

The Collector carries code that no build, test, deploy script or CI job uses, and its CollectorPlan contract has two fields that can only take one value. That code costs review and build time, and the "pane" wording makes readers think the Collector runs something other than a tumbling window. The Collector runs exactly one window type: a tumbling window of width W.

What

  • Remove the sliding-window mode from asap-precompute-go. That covers AggregationMode.Sliding, WindowSpec.Slide, the ring of closed windows, slideMs, panesPerWindow, rotateSlidingLocked and their tests. Without the sliding mode, rotationStepMs only forwarded to windowSizeMs, so its callers now call windowSizeMs directly.
  • CollectorPlan contract change, with no compatibility alias:
    • remove pane_secs and state_layout (they had to equal window_secs and "anchored-pane-v1");
    • rename window_secs to tumbling_window_secs (Go: TumblingWindowSecs).
      The Go decoder, the Rust mirror, the shared fixture and all tests are updated. window_implementation_id stays collector-tumbling-v1.
  • Delete asap-gorilla-rust/, the Serf processor/exporter/receiver, otel_collector_benchmark/, and the unused PipelineConfig loader in the Go SDK patch.
  • Delete the unused S3-direct cold settings from asap_edge and remove them from the one deploy config that still set them.
  • Remove about 25 comment citations of design-gos-unified-edge-telemetry.md, which was deleted when the design docs were consolidated. Fix other stale file paths and status lines.
  • Where a doc means the Collector's window, it now says "tumbling window" instead of "pane".

How

Deleted Why it was dead Evidence
Sliding mode, WindowSpec.Slide, closed-window ring, slideMs, panesPerWindow, rotateSlidingLocked, windowState.sketchFactory, rotationStepMs The runtime builds configs only from CollectorPlan, and the decoder rejects every framework except tumbling. asap_edge also checks Mode == Tumbling. git grep -w Sliding: no users outside window.go, config.go and their tests. The only Slide reader was the asap_edge shape check, which compared it to the window size.
pane_secs, state_layout Validation forced pane_secs == window_secs and state_layout == "anchored-pane-v1", so neither field carried information. collector_plan.go / collector_plan.rs validation. No other repo produces CollectorPlan on main.
asap-gorilla-rust/ No Cargo or Go dependency in this repo or in ASAPQuery-backend main. run_demo.sh only checked that the directory existed and passed it as a --build-context. Backend main has no data_plane/Dockerfile or control_plane/Dockerfile and no reference to gorilla.
serfprocessor, serfexporter, serfreceiver No deploy config uses the serf or serfhttp component types. The MVP README excludes the Serf comparison. git grep -i serf: only the builder manifest and comments.
otel_collector_benchmark/ Not built, run or referenced. The only hit was a .gitignore line, also removed.
opentelemetry-go-patch/sdk/metric/pipelineconfig.go (+ test) A file the patch adds (not in upstream opentelemetry-go). Only its own test calls it. git grep PipelineConfig: self-references only.
asap_edge cold endpoint, tsdb_bucket, tenant, region, access_key_id, secret_access_key, use_ssl Only config validation read them. No code writes to S3 from the edge. grep in the processor: no reads outside config_validate.go. Removed from asap-otel-agent-asap-gzip.yaml, the only config that set them. ship_endpoint is untouched.

run_demo.sh no longer requires or passes asap-gorilla-rust. The asap-otel builder manifest no longer lists the three Serf components.

Before

"window_secs": 60,
"abstract_window_framework": "tumbling",
"window_implementation_id": "collector-tumbling-v1",
"pane_secs": 60,
"state_layout": "anchored-pane-v1",

WindowSpec{Size, Slide, AllowedLateness}, with a Sliding mode that no producer could configure.

After

"tumbling_window_secs": 60,
"abstract_window_framework": "tumbling",
"window_implementation_id": "collector-tumbling-v1",

WindowSpec{Size, AllowedLateness}, with Tumbling and Batch modes. A plan that still sends window_secs, pane_secs or state_layout is now rejected as having unknown fields (the Rust decoder uses deny_unknown_fields, and the Go decoder rejects unknown fields too). This is the intended contract change.

Verification

  • cd asap-precompute-go && go vet ./... && go test ./...: pass.
  • cd opentelemetry-collector-contrib-patch/processor/asapedgeprocessor && go vet ./... && go test ./...: pass.
  • opentelemetry-go/sdk/metric (after restore): go build ./... && go vet . && go test . && go test ./internal/aggregate -run 'TestRowSampledSketch_': pass.
  • cd asap-precompute-rs && cargo fmt -- --check && cargo clippy --all-features --all-targets && cargo test --all-features: pass.
  • python3 -m unittest discover -s deploy/mvp-multinode/scripts/tests -p 'test_*.py': 20 tests OK.
  • bash -n deploy/mvp-multinode/scripts/run_demo.sh: OK.
  • The asap-otel distribution builds with OCB v0.141.0 from the updated manifest. asap-otel components lists no Serf component.
  • CI's MVP collector check fails on this PR as it already does on main: CI checks out asap_sketchlib main, and asap-precompute-rs does not build against its newer DdSketch API. This PR does not change that crate's sketch code; moving the collector to the latest asap_sketchlib and sketchlib-go is separate work.

zzylol added 11 commits November 9, 2026 03:11
The runtime only ever runs tumbling windows: the CollectorPlan decoder
rejects every non-tumbling framework and the edge processor checks for
Tumbling. Delete the Sliding mode, the WindowSpec.Slide field, the
closed-window ring and the helpers only it used, and their tests.
pane_secs had to equal window_secs and state_layout had to be the
constant anchored-pane-v1, so both carried no information. Remove them
from the Go and Rust plan decoders, the shared fixture and the tests,
and rename window_secs to tumbling_window_secs so the field says which
window it sizes.
Nothing in this repo or the backend depends on it. run_demo.sh only
checked that the directory existed and passed it as a docker build
context that no current backend Dockerfile reads.
No deploy config uses the serf or serfhttp component types, and the MVP
excludes the Serf comparison. Remove the three components and their
entries in the asap-otel builder config.
pipelineconfig.go is a file added by the patch, not an upstream file,
and nothing outside it and its test calls it.
The endpoint, tsdb_bucket, tenant, region, access_key_id,
secret_access_key and use_ssl cold fields were only read by config
validation; no code writes to S3 from the edge. Remove them and the one
deploy config that still set them.
design-gos-unified-edge-telemetry.md was removed when the design docs
were consolidated, but about 25 code comments still cited it. Drop the
dangling citations and leave the comments' content as is.
Point otel-app/probes.go at the runbook's current path and drop the
missing freshness-probe config it cited, drop the mention of a telegraf
restore script that does not exist, and mark the dual-mode aggregation
plan and the asap_edge design as implemented.
With the sliding mode gone, rotationStepMs only forwarded to
windowSizeMs.
@zzylol zzylol added documentation Improvements or additions to documentation enhancement New feature or request labels Nov 9, 2026
@zzylol
zzylol marked this pull request as ready for review November 9, 2026 03:36
@zzylol
zzylol force-pushed the refactor/remove-dead-code branch from adb26b2 to 76e96b9 Compare November 9, 2026 03:38
@zzylol
zzylol merged commit 13ed898 into main Nov 9, 2026
1 check failed
@zzylol
zzylol deleted the refactor/remove-dead-code branch November 9, 2026 03:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

documentation Improvements or additions to documentation enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant