Skip to content

fix(metrics): Make v2 series obey max per-payload series points (1.3.x backport) - #2081

Merged
gh-worker-dd-mergequeue-cf854d[bot] merged 1 commit into
releases/1.3.xfrom
jszwedko/backport-2055-1.3.x
Jul 10, 2026
Merged

fix(metrics): Make v2 series obey max per-payload series points (1.3.x backport)#2081
gh-worker-dd-mergequeue-cf854d[bot] merged 1 commit into
releases/1.3.xfrom
jszwedko/backport-2055-1.3.x

Conversation

@jszwedko

Copy link
Copy Markdown
Collaborator

Summary

Backports #2055 to releases/1.3.x.

Repairs a differential between DogStatsD and ADP: the v2 series request builder now obeys both max_metrics_per_payload and max_series_points_per_payload for /api/v2/series, splitting oversized payloads the same way DogStatsD does. v3 already handled this correctly. The regression was introduced by the metrics-encoder refactor (splitting into endpoint.rs / v2 / v3 modules), which 1.3.x carries.

Clean cherry-pick of 0025407262 (#2055) — 1.3.x shares main's encoder structure.

Validation

  • cargo check -p saluki-components passes.
  • Unit tests pass, including the new regression test v2_series_builder_enforces_max_series_points_per_payload.

🤖 Generated with Claude Code

## Summary
<!-- Please provide a brief summary about what this PR does.
This should help the reviewers give feedback faster and with higher quality. -->

Repair a differential between DogStatsd and ADP. This commit causes the series
builder to obey both the `max_metrics_per_payload` _and_ `max_series_points_per_payload`
for `/api/v2/series`. This is already correctly handled for v3. ADP will now split
payloads that are over-sized in a like manner to DogStatsd.

## Change Type
- [x] Bug fix
- [ ] New feature
- [ ] Non-functional (chore, refactoring, docs)
- [ ] Performance

## How did you test this PR?
<!-- Please how you tested these changes here -->

Included test, then Antithesis shot.

## References

<!-- Please list any issues closed by this PR. -->

<!--
- Closes: <issue link>
-->

REF SMPTNG-765

<!-- Any other issues or PRs relevant to this PR? Feel free to list them here. -->
Copilot AI review requested due to automatic review settings July 10, 2026 19:09
@jszwedko
jszwedko requested a review from a team as a code owner July 10, 2026 19:09
@dd-octo-sts dd-octo-sts Bot added area/components Sources, transforms, and destinations. encoder/datadog-metrics Datadog Metrics encoder. labels Jul 10, 2026

Copilot AI 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.

Pull request overview

Backport of the v2 series payload-splitting fix to releases/1.3.x, ensuring /api/v2/series request construction enforces both max_metrics_per_payload and max_series_points_per_payload, aligning ADP behavior with DogStatsD (v3 already enforced point limits correctly).

Changes:

  • Apply max_series_points_per_payload to the v2 request builder when targeting series endpoints (V1/V2).
  • Extend EndpointConfiguration to carry max_series_points_per_payload and thread it through configuration construction.
  • Add a regression unit test verifying v2 series payloads never exceed the configured per-payload point limit and that all points are emitted.

Reviewed changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated no comments.

File Description
lib/saluki-components/src/encoders/datadog/metrics/v2/mod.rs Enforces per-payload data-point limits for series endpoints in the v2 request builder.
lib/saluki-components/src/encoders/datadog/metrics/mod.rs Threads the new endpoint configuration parameter and adds a regression test for v2 point-limit splitting.
lib/saluki-components/src/encoders/datadog/metrics/endpoint.rs Extends EndpointConfiguration with max_series_points_per_payload and exposes an accessor.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@pr-commenter

pr-commenter Bot commented Jul 10, 2026

Copy link
Copy Markdown

Binary Size Analysis (Agent Data Plane)

Baseline: f546aa0 · Comparison: cca78dc · diff
Analysis Configuration: stripped binaries · Pass/Fail Threshold: +5%
Sizes: 41.66 MiB (baseline) vs 41.66 MiB (comparison)
Size Change: -5.12 KiB (-0.01%)

✅ Binary size difference within threshold

Changes by Module
Module File Size Symbols
anon.4fce6c7d2aa45dd9a6f02a2c0752f076.498.llvm.9573164220153040075 -17.32 KiB 1
anon.c1c414352e857dde7a9d7b1ad53124cc.132.llvm.4296059611656155176 +17.32 KiB 1
anon.7795f5375d38aceee11397747b095f1d.30.llvm.2564832767356818503 +7.24 KiB 1
anon.ad91e51c62512cff203a6c63aaecf20c.398.llvm.18240059250610999947 -7.24 KiB 1
anon.898e98222521ce4d0253cf6d0fc1e7b5.386.llvm.18051895962526366587 +2.29 KiB 1
anon.5b27047855e512a391407cf865a8bccb.8.llvm.4723099464652966178 -2.28 KiB 1
saluki_components::common::datadog -2.08 KiB 26
tokio -1.90 KiB 45
anon.4fce6c7d2aa45dd9a6f02a2c0752f076.89.llvm.9174026662507420928 +1.68 KiB 1
anon.71c724bfafdc7ef059b797a72fbace77.13.llvm.8347600808629000313 -1.68 KiB 1
anon.8378b7a0900881ccbbf90fe1ca172908.45.llvm.12360786860623467473 -1.34 KiB 1
anon.84ee839d07d34c4642938df11db7617c.66.llvm.15813203203614711742 -1.34 KiB 1
anon.5565a01ffa835d379ccb42561fbc2231.58.llvm.14277099931082214193 +1.34 KiB 1
anon.9e7fe21941eb14193087d4323bb508b7.149.llvm.18246841136514536931 +1.34 KiB 1
anon.9f57deab38cb447f7dd82e5766cd87af.24.llvm.16874604699339231193 -1.33 KiB 1
anon.5b93ae75a70061f493f939c9825259bb.56.llvm.7062792288990175982 +1.32 KiB 1
anon.4ad83413d91ec1b5e3631d1dde603515.3.llvm.14890587780386234679 -1.23 KiB 1
anon.54d99dc5dd0affd1e8de0751295dc995.1100.llvm.7520400692622734692 +1.23 KiB 1
core -1.20 KiB 297
anon.71cec01b0fb3e883aa3d98671f1fd27a.314.llvm.9747834397690803415 +1.15 KiB 1
Detailed Symbol Changes
    FILE SIZE        VM SIZE    
 --------------  -------------- 
  [NEW] +17.3Ki  [NEW]     +81    anon.c1c414352e857dde7a9d7b1ad53124cc.132.llvm.4296059611656155176
  [NEW] +7.24Ki  [NEW]     +79    anon.7795f5375d38aceee11397747b095f1d.30.llvm.2564832767356818503
  [NEW] +2.36Ki  [NEW] +2.21Ki    saluki_components::encoders::datadog::metrics::v2::create_v2_request_builder::_{{closure}}::h2e1993ad4d90ef2d
  [NEW] +2.29Ki  [NEW]     +76    anon.898e98222521ce4d0253cf6d0fc1e7b5.386.llvm.18051895962526366587
  [NEW] +2.10Ki  [NEW]     +61    core::ptr::drop_in_place<std::sync::poison::PoisonError<std::sync::poison::rwlock::RwLockReadGuard<quick_cache::shard::CacheShard<stringtheory::MetaString,core::option::Option<saluki_components::transforms::dogstatsd_mapper::CachedMapResult>,saluki_common::cache::weight::WrappedWeighter<saluki_common::cache::weight::ItemCountWeighter>,foldhash::quality::RandomState,saluki_common::cache::expiry::ExpiryCapableLifecycle<stringtheory::MetaString>,alloc::sync::Arc<quick_cache::sync_placeholder::Placeholder<core::option::Option<saluki_components::transforms::dogstatsd_mapper::CachedMapResult>>>>>>>::hf6397604845b9bd1
  [NEW] +1.68Ki  [NEW]     +95    anon.4fce6c7d2aa45dd9a6f02a2c0752f076.89.llvm.9174026662507420928
  [NEW] +1.34Ki  [NEW]     +22    anon.5565a01ffa835d379ccb42561fbc2231.58.llvm.14277099931082214193
  [NEW] +1.34Ki  [NEW]     +22    anon.9e7fe21941eb14193087d4323bb508b7.149.llvm.18246841136514536931
  [NEW] +1.32Ki  [NEW]     +92    anon.5b93ae75a70061f493f939c9825259bb.56.llvm.7062792288990175982
  [NEW] +1.31Ki  [NEW] +1.03Ki    quick_cache::shard::CacheShard<Key,Val,We,B,L,Plh>::search::hb55e8b815e013c3e
  [DEL] -1.31Ki  [DEL] -1.03Ki    quick_cache::shard::CacheShard<Key,Val,We,B,L,Plh>::search::h7250839cd3a71682
  [DEL] -1.33Ki  [DEL]     -92    anon.9f57deab38cb447f7dd82e5766cd87af.24.llvm.16874604699339231193
  [DEL] -1.34Ki  [DEL]     -22    anon.8378b7a0900881ccbbf90fe1ca172908.45.llvm.12360786860623467473
  [DEL] -1.34Ki  [DEL]     -22    anon.84ee839d07d34c4642938df11db7617c.66.llvm.15813203203614711742
  [DEL] -1.68Ki  [DEL]     -95    anon.71c724bfafdc7ef059b797a72fbace77.13.llvm.8347600808629000313
  [DEL] -2.10Ki  [DEL]     -61    core::ptr::drop_in_place<std::sync::poison::PoisonError<std::sync::poison::rwlock::RwLockReadGuard<quick_cache::shard::CacheShard<alloc::string::String,saluki_components::sources::otlp::metrics::cache::Extrema,saluki_common::cache::weight::WrappedWeighter<saluki_common::cache::weight::ItemCountWeighter>,foldhash::quality::RandomState,saluki_common::cache::expiry::ExpiryCapableLifecycle<alloc::string::String>,alloc::sync::Arc<quick_cache::sync_placeholder::Placeholder<saluki_components::sources::otlp::metrics::cache::Extrema>>>>>>::h26e4c7e16f0481e3
  [DEL] -2.28Ki  [DEL]     -76    anon.5b27047855e512a391407cf865a8bccb.8.llvm.4723099464652966178
  [DEL] -2.33Ki  [DEL] -2.19Ki    saluki_components::encoders::datadog::metrics::v2::create_v2_request_builder::_{{closure}}::h60f188077acb0e58
  -0.2% -5.13Ki  -0.1% -3.40Ki    [4175 Others]
  [DEL] -7.24Ki  [DEL]     -79    anon.ad91e51c62512cff203a6c63aaecf20c.398.llvm.18240059250610999947
  [DEL] -17.3Ki  [DEL]     -81    anon.4fce6c7d2aa45dd9a6f02a2c0752f076.498.llvm.9573164220153040075
  -0.0% -5.12Ki  -0.0% -3.38Ki    TOTAL

@pr-commenter

pr-commenter Bot commented Jul 10, 2026

Copy link
Copy Markdown

Regression Detector (Agent Data Plane)

Run ID: 23b8380a-1c7b-4e09-a75a-bc3e23e889e4
Baseline: f546aa02 · Comparison: cca78dc6 · 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_low memory ⚪ +0.25 metrics profiles logs
quality_gates_rss_idle memory ⚪ +0.17 metrics profiles logs
quality_gates_rss_dsd_ultraheavy memory ⚪ -0.03 metrics profiles logs
quality_gates_rss_dsd_heavy memory ⚪ -0.17 metrics profiles logs
quality_gates_rss_dsd_medium memory ⚪ -0.27 metrics profiles logs
Bounds Checks: ✅ Passed (5)
experiment check replicates observed links
quality_gates_rss_dsd_heavy memory_usage 10/10 ✅ 135 MiB ≤ 140 MiB metrics profiles logs
quality_gates_rss_dsd_low memory_usage 10/10 ✅ 42.9 MiB ≤ 50 MiB metrics profiles logs
quality_gates_rss_dsd_medium memory_usage 10/10 ✅ 64.8 MiB ≤ 75 MiB metrics profiles logs
quality_gates_rss_dsd_ultraheavy memory_usage 10/10 ✅ 192 MiB ≤ 200 MiB metrics profiles logs
quality_gates_rss_idle memory_usage 10/10 ✅ 29 MiB ≤ 40 MiB 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.

@gh-worker-dd-mergequeue-cf854d
gh-worker-dd-mergequeue-cf854d Bot merged commit a2776c2 into releases/1.3.x Jul 10, 2026
81 of 82 checks passed
@gh-worker-dd-mergequeue-cf854d
gh-worker-dd-mergequeue-cf854d Bot deleted the jszwedko/backport-2055-1.3.x branch July 10, 2026 19:34
jszwedko added a commit that referenced this pull request Jul 10, 2026
…x backport) (#2081)

## Summary

Backports #2055 to `releases/1.3.x`.

Repairs a differential between DogStatsD and ADP: the v2 series request builder now obeys both `max_metrics_per_payload` **and** `max_series_points_per_payload` for `/api/v2/series`, splitting oversized payloads the same way DogStatsD does. v3 already handled this correctly. The regression was introduced by the metrics-encoder refactor (splitting into `endpoint.rs` / `v2` / `v3` modules), which 1.3.x carries.

Clean cherry-pick of `0025407262` (#2055) — 1.3.x shares main's encoder structure.

## Validation

- `cargo check -p saluki-components` passes.
- Unit tests pass, including the new regression test `v2_series_builder_enforces_max_series_points_per_payload`.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-authored-by: blt <brian.troutwine@datadoghq.com>
Co-authored-by: jesse.szwedko <jesse.szwedko@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. encoder/datadog-metrics Datadog Metrics encoder. mergequeue-status: done

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants