Skip to content

chore(metrics): extract pure metric processing kernels into saluki-transform-kernels - #3427

Merged
gh-worker-dd-mergequeue-cf854d[bot] merged 6 commits into
mainfrom
programmable-phase1-metric-kernels
Dec 2, 2026
Merged

gh-worker-dd-mergequeue-cf854d[bot] merged 6 commits into
mainfrom
programmable-phase1-metric-kernels

Conversation

@lukesteensen

@lukesteensen lukesteensen commented Nov 25, 2026 •

Copy link
Copy Markdown
Contributor

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).

@lukesteensen lukesteensen added the changelog/no-changelog No changelog entry needed label Nov 25, 2026
@dd-octo-sts dd-octo-sts Bot added 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: 76fda64 · Comparison: 19f12a3 · diff
Analysis Configuration: optimized-release profile, stripped binaries · Pass/Fail Threshold: +5%
Sizes: 25.47 MiB (baseline) vs 25.51 MiB (comparison)
Size Change: +44.00 KiB (+0.17%)

✅ Binary size difference within threshold

Changes by Module
Module File Size Symbols
saluki_components::transforms::aggregate -25.99 KiB 85
saluki_transform_kernels::aggregate::AggregateCore<M> +24.05 KiB 5
core +15.53 KiB 7298
agent_data_plane::components::dogstatsd_filterlist -14.11 KiB 9
agent_data_plane::components::tag_filterlist -12.12 KiB 47
saluki_transform_kernels::filterlist::compile_metric_filter +9.13 KiB 1
[sections] +8.67 KiB 5
saluki_transform_kernels::tag_filter::compile_filters_with_values +7.13 KiB 1
saluki_components::transforms::dogstatsd_mapper +5.59 KiB 13
[Unmapped] -3.04 KiB 1
anyhow +2.97 KiB 1129
regex_automata +2.84 KiB 7
saluki_transform_kernels::filterlist::Blocklist +2.83 KiB 5
_ZN91_<saluki_core +2.61 KiB 5
saluki_transform_kernels::filterlist::PostAggregateFilterKernel +2.38 KiB 2
saluki_transform_kernels::tag_filter::filter_tag +2.20 KiB 1
_RNvXst_NtNtCs27Vx93FoQ6z_4core3str7patternReNtB5_7Pattern15is_contained_in.12059 +2.12 KiB 1
_RNvXst_NtNtCs27Vx93FoQ6z_4core3str7patternReNtB5_7Pattern15is_contained_in.12846 +2.12 KiB 1
_RNvXst_NtNtCs27Vx93FoQ6z_4core3str7patternReNtB5_7Pattern15is_contained_in.12232 -2.12 KiB 1
_RNvXst_NtNtCs27Vx93FoQ6z_4core3str7patternReNtB5_7Pattern15is_contained_in.12943 -2.12 KiB 1
Detailed Symbol Changes
    FILE SIZE        VM SIZE    
 --------------  -------------- 
  [NEW] +76.4Ki  [NEW] +76.4Ki    saluki_components::common::datadog::io::run_endpoint_io_loop::_{{closure}}::h22f1758e86565588
  [NEW] +53.9Ki  [NEW] +53.9Ki    datadog_agent_runtime::env::workload::RemoteAgentWorkloadProvider::new::_{{closure}}::he8c187db11a9e514
  [NEW] +51.5Ki  [NEW] +51.5Ki    agent_data_plane::cli::run::create_topology::_{{closure}}::hbefc797a3e51c1c4
  [NEW] +49.7Ki  [NEW] +49.7Ki    saluki_components::common::otlp::OtlpServerConfiguration::build::_{{closure}}::hbd80c611f39b6dc7
  [NEW] +49.1Ki  [NEW] +49.1Ki    _<saluki_components::sources::apm::Apm as saluki_core::components::sources::Source>::run::_{{closure}}::_{{closure}}::h478daa44a562cad9
  +0.4% +44.0Ki  +0.5% +47.0Ki    [17223 Others]
  [NEW] +46.6Ki  [NEW] +46.6Ki    saluki_components::common::otlp::traces::translator::OtlpTracesTranslator::translate_spans::h56c2455fcebdf928
  [NEW] +45.8Ki  [NEW] +45.8Ki    agent_data_plane::cli::run::handle_run_command::_{{closure}}::h769cebe4294c01f2
  [NEW] +45.8Ki  [NEW] +45.8Ki    _<agent_data_plane::internal::control_surfaces::DogStatsDAPIWorker as saluki_core::runtime::supervisable::Supervisable>::initialize::_{{closure}}::h1eb85c1abed628aa
  [NEW] +44.0Ki  [NEW] +44.0Ki    agent_data_plane::async_main::_{{closure}}::h62a15278636446cc
  [NEW] +41.7Ki  [NEW] +41.7Ki    tonic::transport::channel::endpoint::Endpoint::connect_with_connector::_{{closure}}::h173124e03aca1fa3
  [DEL] -41.7Ki  [DEL] -41.7Ki    tonic::transport::channel::endpoint::Endpoint::connect_with_connector::_{{closure}}::hc44c65d2a81332c5
  [DEL] -44.0Ki  [DEL] -44.0Ki    agent_data_plane::async_main::_{{closure}}::h9cf59070708a6f55
  [DEL] -45.8Ki  [DEL] -45.8Ki    _<agent_data_plane::internal::control_surfaces::DogStatsDAPIWorker as saluki_core::runtime::supervisable::Supervisable>::initialize::_{{closure}}::h4962aeddebc20fed
  [DEL] -45.8Ki  [DEL] -45.8Ki    agent_data_plane::cli::run::handle_run_command::_{{closure}}::haeb5a71113ba8bab
  [DEL] -46.6Ki  [DEL] -46.6Ki    saluki_components::common::otlp::traces::translator::OtlpTracesTranslator::translate_spans::h52c04f32d0a202f5
  [DEL] -49.1Ki  [DEL] -49.1Ki    _<saluki_components::sources::apm::Apm as saluki_core::components::sources::Source>::run::_{{closure}}::_{{closure}}::h0c4606e0ae4e5d5a
  [DEL] -49.7Ki  [DEL] -49.7Ki    saluki_components::common::otlp::OtlpServerConfiguration::build::_{{closure}}::hfd9a04ca925372b5
  [DEL] -51.5Ki  [DEL] -51.5Ki    agent_data_plane::cli::run::create_topology::_{{closure}}::hb18f4c40d844ebd0
  [DEL] -53.9Ki  [DEL] -53.9Ki    datadog_agent_runtime::env::workload::RemoteAgentWorkloadProvider::new::_{{closure}}::h1c15b951fb949a7e
  [DEL] -76.4Ki  [DEL] -76.4Ki    saluki_components::common::datadog::io::run_endpoint_io_loop::_{{closure}}::h980f6a5a9ee81e45
  +0.2% +44.0Ki  +0.2% +47.0Ki    TOTAL

@pr-commenter

pr-commenter Bot commented Nov 25, 2026 •

Copy link
Copy Markdown

Regression Detector (Agent Data Plane)

Run ID: 91781f00-20d6-43f4-aef9-ed1d6dcd6ef1
Baseline: 76fda640 · Comparison: 19f12a36 · 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_heavy memory utilization ⚪ +0.17 metrics profiles logs
quality_gates_rss_dsd_ultraheavy (erratic) memory utilization ⚪ -0.03 metrics profiles logs
quality_gates_rss_dsd_medium memory utilization ⚪ -0.08 metrics profiles logs
quality_gates_rss_dsd_low memory utilization ⚪ -0.19 metrics profiles logs
quality_gates_rss_idle memory utilization ⚪ -0.75 metrics profiles logs
Bounds Checks: ✅ Passed (5)
experiment check replicates observed links
quality_gates_rss_dsd_heavy memory_usage 10/10 ✅ 213.37MiB ≤ 250MiB metrics profiles logs
quality_gates_rss_dsd_low memory_usage 10/10 ✅ 47.06MiB ≤ 55MiB metrics profiles logs
quality_gates_rss_dsd_medium memory_usage 10/10 ✅ 78.11MiB ≤ 92MiB metrics profiles logs
quality_gates_rss_dsd_ultraheavy memory_usage 10/10 ✅ 353.09MiB ≤ 420MiB metrics profiles logs
quality_gates_rss_idle memory_usage 10/10 ✅ 30.29MiB ≤ 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.

@datadog-prod-us1-4 datadog-prod-us1-4 Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Bits Code Review: PASS

More details

Validation is limited to static analysis of the metric-kernel extraction; runtime tests were not run, and production telemetry was excluded as requested.

Was this helpful? React 👍 or 👎

Open Bits AI session

🤖 Bits Code Review · Commit 95f135f

@lukesteensen
lukesteensen force-pushed the programmable-phase1-metric-kernels branch 2 times, most recently from 68bca9f to e8e6d6d Compare December 2, 2026 15:55

@datadog-prod-us1-4 datadog-prod-us1-4 Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Bits Code Review: PASS

More details

The completed static review identified no concrete failure mode in the extracted metric kernels or their component wrappers. Runtime behavior was not exercised.

Was this helpful? React 👍 or 👎

Open Bits AI session

🤖 Bits Code Review · Commit e8e6d6d

@lukesteensen
lukesteensen force-pushed the programmable-phase1-metric-kernels branch from e8e6d6d to 05ec4b1 Compare December 2, 2026 16:20

@datadog-prod-us1-4 datadog-prod-us1-4 Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Bits Code Review: PASS

More details

Validation is limited to static analysis of the metric-kernel extraction and its callers; runtime tests were not run, and production telemetry was excluded.

Was this helpful? React 👍 or 👎

Open Bits AI session

🤖 Bits Code Review · Commit 05ec4b1

@lukesteensen
lukesteensen force-pushed the programmable-phase1-metric-kernels branch from 05ec4b1 to 86a3bac Compare December 2, 2026 17:32
Comment thread lib/saluki-metric-kernels/Cargo.toml Resolved
@lukesteensen lukesteensen changed the title chore(metrics): extract pure metric processing kernels into saluki-metric-kernels chore(metrics): extract pure metric processing kernels into saluki-transform-kernels Dec 2, 2026
@lukesteensen
lukesteensen force-pushed the programmable-phase1-metric-kernels branch 2 times, most recently from 4518b03 to ce306ec Compare December 2, 2026 17:46
@tobz tobz changed the title chore(metrics): extract pure metric processing kernels into saluki-transform-kernels chore(metrics): extract pure metric processing kernels into saluki-transform-kernels Dec 2, 2026

@datadog-prod-us1-4 datadog-prod-us1-4 Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Bits Code Review: PASS

More details

Runtime equivalence remains unverified by execution: tests were not rerun, and production telemetry was intentionally excluded.

Was this helpful? React 👍 or 👎

Open Bits AI session

🤖 Bits Code Review · Commit ce306ec

@lukesteensen
lukesteensen force-pushed the programmable-phase1-metric-kernels branch from ce306ec to 21bb793 Compare December 2, 2026 20:00

@datadog-prod-us1-4 datadog-prod-us1-4 Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Bits Code Review: PASS

More details

Behavior preservation was assessed from source only; builds and tests were not independently rerun, and production telemetry was excluded.

Was this helpful? React 👍 or 👎

Open Bits AI session

🤖 Bits Code Review · Commit 21bb793

@lukesteensen
lukesteensen force-pushed the programmable-phase1-metric-kernels branch from 21bb793 to 19f12a3 Compare December 2, 2026 21:15

@datadog-prod-us1-4 datadog-prod-us1-4 Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Bits Code Review: PASS

More details

The completed static reviewer reported no actionable defects. Validation is limited to code inspection; builds and tests were not run.

Was this helpful? React 👍 or 👎

Open Bits AI session

🤖 Bits Code Review · Commit 19f12a3

@gh-worker-dd-mergequeue-cf854d
gh-worker-dd-mergequeue-cf854d Bot merged commit 6c8f2e2 into main Dec 2, 2026
144 checks passed
@gh-worker-dd-mergequeue-cf854d
gh-worker-dd-mergequeue-cf854d Bot deleted the programmable-phase1-metric-kernels branch December 2, 2026 23:03
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 mergequeue-status: done transform/aggregate Aggregate transform. transform/dogstatsd-mapper DogStatsD Mapper synchronous transform.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants