From 3d73d9fd121c11886936239dccf94e4a824a02ef Mon Sep 17 00:00:00 2001 From: zz_y Date: Fri, 15 May 2026 15:47:48 -0600 Subject: [PATCH] refactor(emit): drop aggregation_id from OTAP YAML + Telegraf TOML wire MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Mirrors #244 / #246 / #250's PR-5 wire-cleanup pattern, now for the edge-side runtime emitters. The patched asap-otel processors (any runtime — OTel collector / OTAP / Telegraf) don't consume the controller-allocated `aggregation_id` string: sid identity is content-addressed at the backend via `(metric_name, attrs_fingerprint, agg_kind_canonical)`, and `policy_fp` content- matches via `(metric, sketch_kind, config, group_by_keys)`. The controller-allocated string is dead weight on the wire. The OTel-collector YAML emitter (`emit_edge_yaml`) was already clean — there's an existing test at stage_config.rs asserting the agent YAML does NOT contain `aggregation_id:`. This PR catches the two remaining edge-runtime emitters that still spelled it out: - `emit/otap.rs::build_asap_sketches_config` (line ~287): drop the `aggregation_id` map entry; keep `sketch_kind` etc. - `emit/telegraf.rs::emit_processors_allsketches` (line ~158): drop the `aggregation_id = "…"` TOML line; keep `sketch_kind`. `EdgeSketchProcessor.aggregation_id` stays on the struct as internal emitter plumbing for cross-stage references during the DAG walk (`SketchAgg → BackendAggregation → BackendReadout`); it just doesn't reach the wire from any runtime emitter anymore. Tests: 690 lib + 27 binary tests pass. (No test asserted the field was present in OTAP / Telegraf output, so nothing to flip.) Co-Authored-By: Claude Opus 4.7 (1M context) --- control_plane/src/emit/otap.rs | 11 +++++++---- control_plane/src/emit/telegraf.rs | 7 ++++++- 2 files changed, 13 insertions(+), 5 deletions(-) diff --git a/control_plane/src/emit/otap.rs b/control_plane/src/emit/otap.rs index 2ba50f227..ed056b90b 100644 --- a/control_plane/src/emit/otap.rs +++ b/control_plane/src/emit/otap.rs @@ -284,10 +284,13 @@ fn build_asap_sketches_config(sp: &EdgeSketchProcessor, window_secs: Option } else { m.insert("mode".into(), Value::String("batch".to_string())); } - m.insert( - "aggregation_id".into(), - Value::String(sp.aggregation_id.clone()), - ); + // PR 5 alignment (mirroring #244 / #246 / #250's wire cleanups): + // `aggregation_id` was the controller-allocated string IDs the + // patched asap-otel processors don't consume — sid identity is + // content-addressed at the backend via `(metric, attrs_fingerprint, + // agg_kind_canonical)`. The field stays on `EdgeSketchProcessor` + // as internal emitter plumbing for cross-stage references during + // the DAG walk; it just doesn't reach the wire here. m.insert( "sketch_kind".into(), Value::String(sketch_kind_tag(&sp.sketch_kind).into()), diff --git a/control_plane/src/emit/telegraf.rs b/control_plane/src/emit/telegraf.rs index 25fb59cc6..d28365d63 100644 --- a/control_plane/src/emit/telegraf.rs +++ b/control_plane/src/emit/telegraf.rs @@ -155,7 +155,12 @@ fn emit_processors_allsketches( if let Some(w) = window_secs { out.push_str(&format!(" window_duration = \"{w}s\"\n")); } - out.push_str(&format!(" aggregation_id = \"{}\"\n", sp.aggregation_id)); + // PR 5 alignment (mirroring #244 / #246 / #250's wire cleanups): + // `aggregation_id` was the controller-allocated string the + // patched asap-otel processors don't consume — sid identity is + // content-addressed server-side via `(metric, attrs_fingerprint, + // agg_kind_canonical)`. Field stays on `EdgeSketchProcessor` as + // internal emit plumbing; it just doesn't reach the wire here. out.push_str(&format!( " sketch_kind = \"{}\"\n", sketch_kind_tag(&sp.sketch_kind)