Skip to content

feat(metrics): add programmable metric pipeline IR, single-region engine, and live generations - #3424

Closed
lukesteensen wants to merge 0 commit into
programmable-phase1-metric-kernelsfrom
programmable-exploration
Closed

lukesteensen wants to merge 0 commit into
programmable-phase1-metric-kernelsfrom
programmable-exploration

Conversation

@lukesteensen

@lukesteensen lukesteensen commented Nov 25, 2026 •

Copy link
Copy Markdown
Contributor

Summary

This draft PR is the core programmable metrics baseline (Phases 2–5 + RAR telemetry), stacked directly on Phase 1 (#3427) so its diff contains only the new IR, compiled single-region engine, live generation switching, RAR telemetry, and dynamic delivery preview—without repeating Phase 0 or Phase 1.

PR Stack

  1. fix(topology,http): fix component memory bounds accounting and skip unused proxy TLS setup #3426 — Phase 0 standalone fixes (independent, base: main, 2 commits)
  2. chore(metrics): extract pure metric processing kernels into saluki-transform-kernels #3427 — Phase 1 pure metric kernels saluki-metric-kernels (base: main, 6 commits)
  3. feat(metrics): add programmable metric pipeline IR, single-region engine, and live generations #3424 (this PR) — Phases 2–5 programmable metrics baseline + RAR telemetry (base: programmable-phase1-metric-kernels, 11 commits)
  4. perf(dogstatsd,metric-plan): push whole-program blocklist drop predicate into DogStatsD ingress #3440 — Whole-program blocklist drop pushdown into DogStatsD ingress (base: programmable-exploration, 1 commit)

Why

Today ADP's metrics path fans across 6–10 separate Tokio transform tasks connected by EventsBuffer channels (mapper -> prefix_filter -> no_agg_split -> tag_filterlist -> aggregate -> post_agg_filter -> host_tags -> route_filter). That makes whole-pipeline reasoning, live topology updates, and cross-stage optimization difficult, and adds task/channel/memory overhead on production containers (0.05–1.2 CPUs).

Building on the pure kernels in #3427, this PR lowers native datadog.yaml config into a small whole-program IR (MetricPlan) and executes it in one compiled region:

  • Correctness by construction: native components and the compiled region execute the exact same pure kernels.
  • Inspectability & verification: offline agent-data-plane debug explain-metrics-plan [--json], static telemetry-contract warnings, and fast in-process deterministic simulation (proptest).
  • Single-region execution & live updates: zero intermediate channels inside the region, atomic stateless plan swaps (preserving in-flight aggregation state), exact LCM bucket-boundary cuts for stateful window changes, and RAR-compatible per-operator telemetry.
  • Foundation for whole-program optimizations: see perf(dogstatsd,metric-plan): push whole-program blocklist drop predicate into DogStatsD ingress #3440 stacked on top for blocklist drop pushdown (-28%..-34% CPU, -65%..-88% RSS).

Commit Reading Guide (11 linear commits on top of #3427)

  • Phase 2 — Pipeline IR, validator, interpreter, lowering, explain (3 commits):
    • 1bdd240587: lib/saluki-metric-plan typed DAG IR (policy as literals; host tags & operational signals as runtime bindings), declarative effect contracts, validator, and static telemetry-contract analyzer.
    • 57f6f71e1a: Deterministic single-threaded ReferenceInterpreter supporting 0, 1, or N stateful Aggregate operators.
    • 7dbd0adddf: Native SalukiConfiguration lowering, explain_plan, offline agent-data-plane debug explain-metrics-plan [--json], and native-vs-interpreter differential tests.
  • Phase 3 — Single-region engine, boot-time gated (3 commits):
    • d9f315401f: Dead-node / constant-drop optimizer, flat compiled FusedMetricEngine, and proptest engine-vs-interpreter simulation.
    • 7837a48a41: MetricRegionTransform hosting FusedMetricEngine in a single Tokio task.
    • 0df8da30c4: Boot-time flag experimental.programmable_metrics.enabled (default false) wiring Sources -> metrics_region -> Encoders.
  • Phase 4 — Live generations, exact cuts, and hot-path polish (3 commits):
    • c2b7d0357d: Admission stamping, semantic plan diffing, atomic stateless swaps, exact LCM bucket-boundary cuts (single- and multi-stage chained aggregates, safe against backward clock skew), rollback, and proptest cut-conservation simulation.
    • 9f69e9e90d: Live native reloads (metric_filter, tag_filterlist, MRF metric_mirroring), expected_tags_duration expiry, dogstatsd top context snapshots, firm MemoryBounds, invalid-mapper degradation parity, JMX-over-DogStatsD stream classification, and 3-way differential matrix tests.
    • a57ad2e477: Hot-path polish (~50 lines): reusable scratch buffers, zero-copy move_batch header swaps, non-timestamped TimestampSplit fast path, 1024-metric chunked flushes with 256-slot retained buffer caps, and a bounded per-context cache in TagFilterKernel (declared in specify_bounds).
  • Phase 5 — Dynamic delivery preview (1 commit, standalone):
    • cef0cb0cf9: DeliveryHost (lib/saluki-components/src/forwarders/delivery_host.rs) demonstrating live recipient add, in-place API-key rotation, transport replacement with graceful drain, failover routing, and task reclamation. (Not yet wired into DatadogForwarder.)
  • Staging readiness — RAR telemetry (1 commit):
    • c0cdb35610: Per-operator RAR-compatible telemetry (aggregator.*, filterlist.*, tag_filterlist.*, dogstatsd.listener_filtered_points, no_aggregation.*) accumulated as plain u64s inside saluki-metric-plan (zero saluki-metrics coupling) and published once per batch/flush in MetricRegion.

Verification

  • Unit, property, lint, and architecture checks:
    • cargo check --workspace --tests & cargo clippy --workspace --all-targets -- -D warnings — 0 warnings
    • saluki-metric-kernels + saluki-metric-plan (including proptest randomized engine & cut-conservation simulations) + architecture-tests — 80/80 passed
    • agent-data-plane (including value-exact 3-way native vs. interpreter vs. MetricRegionTransform differential tests) — 353/353 passed
    • saluki-components (metric_region, delivery_host) — 8/8 passed
  • End-to-end Panoramic (with DD_EXPERIMENTAL_PROGRAMMABLE_METRICS_ENABLED=true):
    • 34/34 Docker-runnable DogStatsD + OTLP metrics correctness cases passed against the real Datadog Core Agent (including 70/70 internal telemetry series parity). (K8s dsd-origin-detection-matrix-* skipped locally due to no kind.)
    • 54/54 Linux integration cases passed (including dogstatsd-top, dogstatsd-invalid-mapper-profile, strict memory bounds, RAR registration, and liveness).

Local A/B Benchmark (Native vs. Programmable Baseline, same release image)

Measured on Linux Docker containers under both production-like --cpus cgroup limits and 4-core SMP using the exact SMP lading traffic profiles (DD_EXPERIMENTAL_PROGRAMMABLE_METRICS_ENABLED=false vs. true):

Scenario CPU / Saturation Throughput (native → prog) Steady RSS (MiB) Peak HWM (MiB)
idle @ 0.3 CPU 0.006 → 0.005 cores (-6.6%) 30.6 → 30.3 (-0.9%) 30.6 → 30.3 (-0.9%)
dsd 1 MiB/s, 3k ctx @ 0.3 CPU 0.022 → 0.020 cores (-7.7%) 53.9 → 51.1 (-5.2%) 53.9 → 51.1 (-5.2%)
dsd 10 MiB/s, 10k ctx @ 0.6 CPU (60s) 0.081 → 0.078 cores (-4.0%) 76.1 → 69.1 (-9.2%) 76.9 → 74.0 (-3.8%)
otlp 5 MiB/s @ 0.6 CPU (30s, sat.) 6.55 → 6.52 MiB/s (-0.5% ingress) 886.7 → 890.6 (+0.4%) 886.7 → 890.6 (+0.4%)
dsd 100 MiB/s, 3k ctx @ 4.0 CPU (SMP) 0.504 → 0.499 cores (-1.1%) 78.8 → 68.6 (-13.0%) 78.8 → 71.5 (-9.3%)
routing dual-ship 500 MiB/s @ 1.2 CPU (30s, sat.) 366.4 → 369.1 MiB/s (+0.7% ingress) 52.8 → 54.4 (+3.0%) 59.4 → 61.0 (+2.8%)
mapper profiles 10 MiB/s, 3k ctx @ 1.2 CPU (30s) 0.062 → 0.058 cores (-6.4%) 44.0 → 42.5 (-3.5%) 54.1 → 52.1 (-3.8%)
tagfilter 1k rules 100 MiB/s, 78k ctx @ 4.0 CPU 0.760 → 0.742 cores (-2.4%) 274.7 → 259.8 (-5.4%) 318.5 → 320.8 (+0.7%)
tagvalue 10k rules 100 MiB/s, 78k ctx @ 4.0 CPU 0.784 → 0.749 cores (-4.5%) 310.2 → 312.4 (+0.7%) 343.4 → 343.1 (-0.1%)
tagvalue 1r repl25 100 MiB/s, 78k ctx @ 4.0 CPU 0.783 → 0.738 cores (-5.8%) 243.8 → 241.2 (-1.1%) 288.6 → 287.1 (-0.5%)

(See #3440 stacked on top for whole-program blocklist pushdown results: -28% to -34% CPU and -65% to -88% RSS.)

Sample agent-data-plane debug explain-metrics-plan output
MetricPlan v1 (native-metrics-pipeline)
Status: VALID (18 nodes, 18 edges, 1 stateful)
Sources: dogstatsd, liveness, otlp, trace_sampler
Targets: client_telemetry, primary, mrf

Nodes (topological order):
   1. dsd_in source                 [pure] reads=(none) writes=(none) stream=dogstatsd => [dsd_mapper]
   2. liveness_in source                 [pure] reads=(none) writes=(none) stream=liveness => [metrics_merge]
   3. otlp_in source                 [pure] reads=(none) writes=(none) stream=otlp => [metrics_merge]
   4. trace_sampler_in source                 [pure] reads=(none) writes=(none) stream=trace_sampler => [metrics_merge]
   5. dsd_mapper map                    [pure] reads=(name) writes=(name,tags) profiles=0 => [dsd_prefix_filter]
   6. dsd_prefix_filter prefix_filter          [may_drop] reads=(name,values) writes=(name) prefix="acme" blocklist=2 filter_values=1 prefix_rules=0 => [dsd_no_agg_split]
   7. dsd_no_agg_split timestamp_split        [may_drop] reads=(values,timestamps) writes=(values) ports=(aggregate,passthrough) => [aggregate->dsd_tag_filterlist, passthrough->dsd_post_agg_merge]
   8. dsd_tag_filterlist tag_filter             [pure] reads=(name,tags,values) writes=(tags) key_rules=1 value_rules=0 => [dsd_agg]
   9. dsd_agg aggregate              [stateful,may_drop] reads=(name,tags,values,timestamps,metadata) writes=(name,values,timestamps,metadata) window=10s limit=1000000 expiry=300s flush_open=false hist_stats=5 => [dsd_post_agg_merge]
  10. dsd_post_agg_merge merge                  [pure] reads=(none) writes=(none) fan-in => [dsd_post_agg_filter]
  11. dsd_post_agg_filter post_aggregate_filter  [may_drop] reads=(name,values) writes=(none) filter_values=1 agg_suffixes=4 pct_suffixes=1 => [dsd_post_agg_tee]
  12. dsd_post_agg_tee tee                    [pure] reads=(none) writes=(none) fan-out => [dsd_client_telemetry_out, metrics_merge]
  13. dsd_client_telemetry_out emit                   [pure] reads=(none) writes=(none) target=client_telemetry => [-]
  14. metrics_merge merge                  [pure] reads=(none) writes=(none) fan-in => [metrics_fanout]
  15. metrics_fanout tee                    [pure] reads=(none) writes=(none) fan-out => [primary_out, mrf_metrics_gateway]
  16. mrf_metrics_gateway route_filter           [may_drop] reads=(name,binding:mirroring) writes=(none) mirroring(enabled=true,active=false,allowlist=0,binding=Some("mrf_mirroring")) => [mrf_out]
  17. primary_out emit                   [pure] reads=(none) writes=(none) target=primary => [-]
  18. mrf_out emit                   [pure] reads=(none) writes=(none) target=mrf => [-]

Telemetry contract warnings (2):
  - warning: contract `internal_telemetry`: node `dsd_prefix_filter` prefixes expected series `aggregator.processed` with `acme`
  - warning: contract `internal_telemetry`: node `dsd_prefix_filter` prefixes expected series `aggregator.flushed` with `acme`

Known Gaps (Intentionally Deferred Pending Alignment)

  • Origin-grouped active-context telemetry (aggregate_active_contexts_by_origin): main RAR telemetry (aggregator.*, filterlist.*, tag_filterlist.*, no_aggregation.*) is now wired; origin-breakdown active-context gauges can follow cleanly if needed.
  • Ultra-heavy streaming flush: MetricRegion still collects a flush tick's emitted metrics before calling dispatch_emitted (fine at 3k–10k contexts, adds peak memory at 78k–250k contexts).
  • End-to-end soak & K8s coverage: needs multi-hour soak, K8s dsd-origin-detection-matrix-*, and live Remote Config churn against Core Agent.
  • Phase 5/6: wiring DeliveryHost into DatadogForwarder, external program installation / panic containment, and Remote Config authoring format.

Questions for Maintainers

  1. Multi-source stream identity: Currently MetricRegion separates DogStatsD (including JMX-over-DogStatsD) from passthrough sources via Some(MetricOrigin::OriginMetadata { .. }). Should production use explicit multi-input ports on Transform (pairs well with the typed-Event breakup discussion) or side-carried stream identity?
  2. Internal telemetry contracts: Does accumulating plain u64 deltas inside saluki-metric-plan and publishing via RegionTelemetryEmitter keyed by logical NodeId feel like the right separation?
  3. Validation vs. degradation boundary: Does keeping validate_plan strictly fail-closed while handling Datadog-Agent-compatible startup degradation (e.g., invalid dogstatsd_mapper_profiles) inside native_pipeline_config feel like the right split?
  4. Sequencing: Does landing Phase 0 (fix(topology,http): fix component memory bounds accounting and skip unused proxy TLS setup #3426) and Phase 1 (chore(metrics): extract pure metric processing kernels into saluki-transform-kernels #3427) first, then reviewing this baseline (feat(metrics): add programmable metric pipeline IR, single-region engine, and live generations #3424) and pushdown (perf(dogstatsd,metric-plan): push whole-program blocklist drop predicate into DogStatsD ingress #3440), make sense as the ramp path?

@lukesteensen lukesteensen added the changelog/no-changelog No changelog entry needed label Nov 25, 2026
@dd-octo-sts dd-octo-sts Bot added area/core Core functionality, event model, etc. area/io General I/O and networking. area/components Sources, transforms, and destinations. transform/aggregate Aggregate transform. transform/dogstatsd-mapper DogStatsD Mapper synchronous transform. labels Nov 25, 2026
@pr-commenter

pr-commenter Bot commented Nov 25, 2026 •

Copy link
Copy Markdown

Binary Size Analysis (Agent Data Plane)

Baseline: 70e6f7a · Comparison: a38d3c9 · diff
Analysis Configuration: optimized-release profile, stripped binaries · Pass/Fail Threshold: +5%
Sizes: 25.48 MiB (baseline) vs 26.23 MiB (comparison)
Size Change: +764.38 KiB (+2.93%)

✅ Binary size difference within threshold

Changes by Module
Module File Size Symbols
core +171.21 KiB 7612
saluki_components::transforms::metric_region +105.37 KiB 41
alloc +71.98 KiB 611
saluki_metric_plan::engine::flush_steps +54.61 KiB 3
[sections] +50.71 KiB 6
agent_data_plane::run_inner::_{{closure}} -37.54 KiB 17
saluki_metric_plan::engine::FusedMetricEngine +36.45 KiB 7
saluki_components::transforms::aggregate -34.72 KiB 87
saluki_metric_plan::validate::validate_plan +32.86 KiB 1
saluki_common::sync::live +23.96 KiB 104
saluki_metric_kernels::aggregate::AggregateCore<M> +21.58 KiB 6
saluki_metric_plan::optimize::optimize_plan +21.11 KiB 1
saluki_metric_plan::lowering::lower_native_pipeline +20.07 KiB 1
serde_json +19.52 KiB 445
agent_data_plane::cli::debug +19.24 KiB 112
saluki_metric_plan::explain::explain_plan +17.63 KiB 1
agent_data_plane::cli::run -17.03 KiB 57
agent_data_plane::components::tag_filterlist -15.88 KiB 47
agent_data_plane::components::dogstatsd_filterlist -14.11 KiB 9
saluki_components::config::metrics_endpoint_routing +13.40 KiB 4
Detailed Symbol Changes
    FILE SIZE        VM SIZE    
 --------------  -------------- 
  +7.3%  +757Ki  +7.3%  +757Ki    [17774 Others]
  [NEW] +76.4Ki  [NEW] +76.4Ki    saluki_components::common::datadog::io::run_endpoint_io_loop::_{{closure}}::ha274398775f9ba92
  [NEW] +53.9Ki  [NEW] +53.9Ki    datadog_agent_runtime::env::workload::RemoteAgentWorkloadProvider::new::_{{closure}}::hd0a76415963563a5
  [NEW] +51.9Ki  [NEW] +51.9Ki    agent_data_plane::async_main::_{{closure}}::hb413671bacf8516f
  [NEW] +50.4Ki  [NEW] +50.4Ki    agent_data_plane::cli::run::create_topology::_{{closure}}::ha95baef280632ea6
  [NEW] +49.7Ki  [NEW] +49.7Ki    saluki_components::common::otlp::OtlpServerConfiguration::build::_{{closure}}::hecd36de9bd11b4d9
  [NEW] +49.1Ki  [NEW] +49.1Ki    _<saluki_components::sources::apm::Apm as saluki_core::components::sources::Source>::run::_{{closure}}::_{{closure}}::hdb7210262c52af06
  [NEW] +46.6Ki  [NEW] +46.6Ki    saluki_components::common::otlp::traces::translator::OtlpTracesTranslator::translate_spans::ha70da7a6779521fa
  [NEW] +45.8Ki  [NEW] +45.8Ki    _<agent_data_plane::internal::control_surfaces::DogStatsDAPIWorker as saluki_core::runtime::supervisable::Supervisable>::initialize::_{{closure}}::h35783dbfb0fd3953
  [NEW] +45.7Ki  [NEW] +45.7Ki    agent_data_plane::cli::run::handle_run_command::_{{closure}}::h72668d6de8e9a243
  [NEW] +41.7Ki  [NEW] +41.7Ki    tonic::transport::channel::endpoint::Endpoint::connect_with_connector::_{{closure}}::hd87031cb653f8f45
  [DEL] -41.7Ki  [DEL] -41.7Ki    tonic::transport::channel::endpoint::Endpoint::connect_with_connector::_{{closure}}::h00de95b6d071d37d
  [DEL] -44.0Ki  [DEL] -44.0Ki    agent_data_plane::async_main::_{{closure}}::h5b64f8fb7f2e9017
  [DEL] -45.8Ki  [DEL] -45.8Ki    _<agent_data_plane::internal::control_surfaces::DogStatsDAPIWorker as saluki_core::runtime::supervisable::Supervisable>::initialize::_{{closure}}::h570fc174b30f5efa
  [DEL] -45.8Ki  [DEL] -45.8Ki    agent_data_plane::cli::run::handle_run_command::_{{closure}}::hb6f23a4be081312a
  [DEL] -46.6Ki  [DEL] -46.6Ki    saluki_components::common::otlp::traces::translator::OtlpTracesTranslator::translate_spans::h5001e1224a15452e
  [DEL] -49.1Ki  [DEL] -49.1Ki    _<saluki_components::sources::apm::Apm as saluki_core::components::sources::Source>::run::_{{closure}}::_{{closure}}::h251427e452fe9f5b
  [DEL] -49.7Ki  [DEL] -49.7Ki    saluki_components::common::otlp::OtlpServerConfiguration::build::_{{closure}}::hc41914257871659d
  [DEL] -51.5Ki  [DEL] -51.5Ki    agent_data_plane::cli::run::create_topology::_{{closure}}::ha3f51eed17ba1999
  [DEL] -53.9Ki  [DEL] -53.9Ki    datadog_agent_runtime::env::workload::RemoteAgentWorkloadProvider::new::_{{closure}}::h428e01725eb0faed
  [DEL] -76.4Ki  [DEL] -76.4Ki    saluki_components::common::datadog::io::run_endpoint_io_loop::_{{closure}}::h356c76359686f33e
  +2.9%  +764Ki  +2.7%  +764Ki    TOTAL

@pr-commenter

pr-commenter Bot commented Nov 25, 2026 •

Copy link
Copy Markdown

Regression Detector (Agent Data Plane)

Run ID: ceb71401-57bd-4c9d-9e51-54417266e8c1
Baseline: 70e6f7a7 · Comparison: a38d3c92 · diff

Optimization Goals: ✅ No significant changes detected

Fine details of change detection per experiment (5)

Experiments configured erratic: true are tagged (ignored) and skipped when determining which experiments regressed or improved. Experiments which are detected as erratic at runtime are tagged (erratic) to flag that the run's sample dispersion was high, but their regression / improvement signal still counts.

experiment goal Δ mean % links
quality_gates_rss_dsd_ultraheavy (erratic) memory utilization ⚪ +1.87 metrics profiles logs
quality_gates_rss_dsd_heavy memory utilization ⚪ +1.74 metrics profiles logs
quality_gates_rss_idle memory utilization ⚪ +1.16 metrics profiles logs
quality_gates_rss_dsd_low memory utilization ⚪ +0.86 metrics profiles logs
quality_gates_rss_dsd_medium memory utilization ⚪ +0.16 metrics profiles logs
Bounds Checks: ✅ Passed (5)
experiment check replicates observed links
quality_gates_rss_dsd_heavy memory_usage 10/10 ✅ 212.21MiB ≤ 250MiB metrics profiles logs
quality_gates_rss_dsd_low memory_usage 10/10 ✅ 46.91MiB ≤ 55MiB metrics profiles logs
quality_gates_rss_dsd_medium memory_usage 10/10 ✅ 77.20MiB ≤ 92MiB metrics profiles logs
quality_gates_rss_dsd_ultraheavy memory_usage 10/10 ✅ 359.61MiB ≤ 420MiB metrics profiles logs
quality_gates_rss_idle memory_usage 10/10 ✅ 30.86MiB ≤ 36MiB metrics profiles logs
Explanation

A change is flagged as a regression when |Δ mean %| > 5.00% in the regressing direction for its optimization goal AND SMP marks the experiment as a regression (is_regression: true). Improvements use the matching criteria for the improving direction. Experiments configured erratic: true (tagged (ignored)) are skipped outright; experiments detected as erratic at runtime (tagged (erratic)) still count, since that flag describes sample dispersion rather than directional certainty. The Δ mean % cell is colored accordingly: 🟢 = improvement, 🔴 = regression, ⚪ = neutral. Reduction in CPU or memory is an improvement; reduction in ingress throughput is a regression. Experiments tagged (no analysis) show ⚠️ n/a: SMP ran them but produced no analysis, usually because a replicate failed and exhausted its retries. Check the SMP report for that experiment's replicate failures.

@dd-octo-sts dd-octo-sts Bot added the source/dogstatsd DogStatsD source. label Nov 25, 2026
@lukesteensen
lukesteensen force-pushed the programmable-exploration branch from 4e4d129 to c0cdb35 Compare November 25, 2026 15:03
@lukesteensen
lukesteensen changed the base branch from main to programmable-phase1-metric-kernels November 25, 2026 15:03
@dd-octo-sts dd-octo-sts Bot removed area/core Core functionality, event model, etc. area/io General I/O and networking. source/dogstatsd DogStatsD source. transform/dogstatsd-mapper DogStatsD Mapper synchronous transform. labels Nov 25, 2026
@lukesteensen lukesteensen changed the title [Exploration] Programmable metrics pipeline: pure kernels, whole-program IR, single-region engine, live generations, and dynamic delivery [Exploration] Programmable metrics baseline: IR, single-region engine, live generations, RAR telemetry, and dynamic delivery Nov 25, 2026
@lukesteensen lukesteensen changed the title [Exploration] Programmable metrics baseline: IR, single-region engine, live generations, RAR telemetry, and dynamic delivery feat(metrics): add programmable metric pipeline IR, single-region engine, and live generations Nov 25, 2026
@lukesteensen
lukesteensen force-pushed the programmable-phase1-metric-kernels branch 2 times, most recently from 68bca9f to e8e6d6d Compare December 2, 2026 15:55
@lukesteensen
lukesteensen force-pushed the programmable-exploration branch 2 times, most recently from b42546b to a6ee440 Compare December 2, 2026 16:12
@lukesteensen
lukesteensen force-pushed the programmable-phase1-metric-kernels branch from e8e6d6d to 05ec4b1 Compare December 2, 2026 16:20
@lukesteensen
lukesteensen force-pushed the programmable-exploration branch from a6ee440 to a38d3c9 Compare December 2, 2026 16:23
@lukesteensen
lukesteensen force-pushed the programmable-phase1-metric-kernels branch from 05ec4b1 to 86a3bac Compare December 2, 2026 17:32
@lukesteensen
lukesteensen force-pushed the programmable-exploration branch from a38d3c9 to cdb3820 Compare December 2, 2026 17:33
@lukesteensen
lukesteensen force-pushed the programmable-phase1-metric-kernels branch 2 times, most recently from 4518b03 to ce306ec Compare December 2, 2026 17:46
@lukesteensen
lukesteensen force-pushed the programmable-exploration branch from cdb3820 to ce306ec Compare December 2, 2026 17:47
gh-worker-dd-mergequeue-cf854d Bot pushed a commit that referenced this pull request Dec 2, 2026
…ransform-kernels` (#3427)

Peels off Phase 1 from #3424 as a purely mechanical, zero-behavior-change extraction.

Extracts deterministic, zero-async transformation domain logic into a new `lib/saluki-transform-kernels` crate (named to avoid overlap with `saluki-metrics` and accommodate future non-metrics transformation kernels) and delegates the existing components in `lib/saluki-components` and `bin/agent-data-plane/src/components/` as thin wrappers:

1. `metric_name`, `histogram`, and `filterlist` (`Blocklist`, `PrefixFilterKernel`, `PostAggregateFilterKernel`)
2. `routing_filter` (`MetricAllowlistKernel`, `MetricMirroring`, `compact_metric_prefixes`)
3. `timestamp_split` and `host_tags` (`HostTagsKernel`)
4. `tag_filter` (`TagFilterKernel`)
5. `mapper` (`MapperKernel`)
6. `aggregate` (`AggregateCore<M>`, `extract_closed_values`, `expand_flushed_metric`)

Verified with `cargo check --workspace --tests`, `cargo clippy --workspace --all-targets -- -D warnings`, `make check-unused-deps`, `saluki-transform-kernels` unit tests, `architecture-tests`, and end-to-end Panoramic suites (via #3424).

Co-authored-by: luke.steensen <luke.steensen@datadoghq.com>
dd-octo-sts Bot pushed a commit that referenced this pull request Dec 2, 2026
…ransform-kernels` (#3427)

Peels off Phase 1 from #3424 as a purely mechanical, zero-behavior-change extraction.

Extracts deterministic, zero-async transformation domain logic into a new `lib/saluki-transform-kernels` crate (named to avoid overlap with `saluki-metrics` and accommodate future non-metrics transformation kernels) and delegates the existing components in `lib/saluki-components` and `bin/agent-data-plane/src/components/` as thin wrappers:

1. `metric_name`, `histogram`, and `filterlist` (`Blocklist`, `PrefixFilterKernel`, `PostAggregateFilterKernel`)
2. `routing_filter` (`MetricAllowlistKernel`, `MetricMirroring`, `compact_metric_prefixes`)
3. `timestamp_split` and `host_tags` (`HostTagsKernel`)
4. `tag_filter` (`TagFilterKernel`)
5. `mapper` (`MapperKernel`)
6. `aggregate` (`AggregateCore<M>`, `extract_closed_values`, `expand_flushed_metric`)

Verified with `cargo check --workspace --tests`, `cargo clippy --workspace --all-targets -- -D warnings`, `make check-unused-deps`, `saluki-transform-kernels` unit tests, `architecture-tests`, and end-to-end Panoramic suites (via #3424).

Co-authored-by: luke.steensen <luke.steensen@datadoghq.com> 6c8f2e2
gh-worker-dd-mergequeue-cf854d Bot pushed a commit that referenced this pull request Dec 3, 2026
…hind `FlushCursor` (#3641)

## Summary

`AggregateCore` in `saluki-transform-kernels` currently exposes `contexts_and_remove_buf_mut`, `pending_removals`, `AggregatedMetric`, `FlushWindow`, `extract_closed_values`, and `expand_flushed_metric` so `AggregateState::flush` can iterate the internal `HashMap` directly across `dispatcher.push(...).await`.

This follow-up PR encapsulates the internal storage and flush mechanics behind an opaque `FlushCursor` API:

- Add `AggregateCore::begin_flush`, `AggregateCore::flush_chunk`, and `AggregateCore::finish_flush`.
- Add `AggregateCore::entry_size_bytes()` so callers account for memory bounds without depending on `AggregatedMetric`.
- Keep `AggregatedMetric`, `FlushWindow`, `extract_closed_values`, and `expand_flushed_metric` private inside `saluki-transform-kernels::aggregate`.
- Re-check emptiness in `finish_flush` before removing pending contexts so samples inserted between flush chunks are never dropped.
- Update `lib/saluki-components/src/transforms/aggregate/mod.rs` to drive flushes in bounded 1,024-context chunks and drop the mutable borrow on `AggregateCore` before awaiting downstream dispatch.

This keeps #3427 strictly mechanical while giving future dense aggregate storage (#3496) and interleaved resumable flushes (#3499) a clean crate boundary.

## Change Type
- [ ] Bug fix
- [ ] New feature
- [x] Non-functional
- [ ] Performance

## How did you test this PR?

- `cargo check --workspace --tests`
- `cargo clippy -p saluki-transform-kernels -p saluki-components --all-targets -- -D warnings`
- `cargo nextest run -p saluki-transform-kernels` (34/34 passed, including `chunked_flush_cursor_matches_full_flush_and_preserves_interleaved_inserts`)
- `cargo nextest run -p saluki-components -E 'test(transforms::aggregate)'` (41/41 passed)
- `make fmt`

## References

- Stacked on: #3427 (`programmable-phase1-metric-kernels`)
- Required by: #3424 (`programmable-exploration`)

Co-authored-by: luke.steensen <luke.steensen@datadoghq.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area/components Sources, transforms, and destinations. changelog/no-changelog No changelog entry needed transform/aggregate Aggregate transform.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant