fix(metrics): dedup metrics v3 tags - #1817
Conversation
|
Regression Detector (Agent Data Plane)Run ID: Optimization Goals: ❌ 1 regression detected
Fine details of change detection per experiment (34)Experiments configured
Bounds Checks: ✅ Passed (5)
ExplanationA 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 ( |
Binary Size Analysis (Agent Data Plane)Baseline: 08cd4c4 · Comparison: 905d1e5 · diff ✅ Binary size difference within thresholdChanges by Module
Detailed Symbol Changes |
ef6d87a
into
tobz/datadog-metrics-v3-payload-support
There was a problem hiding this comment.
Pull request overview
This PR adjusts the Datadog metrics V3 encoder to deduplicate tags during encoding, addressing mismatches observed in validation mode where V2 and V3 tag hashing/representation diverged due to duplicate tags.
Changes:
- Introduce a reusable tag deduplicator for V3 batch encoding.
- Deduplicate the combined tag iterator before setting metric tags in V3.
- Deduplicate the tag iterator used when promoting
device/dd.internal.resource:*tags into V3 resources.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| let mut writer = v3::V3Writer::new(); | ||
| let mut tags_deduplicator = ReusableDeduplicator::new(); | ||
|
|
||
| for metric in metrics { | ||
| write_metric_to_v3(&mut writer, metric, additional_tags); | ||
| write_metric_to_v3(&mut writer, metric, additional_tags, &mut tags_deduplicator); |
| .chain(metric.context().origin_tags()); | ||
| let all_tags = tags_deduplicator | ||
| .deduplicated(chained_tags) | ||
| .filter(|t| is_sketch || !is_v3_series_resource_tag(t) && !is_v3_series_device_tag(t)) |
## Summary <!-- Please provide a brief summary about what this PR does. This should help the reviewers give feedback faster and with higher quality. --> Fixes logical mismatches found when testing the v3 pipeline in validation mode where v2 tag hashes differed from v3 the v3 tag hash. ## 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 --> ## References <!-- Please list any issues closed by this PR. --> <!-- - Closes: <issue link> --> <!-- Any other issues or PRs relevant to this PR? Feel free to list them here. -->
## Summary <!-- Please provide a brief summary about what this PR does. This should help the reviewers give feedback faster and with higher quality. --> Fixes logical mismatches found when testing the v3 pipeline in validation mode where v2 tag hashes differed from v3 the v3 tag hash. ## 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 --> ## References <!-- Please list any issues closed by this PR. --> <!-- - Closes: <issue link> --> <!-- Any other issues or PRs relevant to this PR? Feel free to list them here. -->
## Summary <!-- Please provide a brief summary about what this PR does. This should help the reviewers give feedback faster and with higher quality. --> Fixes logical mismatches found when testing the v3 pipeline in validation mode where v2 tag hashes differed from v3 the v3 tag hash. ## 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 --> ## References <!-- Please list any issues closed by this PR. --> <!-- - Closes: <issue link> --> <!-- Any other issues or PRs relevant to this PR? Feel free to list them here. -->
## Summary <!-- Please provide a brief summary about what this PR does. This should help the reviewers give feedback faster and with higher quality. --> Fixes logical mismatches found when testing the v3 pipeline in validation mode where v2 tag hashes differed from v3 the v3 tag hash. ## 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 --> ## References <!-- Please list any issues closed by this PR. --> <!-- - Closes: <issue link> --> <!-- Any other issues or PRs relevant to this PR? Feel free to list them here. -->
## Summary <!-- Please provide a brief summary about what this PR does. This should help the reviewers give feedback faster and with higher quality. --> Fixes logical mismatches found when testing the v3 pipeline in validation mode where v2 tag hashes differed from v3 the v3 tag hash. ## 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 --> ## References <!-- Please list any issues closed by this PR. --> <!-- - Closes: <issue link> --> <!-- Any other issues or PRs relevant to this PR? Feel free to list them here. -->
Summary
Fixes logical mismatches found when testing the v3 pipeline in validation mode where v2 tag hashes differed from v3 the v3 tag hash.
Change Type
How did you test this PR?
References